hotfix: roll back and add back permissions a+rwx to app-data folder

This commit is contained in:
Nicolas Meienberger 2023-08-30 08:42:48 +02:00
parent 7926c45d88
commit a0f5d07df1
2 changed files with 11 additions and 0 deletions

View file

@ -1,11 +1,15 @@
import fs from 'fs';
import path from 'path';
import { exec } from 'child_process';
import { promisify } from 'util';
import { getEnv } from '@/utils/environment/environment';
import { pathExists } from '@/utils/fs-helpers';
import { compose } from '@/utils/docker-helpers';
import { copyDataDir, generateEnvFile } from './app.helpers';
import { fileLogger } from '@/utils/logger/file-logger';
const execAsync = promisify(exec);
export class AppExecutors {
private readonly logger;
@ -143,6 +147,8 @@ export class AppExecutors {
public startApp = async (appId: string, config: Record<string, unknown>) => {
try {
const { appDataDirPath } = this.getAppPaths(appId);
this.logger.info(`Starting app ${appId}`);
this.logger.info(`Regenerating app.env file for app ${appId}`);
@ -151,6 +157,9 @@ export class AppExecutors {
await compose(appId, 'up --detach --force-recreate --remove-orphans');
this.logger.info(`App ${appId} started`);
await execAsync(`chmod -R a+rwx ${path.join(appDataDirPath)}`).catch(() => {});
return { success: true, message: `App ${appId} started successfully` };
} catch (err) {
return this.handleAppError(err);

View file

@ -116,6 +116,8 @@ export class SystemExecutors {
}
}),
);
await execAsync(`sudo chmod -R a+rwx ${path.join(rootFolderHost, 'app-data')}`);
};
public systemInfo = async () => {