mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01: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:
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
"github.com/gogs/git-module"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/context"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
"gogs.io/gogs/internal/tool"
|
||||
)
|
||||
|
||||
@@ -135,8 +135,8 @@ func Diff(c *context.Context) {
|
||||
}
|
||||
|
||||
diff, err := db.GetDiffCommit(db.RepoPath(userName, repoName),
|
||||
commitID, setting.Git.MaxGitDiffLines,
|
||||
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles)
|
||||
commitID, conf.Git.MaxGitDiffLines,
|
||||
conf.Git.MaxGitDiffLineCharacters, conf.Git.MaxGitDiffFiles)
|
||||
if err != nil {
|
||||
c.NotFoundOrServerError("get diff commit", git.IsErrNotExist, err)
|
||||
return
|
||||
@@ -168,11 +168,11 @@ func Diff(c *context.Context) {
|
||||
c.Data["Diff"] = diff
|
||||
c.Data["Parents"] = parents
|
||||
c.Data["DiffNotAvailable"] = diff.NumFiles() == 0
|
||||
c.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", commitID)
|
||||
c.Data["SourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", commitID)
|
||||
if commit.ParentCount() > 0 {
|
||||
c.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", parents[0])
|
||||
c.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", parents[0])
|
||||
}
|
||||
c.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", commitID)
|
||||
c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", commitID)
|
||||
c.Success(DIFF)
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ func CompareDiff(c *context.Context) {
|
||||
}
|
||||
|
||||
diff, err := db.GetDiffRange(db.RepoPath(userName, repoName), beforeCommitID,
|
||||
afterCommitID, setting.Git.MaxGitDiffLines,
|
||||
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles)
|
||||
afterCommitID, conf.Git.MaxGitDiffLines,
|
||||
conf.Git.MaxGitDiffLineCharacters, conf.Git.MaxGitDiffFiles)
|
||||
if err != nil {
|
||||
c.Handle(404, "GetDiffRange", err)
|
||||
return
|
||||
@@ -229,8 +229,8 @@ func CompareDiff(c *context.Context) {
|
||||
c.Data["Commit"] = commit
|
||||
c.Data["Diff"] = diff
|
||||
c.Data["DiffNotAvailable"] = diff.NumFiles() == 0
|
||||
c.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", afterCommitID)
|
||||
c.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", beforeCommitID)
|
||||
c.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", afterCommitID)
|
||||
c.Data["SourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", afterCommitID)
|
||||
c.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", beforeCommitID)
|
||||
c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", afterCommitID)
|
||||
c.HTML(200, DIFF)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user