diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ffccad1d50..331b94db3c 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1629,6 +1629,7 @@ config.app_name = Site Title config.app_ver = Gitea Version config.app_url = Gitea Base URL config.custom_conf = Configuration File Path +config.custom_file_root_path = "Custom File Root Path" config.domain = SSH Server Domain config.offline_mode = Local Mode config.disable_router_log = Disable Router Log diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 7d98e1af36..4a46c1f432 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -6,6 +6,7 @@ package admin import ( "fmt" + "os" "runtime" "strings" "time" @@ -211,6 +212,7 @@ func Config(ctx *context.Context) { ctx.Data["RunMode"] = strings.Title(macaron.Env) ctx.Data["GitVersion"] = setting.Git.Version ctx.Data["RepoRootPath"] = setting.RepoRootPath + ctx.Data["CustomRootPath"] = setting.CustomPath ctx.Data["StaticRootPath"] = setting.StaticRootPath ctx.Data["LogRootPath"] = setting.LogRootPath ctx.Data["ScriptType"] = setting.ScriptType @@ -240,6 +242,20 @@ func Config(ctx *context.Context) { ctx.Data["Git"] = setting.Git + type envVar struct { + Name, Value string + } + + envVars := map[string]*envVar{} + if len(os.Getenv("GITEA_WORK_DIR")) > 0 { + envVars["GITEA_WORK_DIR"] = &envVar{"GITEA_WORK_DIR", os.Getenv("GITEA_WORK_DIR")} + } + if len(os.Getenv("GITEA_CUSTOM")) > 0 { + envVars["GITEA_CUSTOM"] = &envVar{"GITEA_CUSTOM", os.Getenv("GITEA_CUSTOM")} + } + + ctx.Data["EnvVars"] = envVars + type logger struct { Mode, Config string } diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index becaca61e5..82db75ffb4 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -41,12 +41,23 @@