From 14ba16ec7abd66b4367db1dd1373ae9010de7d17 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sun, 24 Dec 2023 14:14:40 +0530 Subject: server.go & README.md : use certpath and keypath in .env, Updating README with Installation and Usage steps --- server.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server.go') diff --git a/server.go b/server.go index 074abd9..d8b9c0d 100644 --- a/server.go +++ b/server.go @@ -34,9 +34,6 @@ func main() { api_endpoint_url = defaultAPIEndpointURL } - certPath := "/etc/letsencrypt/live/" + domain + "/fullchain.pem" - keyPath := "/etc/letsencrypt/live/" + domain + "/privkey.pem" - e := echo.New() e.POST("/upload", handlers.AddHash) e.POST("/verify", handlers.VerifyHash) @@ -46,6 +43,8 @@ func main() { case "development": e.Logger.Fatal(e.Start(":" + port)) case "production": + certPath := os.Getenv("CERTPATH") + keyPath := os.Getenv("KEYPATH") e.Logger.Fatal(e.StartTLS(":"+port, certPath, keyPath)) default: log.Printf("Unknown environment '%s', starting on default port %s\n", environment, port) -- cgit v1.2.3