summaryrefslogtreecommitdiff
path: root/system/admin/server.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-11-16 02:51:26 -0800
committerGitHub <noreply@github.com>2016-11-16 02:51:26 -0800
commitf252472047f86d1bdf956dc59b89541ea0260d68 (patch)
tree6c0d5938c21505325ad50446f5ebcd1483d6b278 /system/admin/server.go
parent9a531ac701990bb932664039b11614227467e03a (diff)
parent6f5893828077eb0034dca01344f3742eb5cd5fa6 (diff)
Merge pull request #17 from bosssauce/ponzu-dev
[core] Adding lifecycle hooks for Save, Delete, Approve, Reject
Diffstat (limited to 'system/admin/server.go')
-rw-r--r--system/admin/server.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/admin/server.go b/system/admin/server.go
index 5d93d84..75b48f6 100644
--- a/system/admin/server.go
+++ b/system/admin/server.go
@@ -18,6 +18,10 @@ func Run() {
http.HandleFunc("/admin/login", loginHandler)
http.HandleFunc("/admin/logout", logoutHandler)
+ http.HandleFunc("/admin/recover", forgotPasswordHandler)
+ http.HandleFunc("/admin/recover/key", recoveryKeyHandler)
+ http.HandleFunc("/admin/recover/edit", recoveryEditHandler)
+
http.HandleFunc("/admin/configure", user.Auth(configHandler))
http.HandleFunc("/admin/configure/users", user.Auth(configUsersHandler))
http.HandleFunc("/admin/configure/users/edit", user.Auth(configUsersEditHandler))
@@ -37,11 +41,11 @@ func Run() {
}
staticDir := filepath.Join(pwd, "cmd", "ponzu", "vendor", "github.com", "bosssauce", "ponzu", "system")
- http.Handle("/admin/static/", CacheControl(http.FileServer(http.Dir(staticDir))))
+ http.Handle("/admin/static/", CacheControl(http.FileServer(restrict(http.Dir(staticDir)))))
// API path needs to be registered within server package so that it is handled
// even if the API server is not running. Otherwise, images/files uploaded
// through the editor will not load within the admin system.
uploadsDir := filepath.Join(pwd, "uploads")
- http.Handle("/api/uploads/", CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(http.Dir(uploadsDir)))))
+ http.Handle("/api/uploads/", CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir))))))
}