From 648d9e253c1924b832248f26fee42b2fb64dc3bc Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 22 Feb 2020 09:05:26 +0800 Subject: 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 --- internal/markup/markup.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/markup/markup.go') diff --git a/internal/markup/markup.go b/internal/markup/markup.go index 2bb56603..65b14865 100644 --- a/internal/markup/markup.go +++ b/internal/markup/markup.go @@ -13,8 +13,8 @@ import ( "github.com/unknwon/com" "golang.org/x/net/html" + "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/lazyregexp" - "gogs.io/gogs/internal/setting" "gogs.io/gogs/internal/tool" ) @@ -78,7 +78,7 @@ func cutoutVerbosePrefix(prefix string) string { if prefix[i] == '/' { count++ } - if count >= 3+setting.AppSubURLDepth { + if count >= 3+conf.Server.SubpathDepth { return prefix[:i] } } @@ -133,7 +133,7 @@ func RenderCrossReferenceIssueIndexPattern(rawBytes []byte, urlPrefix string, me repo := string(m[:delimIdx]) index := string(m[delimIdx+1:]) - link := fmt.Sprintf(`%s`, setting.AppURL, repo, index, m) + link := fmt.Sprintf(`%s`, conf.Server.ExternalURL, repo, index, m) rawBytes = bytes.Replace(rawBytes, m, []byte(link), 1) } return rawBytes @@ -155,7 +155,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string, metas map[string]strin for _, m := range ms { m = m[bytes.Index(m, []byte("@")):] rawBytes = bytes.Replace(rawBytes, m, - []byte(fmt.Sprintf(`%s`, setting.AppSubURL, m[1:], m)), -1) + []byte(fmt.Sprintf(`%s`, conf.Server.Subpath, m[1:], m)), -1) } rawBytes = RenderIssueIndexPattern(rawBytes, urlPrefix, metas) -- cgit v1.2.3