Keep the app source archive with the app instance data dir

This commit is contained in:
Johannes Zellner
2026-01-27 12:06:40 +01:00
parent ef2a94c2c8
commit fd0d65b8ce
4 changed files with 57 additions and 20 deletions
+3 -4
View File
@@ -205,12 +205,11 @@ async function install(req, res, next) {
data.appStoreId = result.appStoreId;
data.manifest = result.manifest;
data.sourceArchiveFilePath = req.files.sourceArchive?.path || null;
// if we have a source archive upload, craft a custom docker image URI for later
if (req.files.sourceArchive?.path) {
const newFileName = `${data.manifest.id}:${data.manifest.version}-${Date.now()}`;
if (!safe.fs.renameSync(req.files.sourceArchive?.path, `/tmp/${newFileName}`)) return next(new HttpError(500, 'unable to move source archive'));
data.manifest.dockerImage = `local/${newFileName}`;
if (data.sourceArchiveFilePath) {
data.manifest.dockerImage = `local/${data.manifest.id}:${data.manifest.version}-${Date.now()}`;
}
[error, result] = await safe(apps.install(data, AuditSource.fromRequest(req)));