summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/minwinsvc/LICENSE (renamed from vendor/github.com/kardianos/minwinsvc/LICENSE)0
-rw-r--r--modules/minwinsvc/README.md (renamed from vendor/github.com/kardianos/minwinsvc/README.md)0
-rw-r--r--modules/minwinsvc/minwinsvc.go (renamed from vendor/github.com/kardianos/minwinsvc/minwinsvc.go)2
-rw-r--r--modules/minwinsvc/svc_other.go (renamed from vendor/github.com/kardianos/minwinsvc/svc_other.go)0
-rw-r--r--modules/minwinsvc/svc_windows.go (renamed from vendor/github.com/kardianos/minwinsvc/svc_windows.go)9
-rw-r--r--modules/setting/setting.go3
-rw-r--r--modules/ssh/ssh.go6
-rw-r--r--vendor/vendor.json6
8 files changed, 15 insertions, 11 deletions
diff --git a/vendor/github.com/kardianos/minwinsvc/LICENSE b/modules/minwinsvc/LICENSE
index fce91b4e1a..fce91b4e1a 100644
--- a/vendor/github.com/kardianos/minwinsvc/LICENSE
+++ b/modules/minwinsvc/LICENSE
diff --git a/vendor/github.com/kardianos/minwinsvc/README.md b/modules/minwinsvc/README.md
index 260dceeac3..260dceeac3 100644
--- a/vendor/github.com/kardianos/minwinsvc/README.md
+++ b/modules/minwinsvc/README.md
diff --git a/vendor/github.com/kardianos/minwinsvc/minwinsvc.go b/modules/minwinsvc/minwinsvc.go
index 057ba7f954..4cd89ffdb4 100644
--- a/vendor/github.com/kardianos/minwinsvc/minwinsvc.go
+++ b/modules/minwinsvc/minwinsvc.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a zlib-style
// license that can be found in the LICENSE file.package service
-// Minimal non-invasive windows only service stub.
+// Package minwinsvc is a minimal non-invasive windows only service stub.
//
// Import to allow running as a windows service.
// import _ "github.com/kardianos/minwinsvc"
diff --git a/vendor/github.com/kardianos/minwinsvc/svc_other.go b/modules/minwinsvc/svc_other.go
index 197d30021f..197d30021f 100644
--- a/vendor/github.com/kardianos/minwinsvc/svc_other.go
+++ b/modules/minwinsvc/svc_other.go
diff --git a/vendor/github.com/kardianos/minwinsvc/svc_windows.go b/modules/minwinsvc/svc_windows.go
index 91e2b6a4dd..c6e87e29df 100644
--- a/vendor/github.com/kardianos/minwinsvc/svc_windows.go
+++ b/modules/minwinsvc/svc_windows.go
@@ -8,17 +8,22 @@ package minwinsvc
import (
"os"
+ "strconv"
"sync"
"golang.org/x/sys/windows/svc"
)
var (
- onExit func()
- guard sync.Mutex
+ onExit func()
+ guard sync.Mutex
+ skip, _ = strconv.ParseBool(os.Getenv("SKIP_MINWINSVC"))
)
func init() {
+ if skip {
+ return
+ }
interactive, err := svc.IsAnInteractiveSession()
if err != nil {
panic(err)
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index fd0f5085c9..0586bce94b 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -22,13 +22,14 @@ import (
"code.gitea.io/git"
"code.gitea.io/gitea/modules/log"
+ _ "code.gitea.io/gitea/modules/minwinsvc" // import minwinsvc for windows services
"code.gitea.io/gitea/modules/user"
+
"github.com/Unknwon/com"
_ "github.com/go-macaron/cache/memcache" // memcache plugin for cache
_ "github.com/go-macaron/cache/redis"
"github.com/go-macaron/session"
_ "github.com/go-macaron/session/redis" // redis plugin for store session
- _ "github.com/kardianos/minwinsvc" // import minwinsvc for windows services
"gopkg.in/ini.v1"
"strk.kbt.io/projects/go/libravatar"
)
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go
index 056ef084ef..18bac8dbf2 100644
--- a/modules/ssh/ssh.go
+++ b/modules/ssh/ssh.go
@@ -67,7 +67,11 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf}
log.Trace("SSH: Arguments: %v", args)
cmd := exec.Command(setting.AppPath, args...)
- cmd.Env = append(os.Environ(), "SSH_ORIGINAL_COMMAND="+cmdName)
+ cmd.Env = append(
+ os.Environ(),
+ "SSH_ORIGINAL_COMMAND="+cmdName,
+ "SKIP_MINWINSVC=1",
+ )
stdout, err := cmd.StdoutPipe()
if err != nil {
diff --git a/vendor/vendor.json b/vendor/vendor.json
index 05e01d6e0e..a80b8e7132 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -515,12 +515,6 @@
"revisionTime": "2016-02-12T04:00:40Z"
},
{
- "checksumSHA1": "/dBJ2h8Jo359deiC5GQ8ZYzX8M8=",
- "path": "github.com/kardianos/minwinsvc",
- "revision": "cad6b2b879b0970e4245a20ebf1a81a756e2bb70",
- "revisionTime": "2015-11-22T16:33:09Z"
- },
- {
"checksumSHA1": "fh+CcgeUUsnuwSORHYWg0ycbp+4=",
"path": "github.com/klauspost/compress/flate",
"revision": "8df558b6cb6f9b445f9586446cfe7223e7d8bd6b",