Allow to choose enabled languages

Fixes #1835

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-12-19 19:50:19 +01:00
parent 9f873d1059
commit 70fc00d7eb
9 changed files with 82 additions and 22 deletions

View File

@@ -118,6 +118,7 @@ var (
ClientIPHeaderDepth: 0,
HideLoginURL: 0,
RenderOpenAPI: true,
Languages: []string{"en"},
OIDC: httpd.OIDC{
ClientID: "",
ClientSecret: "",
@@ -1853,6 +1854,12 @@ func getHTTPDBindingFromEnv(idx int) { //nolint:gocyclo
isSet = true
}
languages, ok := lookupStringListFromEnv(fmt.Sprintf("SFTPGO_HTTPD__BINDINGS__%d__LANGUAGES", idx))
if ok {
binding.Languages = languages
isSet = true
}
enableHTTPS, ok := lookupBoolFromEnv(fmt.Sprintf("SFTPGO_HTTPD__BINDINGS__%v__ENABLE_HTTPS", idx))
if ok {
binding.EnableHTTPS = enableHTTPS