diff options
author | Steve <nilslice@gmail.com> | 2017-01-24 10:35:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 10:35:18 -0800 |
commit | 3a897e4db97cc6f5e47f395662499402eb4c2bda (patch) | |
tree | 61350d459fb5cbf044e878042c0239acb060c7da /system/admin/server.go | |
parent | 0cf0d36f7613bbb2e13c0c8406689de3be9ee8d5 (diff) |
[core] System backups (uploads, system.db, analytics.db) (#42)
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)) } |