mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 14:26:03 +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:
@@ -20,11 +20,11 @@ import (
|
||||
|
||||
"github.com/gogs/git-module"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/db/errors"
|
||||
"gogs.io/gogs/internal/httplib"
|
||||
"gogs.io/gogs/internal/mailer"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
"gogs.io/gogs/internal/template"
|
||||
)
|
||||
|
||||
@@ -141,7 +141,7 @@ func runHookPreReceive(c *cli.Context) error {
|
||||
}
|
||||
|
||||
var hookCmd *exec.Cmd
|
||||
if setting.IsWindows {
|
||||
if conf.IsWindowsRuntime() {
|
||||
hookCmd = exec.Command("bash.exe", "custom_hooks/pre-receive")
|
||||
} else {
|
||||
hookCmd = exec.Command(customHooksPath)
|
||||
@@ -175,7 +175,7 @@ func runHookUpdate(c *cli.Context) error {
|
||||
}
|
||||
|
||||
var hookCmd *exec.Cmd
|
||||
if setting.IsWindows {
|
||||
if conf.IsWindowsRuntime() {
|
||||
hookCmd = exec.Command("bash.exe", append([]string{"custom_hooks/update"}, args...)...)
|
||||
} else {
|
||||
hookCmd = exec.Command(customHooksPath, args...)
|
||||
@@ -198,7 +198,7 @@ func runHookPostReceive(c *cli.Context) error {
|
||||
|
||||
// Post-receive hook does more than just gather Git information,
|
||||
// so we need to setup additional services for email notifications.
|
||||
setting.NewPostReceiveHookServices()
|
||||
conf.NewPostReceiveHookServices()
|
||||
mailer.NewContext()
|
||||
|
||||
isWiki := strings.Contains(os.Getenv(db.ENV_REPO_CUSTOM_HOOKS_PATH), ".wiki.git/")
|
||||
@@ -233,7 +233,7 @@ func runHookPostReceive(c *cli.Context) error {
|
||||
}
|
||||
|
||||
// Ask for running deliver hook and test pull request tasks
|
||||
reqURL := setting.LocalURL + options.RepoUserName + "/" + options.RepoName + "/tasks/trigger?branch=" +
|
||||
reqURL := conf.Server.LocalRootURL + options.RepoUserName + "/" + options.RepoName + "/tasks/trigger?branch=" +
|
||||
template.EscapePound(strings.TrimPrefix(options.RefFullName, git.BRANCH_PREFIX)) +
|
||||
"&secret=" + os.Getenv(db.ENV_REPO_OWNER_SALT_MD5) +
|
||||
"&pusher=" + os.Getenv(db.ENV_AUTH_USER_ID)
|
||||
@@ -258,7 +258,7 @@ func runHookPostReceive(c *cli.Context) error {
|
||||
}
|
||||
|
||||
var hookCmd *exec.Cmd
|
||||
if setting.IsWindows {
|
||||
if conf.IsWindowsRuntime() {
|
||||
hookCmd = exec.Command("bash.exe", "custom_hooks/post-receive")
|
||||
} else {
|
||||
hookCmd = exec.Command(customHooksPath)
|
||||
|
||||
Reference in New Issue
Block a user