Update On Mon Dec 23 19:32:43 CET 2024

This commit is contained in:
github-action[bot]
2024-12-23 19:32:43 +01:00
parent fc9aaeb2f3
commit 0d64258f17
83 changed files with 2191 additions and 1764 deletions
@@ -523,11 +523,13 @@ function create_backup()
"/usr/share/passwall/rules/proxy_host",
"/usr/share/passwall/rules/proxy_ip"
}
local tar_file = "/tmp/passwall-backup.tar.gz"
local date = os.date("%Y%m%d")
local tar_file = "/tmp/passwall-" .. date .. "-backup.tar.gz"
fs.remove(tar_file)
local cmd = "tar -czf " .. tar_file .. " " .. table.concat(backup_files, " ")
api.sys.call(cmd)
http.header("Content-Disposition", "attachment; filename=passwall-backup.tar.gz")
http.header("Content-Disposition", "attachment; filename=passwall-" .. date .. "-backup.tar.gz")
http.header("X-Backup-Filename", "passwall-" .. date .. "-backup.tar.gz")
http.prepare_content("application/octet-stream")
http.write(fs.readfile(tar_file))
fs.remove(tar_file)