mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 01:07:15 +02:00
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
"github.com/unknwon/com"
|
||||
log "unknwon.dev/clog/v2"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/context"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/db/errors"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -87,7 +87,7 @@ func MembersAction(c *context.Context) {
|
||||
if c.Params(":action") != "leave" {
|
||||
c.Redirect(c.Org.OrgLink + "/members")
|
||||
} else {
|
||||
c.Redirect(setting.AppSubURL + "/")
|
||||
c.Redirect(conf.Server.Subpath + "/")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ package org
|
||||
import (
|
||||
log "unknwon.dev/clog/v2"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/context"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/form"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -52,5 +52,5 @@ func CreatePost(c *context.Context, f form.CreateOrg) {
|
||||
}
|
||||
log.Trace("Organization created: %s", org.Name)
|
||||
|
||||
c.Redirect(setting.AppSubURL + "/org/" + f.OrgName + "/dashboard")
|
||||
c.Redirect(conf.Server.Subpath + "/org/" + f.OrgName + "/dashboard")
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
|
||||
log "unknwon.dev/clog/v2"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/context"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/db/errors"
|
||||
"gogs.io/gogs/internal/form"
|
||||
"gogs.io/gogs/internal/route/user"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -63,7 +63,7 @@ func SettingsPost(c *context.Context, f form.UpdateOrgSetting) {
|
||||
return
|
||||
}
|
||||
// reset c.org.OrgLink with new name
|
||||
c.Org.OrgLink = setting.AppSubURL + "/org/" + f.Name
|
||||
c.Org.OrgLink = conf.Server.Subpath + "/org/" + f.Name
|
||||
log.Trace("Organization name changed: %s -> %s", org.Name, f.Name)
|
||||
}
|
||||
// In case it's just a case change.
|
||||
@@ -130,7 +130,7 @@ func SettingsDelete(c *context.Context) {
|
||||
}
|
||||
} else {
|
||||
log.Trace("Organization deleted: %s", org.Name)
|
||||
c.Redirect(setting.AppSubURL + "/")
|
||||
c.Redirect(conf.Server.Subpath + "/")
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -143,7 +143,7 @@ func Webhooks(c *context.Context) {
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["BaseLink"] = c.Org.OrgLink
|
||||
c.Data["Description"] = c.Tr("org.settings.hooks_desc")
|
||||
c.Data["Types"] = setting.Webhook.Types
|
||||
c.Data["Types"] = conf.Webhook.Types
|
||||
|
||||
ws, err := db.GetWebhooksByOrgID(c.Org.Organization.ID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user