Files
splatoon3.ink/app/index.mjs
Matt Isenhower 8806239511 Remove the server's scheduler, cache warming and archive uploader
The Worker's lanes, RegionAuth renewals and direct archive writes replace
app/cron.mjs, warmCaches and DataArchiver, which only spectre used. Local
runs keep every updater, social, screenshot and archive tool; there is no
local scheduler, and local snapshots stay in storage/archive/.

ARCHIVE_DATA now has to be "true": any value, including the "false" in
.env.example, used to turn archiving on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:51:51 -08:00

45 lines
1.8 KiB
JavaScript

import dotenv from 'dotenv';
import consoleStamp from 'console-stamp';
import { sendStatuses, testStatuses } from './social/index.mjs';
import { update } from './data/index.mjs';
import MastodonClient from './social/clients/MastodonClient.mjs';
import ImageWriter from './social/clients/ImageWriter.mjs';
import BlueskyClient from './social/clients/BlueskyClient.mjs';
import ThreadsClient from './social/clients/ThreadsClient.mjs';
import { compressArchivesFromCli } from './data/ArchiveCompressor.mjs';
import { pruneArchivesFromCli } from './data/ArchivePruner.mjs';
import { reportArchiveStatsFromCli } from './data/ArchiveStats.mjs';
import { verifyArchivesFromCli } from './data/ArchiveVerifyCommand.mjs';
import { configureFilesystemStorage } from './common/storage/filesystem.mjs';
import { updateAvatars } from './social/updateAvatars.mjs';
import listBufferChannels from './social/buffer/listChannels.mjs';
consoleStamp(console);
dotenv.config({ quiet: true });
configureFilesystemStorage();
const actions = {
social: sendStatuses,
socialTest: testStatuses,
socialTestMastodon: () => testStatuses([new MastodonClient]),
socialTestBluesky: () => testStatuses([new BlueskyClient]),
socialTestImage: () => testStatuses([new ImageWriter]),
socialTestThreads: () => testStatuses([new ThreadsClient]),
bufferChannels: listBufferChannels,
splatnet: update,
archiveCompress: (...args) => compressArchivesFromCli(args),
archivePrune: (...args) => pruneArchivesFromCli(args),
archiveStats: (...args) => reportArchiveStatsFromCli(args),
archiveVerify: (...args) => verifyArchivesFromCli(args),
updateAvatars,
};
const command = process.argv[2];
const params = process.argv.slice(3);
const action = actions[command];
if (action) {
await action(...params);
} else {
console.error(`Unrecognized command: ${command}`);
}