diff options
author | Martin van Beurden <chadoe@gmail.com> | 2014-09-14 19:35:22 +0200 |
---|---|---|
committer | Martin van Beurden <chadoe@gmail.com> | 2014-09-18 20:50:48 +0200 |
commit | 0055cbd3651ebde0f8b6cc70c9c44de56dc38830 (patch) | |
tree | 64a9ea617ba1f704139881c3960fa2425dad9018 /models | |
parent | 4f74b4e6578be4251af65cd08daa37c884e431a0 (diff) | |
download | gitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.tar.gz gitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.zip |
Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts:
modules/setting/setting.go
Conflicts:
templates/repo/release/list.tmpl
templates/user/dashboard/dashboard.tmpl
Conflicts:
routers/repo/setting.go
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 2 | ||||
-rw-r--r-- | models/user.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go index a6b22b161d..596f51aff2 100644 --- a/models/action.go +++ b/models/action.go @@ -137,7 +137,7 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com return err } - url := fmt.Sprintf("/%s/%s/commit/%s", repoUserName, repoName, c.Sha1) + url := fmt.Sprintf("%s/%s/%s/commit/%s", setting.AppRootSubUrl, repoUserName, repoName, c.Sha1) message := fmt.Sprintf(`<a href="%s">%s</a>`, url, c.Message) if _, err = CreateComment(userId, issue.RepoId, issue.Id, 0, 0, COMMIT, message, nil); err != nil { diff --git a/models/user.go b/models/user.go index b3ea816177..1bed8109a2 100644 --- a/models/user.go +++ b/models/user.go @@ -82,14 +82,14 @@ type User struct { // DashboardLink returns the user dashboard page link. func (u *User) DashboardLink() string { if u.IsOrganization() { - return "/org/" + u.Name + "/dashboard/" + return setting.AppRootSubUrl + "/org/" + u.Name + "/dashboard/" } - return "/" + return setting.AppRootSubUrl + "/" } // HomeLink returns the user home page link. func (u *User) HomeLink() string { - return "/user/" + u.Name + return setting.AppRootSubUrl + "/user/" + u.Name } // AvatarLink returns user gravatar link. |