From 6f2c40f22adbed785d114a780ec0b0b9b9cdcca9 Mon Sep 17 00:00:00 2001 From: gmemstr Date: Thu, 5 Oct 2017 21:16:03 -0700 Subject: [PATCH] Update godeps & add env variable for cookie secret --- Godeps/Godeps.json | 2 +- README.md | 4 ++++ auth/auth.go | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index ca2a65e..8630a87 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,5 +1,5 @@ { - "ImportPath": "podcast", + "ImportPath": "github.com/gmemstr/pogo", "GoVersion": "go1.8", "GodepVersion": "v79", "Deps": [ diff --git a/README.md b/README.md index 9c7bbd7..2a0b851 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ To produce a product that is easy to deploy and easier to use when hosting a pod ``` godep restore go build +# Set enviornment variable +export POGO_SECRET=secret +# Windows +# set POGO_SECRET=secret ./podcast ``` diff --git a/auth/auth.go b/auth/auth.go index 30fe5d4..57dd304 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -14,6 +14,7 @@ import ( "log" "net/http" "strings" + "os" "github.com/gmemstr/pogo/common" ) @@ -22,7 +23,7 @@ const ( enc = "cookie_session_encryption" // This is the key with which each cookie is encrypted, I'll recommend moving it to a env file. - secret = "super_long_string_difficult_to" + secret = os.Getenv("POGO_SECRET") cookieName = "POGO_SESSION" cookieExpiry = 60 * 60 * 24 * 30 // 30 days in seconds )