From 90a2ff959a958e8f7654f577e88e942378b0a7c2 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Sun, 29 Dec 2019 18:36:08 +0100 Subject: Allow data directories outside pwd Running ponzu-cms inside a docker container, and maintaining data files in a volume (or several) was not possible with the previous directory schema without copying files or binaries to the volume. This commit adds several environment variables to allow the administrator to specify paths for directories while retaining backwards compatibility. - PONZU_DATA_DIR : is the directory where all the data and other directories will be stored, still the other directories can be controlled by the other env variables. - PONZU_TLS_DIR : is the directory to store devcerts and autocerts - PONZU_ADMINSTATIC_DIR : directory where the admin static files are served from. - PONZU_UPLOAD_DIR: upload files directory - PONZU_SEARCH_DIR: index directory for searches --- system/search/backup.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/search/backup.go') diff --git a/system/search/backup.go b/system/search/backup.go index 4017b15..c054f9d 100644 --- a/system/search/backup.go +++ b/system/search/backup.go @@ -9,6 +9,8 @@ import ( "path/filepath" "time" + "github.com/ponzu-cms/ponzu/system/cfg" + "github.com/ponzu-cms/ponzu/system/backup" ) @@ -26,7 +28,7 @@ func Backup(ctx context.Context, res http.ResponseWriter) error { return err } - err = backup.ArchiveFS(ctx, "search", f) + err = backup.ArchiveFS(ctx, cfg.SearchDir(), f) if err != nil { return err } -- cgit v1.2.3