chore: sync running docker state
Commit the app code currently running in Docker, including scheduler, store status, journal reminder, maintenance mode, and Foodsharing API check updates. Remove generated runtime logs from version control and ignore local runtime captures.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { readJsonFile, writeJsonFile } = require('./jsonFileStore');
|
||||
|
||||
const SETTINGS_DIR = path.join(__dirname, '..', 'config');
|
||||
|
||||
@@ -45,7 +46,7 @@ function hydrateSettingsFile(profileId) {
|
||||
ensureDir();
|
||||
const filePath = getSettingsPath(profileId);
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(DEFAULT_USER_SETTINGS, null, 2));
|
||||
writeJsonFile(filePath, DEFAULT_USER_SETTINGS, { backup: false });
|
||||
}
|
||||
return filePath;
|
||||
}
|
||||
@@ -53,8 +54,11 @@ function hydrateSettingsFile(profileId) {
|
||||
function readNotificationSettings(profileId) {
|
||||
const filePath = hydrateSettingsFile(profileId);
|
||||
try {
|
||||
const raw = fs.readFileSync(filePath, 'utf8');
|
||||
const parsed = JSON.parse(raw);
|
||||
const parsed = readJsonFile(
|
||||
filePath,
|
||||
DEFAULT_USER_SETTINGS,
|
||||
(value) => value && typeof value === 'object' && !Array.isArray(value)
|
||||
);
|
||||
return {
|
||||
notifications: {
|
||||
ntfy: {
|
||||
@@ -97,7 +101,7 @@ function writeNotificationSettings(profileId, patch = {}) {
|
||||
};
|
||||
|
||||
const filePath = hydrateSettingsFile(profileId);
|
||||
fs.writeFileSync(filePath, JSON.stringify(next, null, 2));
|
||||
writeJsonFile(filePath, next);
|
||||
return next;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user