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:
2026-06-14 21:21:07 +02:00
parent 1e754023c3
commit bd41e8c079
46 changed files with 3010 additions and 7522 deletions

View File

@@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
const { readJsonFile, writeJsonFile } = require('./jsonFileStore');
const CONFIG_DIR = path.join(__dirname, '..', 'config');
const CREDENTIAL_FILE = path.join(CONFIG_DIR, 'credentials.json');
@@ -13,12 +14,15 @@ function ensureDir() {
function readStore() {
ensureDir();
if (!fs.existsSync(CREDENTIAL_FILE)) {
fs.writeFileSync(CREDENTIAL_FILE, JSON.stringify({}, null, 2));
writeJsonFile(CREDENTIAL_FILE, {}, { backup: false });
}
try {
const raw = fs.readFileSync(CREDENTIAL_FILE, 'utf8');
const parsed = JSON.parse(raw);
const parsed = readJsonFile(
CREDENTIAL_FILE,
{},
(value) => value && typeof value === 'object' && !Array.isArray(value)
);
return parsed && typeof parsed === 'object' ? parsed : {};
} catch (error) {
console.error('Konnte Credential-Store nicht lesen:', error.message);
@@ -28,7 +32,7 @@ function readStore() {
function writeStore(store) {
ensureDir();
fs.writeFileSync(CREDENTIAL_FILE, JSON.stringify(store, null, 2));
writeJsonFile(CREDENTIAL_FILE, store);
}
function save(profileId, credentials) {