mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-19 17:21:10 +01:00
Update godeps & add env variable for cookie secret
This commit is contained in:
parent
6b2774d9c2
commit
6f2c40f22a
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"ImportPath": "podcast",
|
||||
"ImportPath": "github.com/gmemstr/pogo",
|
||||
"GoVersion": "go1.8",
|
||||
"GodepVersion": "v79",
|
||||
"Deps": [
|
||||
|
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue