Worked a little on anonymous access, needs more work

This commit is contained in:
Torkel Ödegaard
2015-01-07 16:37:24 +01:00
parent 9d629f2780
commit 35326e1d92
6 changed files with 52 additions and 40 deletions
+12
View File
@@ -57,6 +57,10 @@ var (
RouterLogging bool
StaticRootPath string
// Http auth
Anonymous bool
AnonymousAccountId int64
// Session settings.
SessionOptions session.Options
@@ -161,6 +165,14 @@ func NewConfigContext() {
StaticRootPath = Cfg.MustValue("server", "static_root_path", path.Join(WorkDir, "webapp"))
RouterLogging = Cfg.MustBool("server", "router_logging", false)
// Http auth
Anonymous = Cfg.MustBool("auth", "anonymous", false)
AnonymousAccountId = Cfg.MustInt64("auth", "anonymous_account_id", 0)
if Anonymous && AnonymousAccountId == 0 {
log.Fatal(3, "Must specify account id for anonymous access")
}
// PhantomJS rendering
ImagesDir = "data/png"
PhantomDir = "_vendor/phantomjs"