Provide configuration to allow camo-media proxying (#12802)

* Provide configuration to allow camo-media proxying

Fix #916

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
此提交包含在:
zeripath
2022-03-29 10:27:37 +02:00
提交者 GitHub
co-authored by 6543 wxiaoguang
父節點 76aa33d884
當前提交 97625b44e7
共有 6 個檔案被更改,包括 133 行新增1 行删除
+15
查看文件
@@ -197,6 +197,13 @@ var (
PasswordCheckPwn bool
SuccessfulTokensCacheSize int
Camo = struct {
Enabled bool
ServerURL string `ini:"SERVER_URL"`
HMACKey string `ini:"HMAC_KEY"`
Allways bool
}{}
// UI settings
UI = struct {
ExplorePagingNum int
@@ -1019,6 +1026,14 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
log.Fatal("Failed to map API settings: %v", err)
} else if err = Cfg.Section("metrics").MapTo(&Metrics); err != nil {
log.Fatal("Failed to map Metrics settings: %v", err)
} else if err = Cfg.Section("camo").MapTo(&Camo); err != nil {
log.Fatal("Failed to map Camo settings: %v", err)
}
if Camo.Enabled {
if Camo.ServerURL == "" || Camo.HMACKey == "" {
log.Fatal(`Camo settings require "SERVER_URL" and HMAC_KEY`)
}
}
u := *appURL