diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-23 11:45:07 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-23 11:45:07 -0800 |
commit | 964479e5ce756aa48755dc3de35b4d82326f149f (patch) | |
tree | 7376ead82555bd454ce9983404a4a91efb00cd55 /system/admin/server.go | |
parent | 26aa5815c50890b1c151b968ea60fce7f1c23ba5 (diff) |
adding basic auth middleware, admin/backup route, and backup routines for system, analytics, and uploads
Diffstat (limited to 'system/admin/server.go')
-rw-r--r-- | system/admin/server.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/system/admin/server.go b/system/admin/server.go index 11bfe6f..df00c21 100644 --- a/system/admin/server.go +++ b/system/admin/server.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" + "github.com/ponzu-cms/ponzu/system" "github.com/ponzu-cms/ponzu/system/admin/user" "github.com/ponzu-cms/ponzu/system/api" "github.com/ponzu-cms/ponzu/system/db" @@ -52,4 +53,7 @@ func Run() { // through the editor will not load within the admin system. uploadsDir := filepath.Join(pwd, "uploads") http.Handle("/api/uploads/", api.Record(api.CORS(db.CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir)))))))) + + // Database & uploads backup via HTTP route registered with Basic Auth middleware. + http.HandleFunc("/admin/backup", system.BasicAuth(backupHandler)) } |