mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-20 01:31:09 +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",
|
"GoVersion": "go1.8",
|
||||||
"GodepVersion": "v79",
|
"GodepVersion": "v79",
|
||||||
"Deps": [
|
"Deps": [
|
||||||
|
|
|
@ -31,6 +31,10 @@ To produce a product that is easy to deploy and easier to use when hosting a pod
|
||||||
```
|
```
|
||||||
godep restore
|
godep restore
|
||||||
go build
|
go build
|
||||||
|
# Set enviornment variable
|
||||||
|
export POGO_SECRET=secret
|
||||||
|
# Windows
|
||||||
|
# set POGO_SECRET=secret
|
||||||
./podcast
|
./podcast
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/gmemstr/pogo/common"
|
"github.com/gmemstr/pogo/common"
|
||||||
)
|
)
|
||||||
|
@ -22,7 +23,7 @@ const (
|
||||||
enc = "cookie_session_encryption"
|
enc = "cookie_session_encryption"
|
||||||
|
|
||||||
// This is the key with which each cookie is encrypted, I'll recommend moving it to a env file.
|
// 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"
|
cookieName = "POGO_SESSION"
|
||||||
cookieExpiry = 60 * 60 * 24 * 30 // 30 days in seconds
|
cookieExpiry = 60 * 60 * 24 * 30 // 30 days in seconds
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue