Ensure proper file permissions on startup

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Ken Powers 2020-02-21 18:40:04 -05:00 committed by GitHub
parent 6b56dd4ce0
commit 8d9ccd3c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 289 additions and 24 deletions

View file

@ -33,6 +33,7 @@ const ERASE_STICKERS_KEY = 'erase-stickers';
const ERASE_TEMP_KEY = 'erase-temp';
const ERASE_DRAFTS_KEY = 'erase-drafts';
const CLEANUP_ORPHANED_ATTACHMENTS_KEY = 'cleanup-orphaned-attachments';
const ENSURE_FILE_PERMISSIONS = 'ensure-file-permissions';
const _jobs = Object.create(null);
const _DEBUG = false;
@ -169,6 +170,7 @@ module.exports = {
removeOtherData,
cleanupOrphanedAttachments,
ensureFilePermissions,
// Returning plain JSON
getMessagesNeedingUpgrade,
@ -1043,6 +1045,10 @@ async function cleanupOrphanedAttachments() {
await callChannel(CLEANUP_ORPHANED_ATTACHMENTS_KEY);
}
async function ensureFilePermissions() {
await callChannel(ENSURE_FILE_PERMISSIONS);
}
// Note: will need to restart the app after calling this, to set up afresh
async function removeOtherData() {
await Promise.all([