-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.go
65 lines (54 loc) · 1.31 KB
/
settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
Settings and configuration for GoPics.
Copyright (c) 2015, Luca Chiricozzi. All rights reserved.
Released under the MIT License.
http://opensource.org/licenses/MIT
*/
package main
import (
"flag"
"os"
"github.com/garyburd/redigo/redis"
"github.com/lucachr/gopics/auth"
)
const (
pageTitle = "GoPics | "
timeLayout = "Mon 2 Jan 2006 15:04"
// Redis "tags" for users and posts data.
userTag = "user:"
userTimeline = "timeline:"
postTag = "post:"
)
var (
// Keyring with hash key and block key for authentication cookies.
keyring = auth.NewKeyring(
[]byte("afeee502-a34f-11e4-a451-902b34a8c90ffd8c-a34f-11e4-a1d3-902b34a8"),
[]byte("e12b872e-a34f-11e4-9c70-902b34a8"),
)
// Invalid usernames.
invalidUser = []string{
"index",
"register",
"login",
"logout",
"registration",
"post",
"media",
"static",
}
pool *redis.Pool
redisServer = flag.String("redisServer", redisDefaultAddr, "")
// A slice with the path of your media directory
basePath = []string{os.Getenv("GOPATH"), "src", "github.com",
"lucachr", "gopics"}
mediaPath = append(basePath, "media")
staticPath = append(basePath, "static")
templatesPath = append(basePath, "templates")
templates = buildTemplates(
"header.html",
"index.html",
"register.html",
"timeline.html",
"footer.html",
)
)