import {clamp, deepFreeze} from "./utils.js"; export const PORT = clamp(+process.env.PORT||8080, 1, 65535); export const HOST = process.env.HOST||"0.0.0.0"; export const DOMAIN = "localhost"; export const SECURE = false; // i.e. served over https export const auth = deepFreeze({ TOKEN_RENEW_AGE: 15*60, // 15 mins TOKEN_MAX_AGE: 30*86400, // 30 days TOKEN_LENGTH: 24, // bytes SESSION_ID_LENGTH: 12, USERNAME_MAX_LENGTH: 128, PASSWORD_MIN_LENGTH: 8, PASSWORD_MAX_LENGTH: 512, // Avoid DDOS RATE_LIMIT_MAX_LEVEL: 16, RATE_LIMIT_MAX_WAITING: 512, fingerprintIP: req => //req.headers["cf-connecting-ip"] || //req.headers["x-forwarded-for"] || req.socket.remoteAddress, }); export const NOTE_DIR = "./users";