From 99723edd756a21755bf150b528539eef111cbf42 Mon Sep 17 00:00:00 2001 From: Jonas Pinson Date: Wed, 8 May 2024 20:01:31 +0200 Subject: [PATCH] update to use environment variables --- dockerfile | 1 - rogueserver.go | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dockerfile b/dockerfile index 9756898..1e97627 100644 --- a/dockerfile +++ b/dockerfile @@ -10,7 +10,6 @@ COPY . ./ RUN CGO_ENABLED=0 GOOS=linux go build -o /docker-gs-ping - EXPOSE 8001 CMD ["/docker-gs-ping"] \ No newline at end of file diff --git a/rogueserver.go b/rogueserver.go index 8686c94..4faa3fb 100644 --- a/rogueserver.go +++ b/rogueserver.go @@ -31,16 +31,17 @@ import ( func main() { // flag stuff - debug := flag.Bool("debug", false, "use debug mode") + debug := os.Getenv("debug") - proto := flag.String("proto", "tcp", "protocol for api to use (tcp, unix)") - addr := flag.String("addr", "0.0.0.0:8001", "network address for api to listen on") + proto := "tcp" + addr := "0.0.0.0:8001" - dbuser := flag.String("dbuser", "pokerogue", "database username") - dbpass := flag.String("dbpass", "pokerogue", "database password") - dbproto := flag.String("dbproto", "tcp", "protocol for database connection") - dbaddr := flag.String("dbaddr", "localhost", "database address") - dbname := flag.String("dbname", "pokeroguedb", "database name") + + dbuser := os.Getenv("dbuser") + dbpass := os.Getenv("dbpass") + dbproto := "tcp" + dbaddr := os.Getenv("dbaddr") + dbname := os.Getenv("dbname") flag.Parse()