Skip to content

Commit

Permalink
adding service and sysconfig files
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Apr 5, 2018
1 parent 9ca416c commit 531b459
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bbgoget.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {

fs.StringVar(&listenAddr, "listen-address", ":8800", "specify listen address")
fs.IntVar(&sshPort, "ssh-port", 7999, "specify bitbucket ssh port")
fs.StringVar(&serverNameOverride, "servername-override", "", "override the server name. if not specified, uses the host value from the request url")
fs.StringVar(&serverNameOverride, "servername-override", "", "override the server name. if not specified, uses the host value from the X-Forwarded-Host header")

_ = fs.Parse(os.Args[1:])

Expand Down Expand Up @@ -72,7 +72,7 @@ func (bbh *BBHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
return
}

prefix := strings.Join(pathParts[0:3], "/")
prefix := strings.Join(pathParts[:3], "/")
host := bbh.serverNameOverride
if len(host) == 0 {
if len(host) == 0 {
Expand Down
16 changes: 16 additions & 0 deletions bbgoget.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=bbgoget server
Requires=network-online.target
After=network-online.target

[Service]
User=bbgoget
Group=bbgoget
LimitNOFILE=65536
EnvironmentFile=-/etc/sysconfig/bbgoget
Restart=on-failure
ExecStart=/usr/bin/bbgoget $OPTIONS
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions bbgoget.sysconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# OPTIONS="-listen-address :8080 -servername-override bitbucket.myorg.net -ssh-port 7999"

0 comments on commit 531b459

Please sign in to comment.