diff options
author | zeripath <art27@cantab.net> | 2020-09-07 04:53:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 23:53:42 -0400 |
commit | a722dd72db7fb6efd9ec0bf730d6b2364ef6337c (patch) | |
tree | e562376fd01798e4bf9c6c0748ab20989bda2ae5 /models | |
parent | d17efaa1146bf0ec9a52b004e6d79f971253b1a2 (diff) | |
download | gitea-a722dd72db7fb6efd9ec0bf730d6b2364ef6337c.tar.gz gitea-a722dd72db7fb6efd9ec0bf730d6b2364ef6337c.zip |
Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752)
* Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes
Fix #11738
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models')
-rw-r--r-- | models/helper_environment.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/helper_environment.go b/models/helper_environment.go index f1c758d65d..8924d0a283 100644 --- a/models/helper_environment.go +++ b/models/helper_environment.go @@ -8,6 +8,8 @@ import ( "fmt" "os" "strings" + + "code.gitea.io/gitea/modules/setting" ) // env keys for git hooks need @@ -23,6 +25,7 @@ const ( EnvIsDeployKey = "GITEA_IS_DEPLOY_KEY" EnvPRID = "GITEA_PR_ID" EnvIsInternal = "GITEA_INTERNAL_PUSH" + EnvAppURL = "GITEA_ROOT_URL" ) // InternalPushingEnvironment returns an os environment to switch off hooks on push @@ -62,6 +65,7 @@ func FullPushingEnvironment(author, committer *User, repo *Repository, repoName EnvPusherID+"="+fmt.Sprintf("%d", committer.ID), EnvRepoID+"="+fmt.Sprintf("%d", repo.ID), EnvPRID+"="+fmt.Sprintf("%d", prID), + EnvAppURL+"="+setting.AppURL, "SSH_ORIGINAL_COMMAND=gitea-internal", ) |