diff options
author | mrsdizzie <info@mrsdizzie.com> | 2019-04-05 09:24:28 -0400 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-05 09:24:28 -0400 |
commit | e14cad79c9c808ead463d8f85e463e22d851bbc0 (patch) | |
tree | db7d8505d2ee18acb6e07ea8940a0460ffa13254 /cmd | |
parent | d8802b1298edac9ed78de85303fcd0d930a3fdb6 (diff) | |
download | gitea-e14cad79c9c808ead463d8f85e463e22d851bbc0.tar.gz gitea-e14cad79c9c808ead463d8f85e463e22d851bbc0.zip |
Include custom configuration file in dump (#6516)
When running the dump command, include the specific configuration file
provided as part of the backup. Currently we only zip up custom/ and this
misses the config file if it is somewhere else, like /etc/gitea/app.ini
Fixes #6034
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dump.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/dump.go b/cmd/dump.go index 5d450822fb..98e930f2fb 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -125,6 +125,14 @@ func runDump(ctx *cli.Context) error { if err := z.AddFile("gitea-db.sql", dbDump); err != nil { log.Fatalf("Failed to include gitea-db.sql: %v", err) } + + if len(setting.CustomConf) > 0 { + log.Printf("Adding custom configuration file from %s", setting.CustomConf) + if err := z.AddFile("app.ini", setting.CustomConf); err != nil { + log.Fatalf("Failed to include specified app.ini: %v", err) + } + } + customDir, err := os.Stat(setting.CustomPath) if err == nil && customDir.IsDir() { if err := z.AddDir("custom", setting.CustomPath); err != nil { |