Let users specify the port

This commit is contained in:
Aaron Bieber 2022-06-22 07:04:36 -06:00
parent efccdd9dbb
commit d847029f56
No known key found for this signature in database

View File

@ -23,6 +23,7 @@ func main() {
repos := envOr("GITLE_REPOS", "/var/gitle/repos")
akSrc := envOr("GITLE_AUTH_KEYS", "var/gitle/authorized_keys")
hostKey := envOr("GITLE_HOST_KEY", "/var/gitle/host_key")
port := envOr("GITLE_PORT", ":2222")
protect.Unveil(repos, "rwc")
protect.Unveil(akSrc, "r")
@ -78,7 +79,7 @@ func main() {
server.SSHConfig.AddHostKey(pk)
server.SetupDone = true
err = server.ListenAndServe(":2222")
err = server.ListenAndServe(port)
if err != nil {
log.Fatalf("failed to listen: %v\n", err)
}