mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
security(server): warn at startup when SERVER_SALT is unset
Room-password hashing falls back to a built-in salt that is public in the repo when SERVER_SALT is not configured. Low risk (the hash never leaves the server), but operators should set a unique salt — warn at startup, mirroring the existing ADMIN_METRICS_TOKEN warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,10 @@ if (!isAdminMetricsTokenStrong(ADMIN_METRICS_TOKEN)) {
|
||||
console.warn('[SECURITY] ADMIN_METRICS_TOKEN is set but shorter than 32 characters. Use a long random token.');
|
||||
}
|
||||
|
||||
if (!process.env.SERVER_SALT) {
|
||||
console.warn('[SECURITY] SERVER_SALT is not set — using the built-in default salt (public in the repo). Set a unique SERVER_SALT so room-password hashes are not computed with a known salt.');
|
||||
}
|
||||
|
||||
export const app = express();
|
||||
app.set('trust proxy', 1); // For real client IP through reverse proxy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user