Add download save feature

Add command and web interface button to download saves from instances.
This commit is contained in:
Hornwitser committed 2021-06-01 16:38:56 +02:00
1 parent 35f54a0ee8
commit 12db0d5a84
9 files changed
+225 -1

No files matched your search

+14
View File
@@ -377,6 +377,20 @@ describe("Integration of Clusterio", function() {
});
});
describe("instance download-save", function() {
it("should download a save", async function() {
await fs.remove(path.join("temp", "test", "upload.zip"));
await execCtl("instance download-save 44 upload.zip");
assert(await fs.pathExists(path.join("temp", "test", "upload.zip")));
});
it("should error if save does not exist", async function() {
await assert.rejects(execCtl("instance download-save 44 invalid"));
});
it("should error on path traversal attacks", async function() {
await assert.rejects(execCtl("instance download-save 44 ../factorio-current.log"));
});
});
describe("instance delete-save", function() {
it("should delete a save", async function() {
await execCtl("instance delete-save 44 upload.zip");