move environment to src/environment add smtp env vars, move some other items
Some checks failed
Code quality checks / biome (push) Failing after 13s

This commit is contained in:
creations 2025-06-10 15:16:31 -04:00
parent 421043c9b5
commit 00a7417936
Signed by: creations
GPG key ID: 8F553AA4320FC711
30 changed files with 470 additions and 42 deletions

View file

@ -0,0 +1,5 @@
import { resolve } from "node:path";
const migrationsPath = resolve("src", "environment", "database", "migrations");
export { migrationsPath };

View file

@ -0,0 +1,3 @@
export * from "./server";
export * from "./validation";
export * from "./database";

View file

@ -0,0 +1,6 @@
const reqLoggerIgnores = {
ignoredStartsWith: ["/public"],
ignoredPaths: [""],
};
export { reqLoggerIgnores };

View file

@ -0,0 +1,37 @@
import type { genericValidation } from "#types/lib";
const nameRestrictions: genericValidation = {
length: { min: 3, max: 20 },
regex: /^[\p{L}\p{N}._-]+$/u,
};
const displayNameRestrictions: genericValidation = {
length: { min: 1, max: 32 },
regex: /^[\p{L}\p{N}\p{M}\p{S}\p{P}\s]+$/u,
};
const forbiddenDisplayNamePatterns = [
/[\r\n\t]/,
/\s{3,}/,
/^\s|\s$/,
/#everyone|#here/i,
/\p{Cf}/u,
/\p{Cc}/u,
];
const passwordRestrictions: genericValidation = {
length: { min: 12, max: 64 },
regex: /^(?=.*\p{Ll})(?=.*\p{Lu})(?=.*\d)(?=.*[^\w\s]).{12,64}$/u,
};
const emailRestrictions: { regex: RegExp } = {
regex: /^[^\s#]+#[^\s#]+\.[^\s#]+$/,
};
export {
nameRestrictions,
displayNameRestrictions,
forbiddenDisplayNamePatterns,
passwordRestrictions,
emailRestrictions,
};