feat(deploy): add adult verification directory creation and permissions setup

- Enhanced deploy-backend.sh and update-backend.sh to create the adult verification directory under /opt/yourpart-data.
- Updated permissions for the new directory to ensure proper access control.
- Refactored file path handling in AdminService and SettingsService to utilize the new directory structure for adult verification files.
This commit is contained in:
Torsten Schulz (local)
2026-03-27 11:24:21 +01:00
parent 02837c7b73
commit 207ef6266a
5 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
function getBackendRoot() {
return path.join(__dirname, '..');
}
export function getAdultVerificationBaseDir() {
if (process.env.ADULT_VERIFICATION_DIR && process.env.ADULT_VERIFICATION_DIR.trim()) {
return process.env.ADULT_VERIFICATION_DIR.trim();
}
if (process.env.YOURPART_PERSISTENT_DATA_DIR && process.env.YOURPART_PERSISTENT_DATA_DIR.trim()) {
return path.join(process.env.YOURPART_PERSISTENT_DATA_DIR.trim(), 'adult-verification');
}
if (process.env.STAGE === 'production' || process.env.NODE_ENV === 'production') {
return '/opt/yourpart-data/adult-verification';
}
return path.join(getBackendRoot(), 'images', 'adult-verification');
}
export function getLegacyAdultVerificationBaseDir() {
return path.join(getBackendRoot(), 'images', 'adult-verification');
}