-
Notifications
You must be signed in to change notification settings - Fork 10
/
fileuploader.config.example.toml
135 lines (121 loc) · 5.08 KB
/
fileuploader.config.example.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[Server]
# Note: ListenAddress is not used when running as a webircgateway plugin. In
# those situations, the listen addresses of the webircgateway will be used,
# including HTTPS if configured.
ListenAddress = "127.0.0.1:8088"
# When running as a webircgateway plugin, this path will be relative to the
# webircgateway domain, e.g. https://ws.irc.example.com/files
BasePath = "/files/"
# BasePath = "https://example.com/files" # external URL for use behind reverse proxy
# Cross-Origin Resource Sharing (CORS)
# If the server will be accessed from a different Origin than the KiwiIRC
# client, it is necessary to explicitly allow the KiwiIRC origin. See
# https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS for more detail
CorsOrigins = []
# CorsOrigins = [ "http://example.com" , "https://example.org" ]
# CorsOrigins = [ "*" ] # to allow all
# Requests from these networks will have their X-Forwarded-For headers trusted
TrustedReverseProxyRanges = [
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"fc00::/7",
"127.0.0.0/8",
"::1/128",
]
# Restrict server to users identified by valid JWT Account
RequireJwtAccount = false
[Storage]
Path = "./uploads"
ShardLayers = 6
MaximumUploadSize = "10 MB" # accepts units such as: MB, g, tB, peta, kilobytes, gigabyte
[Database]
Type = "sqlite3" # sqlite3 | mysql
# for sqlite3: a filesystem path
# for mysql: a DSN like "user:password@tcp(127.0.0.1:3306)/database". see https://github.com/go-sql-driver/mysql#dsn-data-source-name
Path = "./uploads.db"
[Expiration]
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
MaxAge = "24h" # 1 day
IdentifiedMaxAge = "168h" # 1 week
CheckInterval = "5m"
# 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.
#
# The HMAC secret used to sign the token is needed here to be able to validate the token.
#
# When using a webircgateway, the issuer will be the network_common_address of the upstream server
# if set. Otherwise it will be the hostname used to connect to the network.
#
# You can set a fallback issuer as "*" which will be attempted if no other matching hosts exist
# this can be handy if webircgateway is in gateway mode and providing EXTJWT for unknown networks
[JwtSecretsByIssuer]
# "example.com" = "examplesecret"
# "169.254.0.0" = "anothersecret"
# PreFinishCommands allows system commands to be run based on minetype once the file is fully uploaded
# but before it is hashed and moved from incomplete so the file can be rejected using RejectOnNoneZeroExit
# %FILE% will be replace with the full path to the file within [Storage.Path]/incomplete/
# There can be multiple definitions for [[PreFinishCommands]] and they will be evaluated in order
# To aid with debugging set RejectOnNoneZeroExit true and loglevel debug
# "Pattern" can include wildcards * and/or ?
#
# The below example uses exiv2 to strip GPSInfo from image files
# You would need exiv2 installed on the system for it to work
# [[PreFinishCommands]]
# Pattern = "image/*"
# Command = "/usr/bin/exiv2"
# Args = [
# "-M del Exif.GPSInfo.GPSVersionID",
# "-M del Exif.GPSInfo.GPSLatitudeRef",
# "-M del Exif.GPSInfo.GPSLatitude",
# "-M del Exif.GPSInfo.GPSLongitudeRef",
# "-M del Exif.GPSInfo.GPSLongitude",
# "-M del Exif.GPSInfo.GPSAltitudeRef",
# "-M del Exif.GPSInfo.GPSAltitude",
# "-M del Exif.GPSInfo.GPSTimeStamp",
# "-M del Exif.GPSInfo.GPSSatellites",
# "-M del Exif.GPSInfo.GPSStatus",
# "-M del Exif.GPSInfo.GPSMeasureMode",
# "-M del Exif.GPSInfo.GPSDOP",
# "-M del Exif.GPSInfo.GPSSpeedRef",
# "-M del Exif.GPSInfo.GPSSpeed",
# "-M del Exif.GPSInfo.GPSTrackRef",
# "-M del Exif.GPSInfo.GPSTrack",
# "-M del Exif.GPSInfo.GPSImgDirectionRef",
# "-M del Exif.GPSInfo.GPSImgDirection",
# "-M del Exif.GPSInfo.GPSMapDatum",
# "-M del Exif.GPSInfo.GPSDestLatitudeRef",
# "-M del Exif.GPSInfo.GPSDestLatitude",
# "-M del Exif.GPSInfo.GPSDestLongitudeRef",
# "-M del Exif.GPSInfo.GPSDestLongitude",
# "-M del Exif.GPSInfo.GPSDestBearingRef",
# "-M del Exif.GPSInfo.GPSDestBearing",
# "-M del Exif.GPSInfo.GPSDestDistanceRef",
# "-M del Exif.GPSInfo.GPSDestDistance",
# "-M del Exif.GPSInfo.GPSProcessingMethod",
# "-M del Exif.GPSInfo.GPSAreaInformation",
# "-M del Exif.GPSInfo.GPSDateStamp",
# "-M del Exif.GPSInfo.GPSDifferential",
# "-M del Exif.GPSInfo.GPSHPositioningError",
# "%FILE%"
# ]
# RejectOnNoneZeroExit = false
[[Loggers]]
Level = "info" # debug | info | warn | error | fatal | panic
Format = "pretty" # pretty | json
Output = "stderr:" # stderr: | stdout: | file:/path | udp:ip:port | unix:/path | locking-stderr: | locking-stdout:
# [[Loggers]]
# Level = "debug"
# Format = "json"
# Output = "file:./debug.log"
# [[Loggers]]
# # example receiver for testing: socat UDP-RECV:10101,bind=127.0.0.1 STDOUT
# Level = "info"
# Format = "json"
# Output = "udp:127.0.0.1:10101"
# [[Loggers]]
# # example receiver for testing: socat UNIX-LISTEN:./log.sock,fork STDOUT
# Level = "info"
# Format = "json"
# Output = "unix:./log.sock" # filesystem path to unix socket