chore: prepare standalone public repo
- Remove Mattermost integration (OAuth, channel bridge, file sync watcher, frontend import modal). RefBoard now ships as a self-contained app. - Replace SSO Login screen with email/password form (+ optional register link gated by ALLOW_SELF_REGISTRATION). - Add SEED_ADMIN_EMAIL / SEED_ADMIN_PASSWORD env-var bootstrap so a fresh install ships with an admin account on first boot (idempotent). - ALLOW_SELF_REGISTRATION flag (default false) gates POST /api/auth/register. First user can always register (auto-promoted to admin). - Drop mattermost_id and mm_file_id columns + board_channel_links table from the schema; remove related db helpers and exports. - Add MIT LICENSE, comprehensive README, .env.example, docker-compose.yml (bundles MinIO so one command boots a working stack). - Expand .gitignore for typical Node + Docker dev artefacts.
This commit is contained in:
+7
-18
@@ -95,22 +95,18 @@ app.get('/api/users/search', (req, res) => {
|
||||
|
||||
// ---- API routes ----
|
||||
const authRoutes = require('./routes/auth');
|
||||
const oauthRoutes = require('./routes/oauth');
|
||||
const collectionRoutes = require('./routes/collections');
|
||||
const boardRoutes = require('./routes/boards');
|
||||
const uploadRoutes = require('./routes/upload');
|
||||
const adminRoutes = require('./routes/admin');
|
||||
const mmBridgeRoutes = require('./routes/mattermost-bridge');
|
||||
const threadRoutes = require('./routes/threads');
|
||||
const pdfRoutes = require('./routes/pdf');
|
||||
|
||||
app.use('/api/auth', authRoutes);
|
||||
app.use('/api/auth', oauthRoutes);
|
||||
app.use('/api/collections', collectionRoutes);
|
||||
app.use('/api/boards', boardRoutes);
|
||||
app.use('/api/upload', uploadRoutes);
|
||||
app.use('/api/admin', adminRoutes);
|
||||
app.use('/api/boards', mmBridgeRoutes);
|
||||
app.use('/api/boards', threadRoutes);
|
||||
app.use('/api/boards', pdfRoutes);
|
||||
|
||||
@@ -161,9 +157,15 @@ app.set('io', io);
|
||||
|
||||
// ---- Initialize services and start ----
|
||||
async function start() {
|
||||
require('./db');
|
||||
const dbModule = require('./db');
|
||||
console.log('[server] Database initialized');
|
||||
|
||||
try {
|
||||
await dbModule.seedAdminFromEnv();
|
||||
} catch (err) {
|
||||
console.error('[server] SEED_ADMIN bootstrap failed:', err.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const { initBucket } = require('./minio');
|
||||
await initBucket();
|
||||
@@ -173,14 +175,6 @@ async function start() {
|
||||
console.error('[server] Image uploads will not work until MinIO is available');
|
||||
}
|
||||
|
||||
// Start Mattermost auto-sync watcher (no-op if env vars missing)
|
||||
try {
|
||||
const { startWatcher } = require('./services/mm-watcher');
|
||||
startWatcher(io);
|
||||
} catch (err) {
|
||||
console.error('[server] MM watcher failed to start:', err.message);
|
||||
}
|
||||
|
||||
// Start media processing worker
|
||||
try {
|
||||
const { startMediaWorker } = require('./services/media-worker');
|
||||
@@ -198,11 +192,6 @@ async function start() {
|
||||
function shutdown(signal) {
|
||||
console.log(`[server] Received ${signal}, shutting down gracefully...`);
|
||||
|
||||
try {
|
||||
const { stopWatcher } = require('./services/mm-watcher');
|
||||
stopWatcher();
|
||||
} catch {}
|
||||
|
||||
try {
|
||||
const { stopMediaWorker } = require('./services/media-worker');
|
||||
stopMediaWorker();
|
||||
|
||||
Reference in New Issue
Block a user