Update godeps & add env variable for cookie secret

This commit is contained in:
gmemstr 2017-10-05 21:16:03 -07:00
parent 6b2774d9c2
commit 6f2c40f22a
3 changed files with 7 additions and 2 deletions

2
Godeps/Godeps.json generated
View file

@ -1,5 +1,5 @@
{
"ImportPath": "podcast",
"ImportPath": "github.com/gmemstr/pogo",
"GoVersion": "go1.8",
"GodepVersion": "v79",
"Deps": [

View file

@ -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
```

View file

@ -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
)