migrate app dataDir to volumes

This commit is contained in:
Girish Ramakrishnan
2022-06-01 22:44:52 -07:00
parent 8fc8128957
commit dddc5a1994
12 changed files with 117 additions and 62 deletions
+2 -2
View File
@@ -62,9 +62,9 @@ async function start(existingInfra) {
// custom app data directories
const allApps = await apps.list();
for (const app of allApps) {
if (!app.manifest.addons['localstorage'] || !app.dataDir) continue;
if (!app.manifest.addons['localstorage'] || !app.storageVolumeId) continue;
const hostDir = await apps.getDataDir(app, app.dataDir), mountDir = `/mnt/app-${app.id}`; // see also sftp:userSearchSftp
const hostDir = await apps.getStorageDir(app), mountDir = `/mnt/app-${app.id}`; // see also sftp:userSearchSftp
if (!safe.fs.existsSync(hostDir)) { // this can fail if external mount does not have permissions for yellowtent user
// do not create host path when cloudron is restoring. this will then create dir with root perms making restore logic fail
debug(`Ignoring app data dir ${hostDir} for ${app.id} since it does not exist`);