fix: improve robustness and security in database restore flows

- Add null checks for server instances in restore events to prevent errors
- Escape S3 credentials to prevent command injection vulnerabilities
- Fix file upload clearing custom location to prevent UI confusion
- Optimize isSafeTmpPath helper by avoiding redundant dirname calls
- Remove unnecessary --rm flag from long-running S3 restore container
- Prioritize uploaded files over custom location in import logic
- Add comprehensive unit tests for restore event null server handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-11-17 14:13:10 +01:00
parent 94560ea6c7
commit fbdd8e5f03
8 changed files with 166 additions and 19 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ class S3RestoreJobFinished
}
}
instant_remote_process($commands, Server::find($serverId), throwError: false);
$server = Server::find($serverId);
if ($server) {
instant_remote_process($commands, $server, throwError: false);
}
}
}
}