Browse Source

Merge pull request #2137 from nanoant/patch/ssh-trigger-via-local-url

LOCAL_ROOT_URL for workers accessing web service
Unknwon 8 years ago
parent
commit
1b0ef0ec0b
3 changed files with 7 additions and 1 deletions
  1. 1 1
      cmd/serve.go
  2. 4 0
      conf/app.ini
  3. 2 0
      modules/setting/setting.go

+ 1 - 1
cmd/serve.go

@@ -109,7 +109,7 @@ func handleUpdateTask(uuid string, user *models.User, username, reponame string,
 	}
 
 	// Ask for running deliver hook and test pull request tasks.
-	reqURL := setting.AppUrl + username + "/" + reponame + "/tasks/trigger?branch=" +
+	reqURL := setting.LocalUrl + username + "/" + reponame + "/tasks/trigger?branch=" +
 		strings.TrimPrefix(task.RefName, "refs/heads/")
 	log.GitLogger.Trace("Trigger task: %s", reqURL)
 

+ 4 - 0
conf/app.ini

@@ -46,6 +46,10 @@ DOMAIN = localhost
 ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
 HTTP_ADDR =
 HTTP_PORT = 3000
+; Local (DMZ) URL for Gogs workers (such as SSH update) accessing web service.
+; In most cases you do not need to change the default value.
+; Alter it only if your SSH server node is not the same as HTTP node.
+LOCAL_ROOT_URL = http://localhost:%(HTTP_PORT)s/
 ; Disable SSH feature when not available
 DISABLE_SSH = false
 ; Whether use builtin SSH server or not.

+ 2 - 0
modules/setting/setting.go

@@ -59,6 +59,7 @@ var (
 	Protocol           Scheme
 	Domain             string
 	HttpAddr, HttpPort string
+	LocalUrl           string
 	DisableSSH         bool
 	StartSSHServer     bool
 	SSHDomain          string
@@ -300,6 +301,7 @@ func NewContext() {
 	Domain = sec.Key("DOMAIN").MustString("localhost")
 	HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
 	HttpPort = sec.Key("HTTP_PORT").MustString("3000")
+	LocalUrl = sec.Key("LOCAL_ROOT_URL").MustString("http://localhost:" + HttpPort + "/")
 	DisableSSH = sec.Key("DISABLE_SSH").MustBool()
 	if !DisableSSH {
 		StartSSHServer = sec.Key("START_SSH_SERVER").MustBool()

PANIC: session(release): write data/sessions/d/d/dd4c6a318210369d: no space left on device

PANIC

session(release): write data/sessions/d/d/dd4c6a318210369d: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)