diff --git a/pkg/log/log.go b/pkg/log/log.go
index 0f6be5b..97b99eb 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -19,7 +19,7 @@ func NewLogger(file string) {
log = stdlog.New(os.Stdout, "", stdlog.LstdFlags)
return
}
- f, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
+ f, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0640)
if err != nil {
stdlog.Fatal(err)
}
diff --git a/pkg/server/server.go b/pkg/server/server.go
index c64d1c8..3b9f674 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -52,15 +52,15 @@ func NewHTTPServer(l net.Listener, conf core.Config) (srv *HTTPServer) {
}
func (s *HTTPServer) Start() (err error) {
- var buf *bytes.Buffer
- if s.Secret != "" {
- buf = bytes.NewBufferString(s.Secret)
- }
s.DB, err = db.New(s.DataDir)
if err != nil {
return
}
- s.JWT, err = jwt.New(jwt.DefaultExpiry, s.DB, buf)
+ if s.Secret != "" {
+ s.JWT, err = jwt.New(jwt.DefaultExpiry, s.DB, bytes.NewBufferString(s.Secret))
+ } else {
+ s.JWT, err = jwt.New(jwt.DefaultExpiry, s.DB, nil)
+ }
if err != nil {
return
}
diff --git a/pkg/server/templates.go b/pkg/server/templates.go
index c0a94f5..0df25c2 100644
--- a/pkg/server/templates.go
+++ b/pkg/server/templates.go
@@ -103,7 +103,7 @@ const (
-
+
@@ -242,9 +242,19 @@ const (
Created by: {{.Data.Created}}
{{if .Data.Updated}}
- Updated by: {{.Data.Updated}}
-
+ Updated by: {{.Data.Updated}}
{{end}}
+ Visibility:
+ {{if eq .Data.Perm 1}}
+ Public
+ {{end}}
+ {{if eq .Data.Perm 2}}
+ Internal
+ {{end}}
+ {{if eq .Data.Perm 3}}
+ Private
+ {{end}}
+
@@ -361,9 +371,19 @@ const (
Created by: {{.Data.Created}}
{{if .Data.Updated}}
- Updated by: {{.Data.Updated}}
-
+ Updated by: {{.Data.Updated}}
{{end}}
+ Visibility:
+ {{if eq .Data.Perm 1}}
+ Public
+ {{end}}
+ {{if eq .Data.Perm 2}}
+ Internal
+ {{end}}
+ {{if eq .Data.Perm 3}}
+ Private
+ {{end}}
+
diff --git a/templates/login.html b/templates/login.html
index e02271d..ca31e22 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -15,7 +15,7 @@
-
+
diff --git a/templates/page.html b/templates/page.html
index 49772f3..c28a6bd 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -8,9 +8,19 @@
Created by: {{.Data.Created}}
{{if .Data.Updated}}
- Updated by: {{.Data.Updated}}
-
+ Updated by: {{.Data.Updated}}
{{end}}
+ Visibility:
+ {{if eq .Data.Perm 1}}
+ Public
+ {{end}}
+ {{if eq .Data.Perm 2}}
+ Internal
+ {{end}}
+ {{if eq .Data.Perm 3}}
+ Private
+ {{end}}
+
diff --git a/templates/pageView.html b/templates/pageView.html
index a305cf7..fc320f8 100644
--- a/templates/pageView.html
+++ b/templates/pageView.html
@@ -8,9 +8,19 @@
Created by: {{.Data.Created}}
{{if .Data.Updated}}
- Updated by: {{.Data.Updated}}
-
+ Updated by: {{.Data.Updated}}
{{end}}
+ Visibility:
+ {{if eq .Data.Perm 1}}
+ Public
+ {{end}}
+ {{if eq .Data.Perm 2}}
+ Internal
+ {{end}}
+ {{if eq .Data.Perm 3}}
+ Private
+ {{end}}
+