Skip to content

Commit 72b8a07

Browse files
committed
[WIP] Make fileuploader handle creating embeddable html iframes
1 parent 86e5dc5 commit 72b8a07

File tree

7 files changed

+663
-1
lines changed

7 files changed

+663
-1
lines changed

fileuploader.config.example.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ MaxAge = "24h" # 1 day
4545
IdentifiedMaxAge = "168h" # 1 week
4646
CheckInterval = "5m"
4747

48+
[Embed]
49+
TemplatePath = "templates/embed.html"
50+
CacheMaxAge = "1h"
51+
CacheCleanInterval = "15m"
52+
ImageCachePath = "image-cache"
53+
ImageCacheMaxSize = 1073741824
54+
55+
4856
# If EXTJWT is supported by the gateway or network, a validated token with an account present (when
4957
# the user is authenticated to an irc services account) will use the IdentifiedMaxAge setting above
5058
# instead of the base MaxAge.

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ require (
77
github.com/OneOfOne/xxhash v1.2.7 // indirect
88
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 // indirect
99
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae
10+
github.com/davecgh/go-spew v1.1.1
1011
github.com/dgrijalva/jwt-go v3.2.0+incompatible
12+
github.com/dyatlov/go-oembed v0.0.0-20191103150536-a57c85b3b37c
1113
github.com/gin-contrib/sse v0.1.0 // indirect
1214
github.com/gin-gonic/gin v1.4.0
1315
github.com/go-sql-driver/mysql v1.4.1
@@ -16,12 +18,15 @@ require (
1618
github.com/golang/protobuf v1.3.2 // indirect
1719
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
1820
github.com/gorilla/websocket v1.4.1 // indirect
21+
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc
1922
github.com/jmoiron/sqlx v1.2.0
2023
github.com/kiwiirc/webircgateway v0.0.0-20200226172020-f8a71090407a
2124
github.com/lib/pq v1.1.1 // indirect
2225
github.com/mattn/go-isatty v0.0.8 // indirect
2326
github.com/mattn/go-sqlite3 v1.10.0
27+
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
2428
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 // indirect
29+
github.com/peterbourgon/diskv v0.0.0-20171120014656-2973218375c3
2530
github.com/rs/zerolog v1.14.3
2631
github.com/rubenv/sql-migrate v0.0.0-20190618074426-f4d34eae5a5c
2732
github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 // indirect
@@ -32,10 +37,10 @@ require (
3237
github.com/ziutek/mymysql v1.5.4 // indirect
3338
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d // indirect
3439
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
35-
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
3640
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
3741
google.golang.org/appengine v1.6.1 // indirect
3842
gopkg.in/Acconut/lockfile.v1 v1.1.0
3943
gopkg.in/gorp.v1 v1.7.2 // indirect
4044
gopkg.in/ini.v1 v1.52.0 // indirect
45+
willnorris.com/go/imageproxy v0.10.0
4146
)

go.sum

Lines changed: 236 additions & 0 deletions
Large diffs are not rendered by default.

server/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ type Config struct {
4545
}
4646
JwtSecretsByIssuer map[string]string
4747
Loggers []LoggerConfig
48+
49+
// Embed Provider
50+
Embed struct {
51+
TemplatePath string
52+
CacheMaxAge duration
53+
CacheCleanInterval duration
54+
ImageCachePath string
55+
ImageCacheMaxSize uint64
56+
}
4857
}
4958

5059
func NewConfig() *Config {

0 commit comments

Comments
 (0)