Let users specify the port
This commit is contained in:
parent
efccdd9dbb
commit
d847029f56
3
main.go
3
main.go
@ -23,6 +23,7 @@ func main() {
|
|||||||
repos := envOr("GITLE_REPOS", "/var/gitle/repos")
|
repos := envOr("GITLE_REPOS", "/var/gitle/repos")
|
||||||
akSrc := envOr("GITLE_AUTH_KEYS", "var/gitle/authorized_keys")
|
akSrc := envOr("GITLE_AUTH_KEYS", "var/gitle/authorized_keys")
|
||||||
hostKey := envOr("GITLE_HOST_KEY", "/var/gitle/host_key")
|
hostKey := envOr("GITLE_HOST_KEY", "/var/gitle/host_key")
|
||||||
|
port := envOr("GITLE_PORT", ":2222")
|
||||||
|
|
||||||
protect.Unveil(repos, "rwc")
|
protect.Unveil(repos, "rwc")
|
||||||
protect.Unveil(akSrc, "r")
|
protect.Unveil(akSrc, "r")
|
||||||
@ -78,7 +79,7 @@ func main() {
|
|||||||
server.SSHConfig.AddHostKey(pk)
|
server.SSHConfig.AddHostKey(pk)
|
||||||
server.SetupDone = true
|
server.SetupDone = true
|
||||||
|
|
||||||
err = server.ListenAndServe(":2222")
|
err = server.ListenAndServe(port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to listen: %v\n", err)
|
log.Fatalf("failed to listen: %v\n", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user