Browse Source

Fix wrong place to check disable SSH

tags/v1.21.12.1
Unknwon 9 years ago
parent
commit
c9516c4c60
5 changed files with 10 additions and 8 deletions
  1. +1
    -0
      .bra.toml
  2. +6
    -5
      cmd/serve.go
  3. +1
    -1
      cmd/update.go
  4. +1
    -1
      gogs.go
  5. +1
    -1
      templates/.VERSION

+ 1
- 0
.bra.toml View File

@@ -1,6 +1,7 @@
[run] [run]
init_cmds = [ init_cmds = [
#["grep", "-rn", "FIXME", "."], #["grep", "-rn", "FIXME", "."],
["make", "build-dev"],
["./gogs", "web"] ["./gogs", "web"]
] ]
watch_all = true watch_all = true


+ 6
- 5
cmd/serve.go View File

@@ -42,11 +42,6 @@ func setup(logPath string) {
setting.NewContext() setting.NewContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath)) log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))


if setting.DisableSSH {
println("Gogs: SSH has been disabled")
os.Exit(1)
}

models.LoadConfigs() models.LoadConfigs()


if setting.UseSQLite3 || setting.UseTiDB { if setting.UseSQLite3 || setting.UseTiDB {
@@ -138,8 +133,14 @@ func runServ(c *cli.Context) {
if c.IsSet("config") { if c.IsSet("config") {
setting.CustomConf = c.String("config") setting.CustomConf = c.String("config")
} }

setup("serv.log") setup("serv.log")


if setting.DisableSSH {
println("Gogs: SSH has been disabled")
return
}

if len(c.Args()) < 1 { if len(c.Args()) < 1 {
fail("Not enough arguments", "Not enough arguments") fail("Not enough arguments", "Not enough arguments")
} }


+ 1
- 1
cmd/update.go View File

@@ -16,7 +16,7 @@ import (


var CmdUpdate = cli.Command{ var CmdUpdate = cli.Command{
Name: "update", Name: "update",
Usage: "This command should only be called by SSH shell",
Usage: "This command should only be called by Git hook",
Description: `Update get pushed info and insert into database`, Description: `Update get pushed info and insert into database`,
Action: runUpdate, Action: runUpdate,
Flags: []cli.Flag{ Flags: []cli.Flag{


+ 1
- 1
gogs.go View File

@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )


const APP_VER = "0.8.41.0220"
const APP_VER = "0.8.41.0221"


func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())


+ 1
- 1
templates/.VERSION View File

@@ -1 +1 @@
0.8.41.0220
0.8.41.0221

Loading…
Cancel
Save