Skip to content

Commit

Permalink
[WIP] Make fileuploader handle creating embeddable html iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Nov 27, 2020
1 parent 86e5dc5 commit 72b8a07
Show file tree
Hide file tree
Showing 7 changed files with 663 additions and 1 deletion.
8 changes: 8 additions & 0 deletions fileuploader.config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ MaxAge = "24h" # 1 day
IdentifiedMaxAge = "168h" # 1 week
CheckInterval = "5m"

[Embed]
TemplatePath = "templates/embed.html"
CacheMaxAge = "1h"
CacheCleanInterval = "15m"
ImageCachePath = "image-cache"
ImageCacheMaxSize = 1073741824


# If EXTJWT is supported by the gateway or network, a validated token with an account present (when
# the user is authenticated to an irc services account) will use the IdentifiedMaxAge setting above
# instead of the base MaxAge.
Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ require (
github.com/OneOfOne/xxhash v1.2.7 // indirect
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 // indirect
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae
github.com/davecgh/go-spew v1.1.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dyatlov/go-oembed v0.0.0-20191103150536-a57c85b3b37c
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.4.0
github.com/go-sql-driver/mysql v1.4.1
Expand All @@ -16,12 +18,15 @@ require (
github.com/golang/protobuf v1.3.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/gorilla/websocket v1.4.1 // indirect
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc
github.com/jmoiron/sqlx v1.2.0
github.com/kiwiirc/webircgateway v0.0.0-20200226172020-f8a71090407a
github.com/lib/pq v1.1.1 // indirect
github.com/mattn/go-isatty v0.0.8 // indirect
github.com/mattn/go-sqlite3 v1.10.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 // indirect
github.com/peterbourgon/diskv v0.0.0-20171120014656-2973218375c3
github.com/rs/zerolog v1.14.3
github.com/rubenv/sql-migrate v0.0.0-20190618074426-f4d34eae5a5c
github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 // indirect
Expand All @@ -32,10 +37,10 @@ require (
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.1 // indirect
gopkg.in/Acconut/lockfile.v1 v1.1.0
gopkg.in/gorp.v1 v1.7.2 // indirect
gopkg.in/ini.v1 v1.52.0 // indirect
willnorris.com/go/imageproxy v0.10.0
)
236 changes: 236 additions & 0 deletions go.sum

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ type Config struct {
}
JwtSecretsByIssuer map[string]string
Loggers []LoggerConfig

// Embed Provider
Embed struct {
TemplatePath string
CacheMaxAge duration
CacheCleanInterval duration
ImageCachePath string
ImageCacheMaxSize uint64
}
}

func NewConfig() *Config {
Expand Down
Loading

0 comments on commit 72b8a07

Please sign in to comment.