Files
codey.lol/src/config.ts

113 lines
3.2 KiB
TypeScript
Raw Normal View History

2025-12-19 11:59:00 -05:00
export interface IconConfig {
rel: string;
href: string;
}
export interface MetaData {
baseUrl: string;
title: string;
name: string;
owner: string;
ogImage: string;
description: string;
shareTitle: string;
shareDescription: string;
shareImageAlt: string;
favicon: string;
icons: IconConfig[];
}
export interface WhitelabelConfig {
title: string;
name: string;
brandColor: string;
siteTitle: string;
logoText: string;
shareTitle: string;
shareDescription: string;
ogImage: string;
shareImageAlt: string;
favicon: string;
baseUrl: string;
siteName: string;
}
export interface ProtectedRoute {
path: string;
roles?: string[];
exclude?: string[];
}
export const metaData: MetaData = {
2025-06-18 07:46:59 -04:00
baseUrl: "https://codey.lol/",
title: "CODEY STUFF",
name: "codey.lol",
owner: "codey",
ogImage: "/images/favicon.png",
description: "CODEY STUFF!",
shareTitle: "CODEY STUFF",
shareDescription: "CODEY STUFF!",
2025-12-02 10:05:43 -05:00
// alt text for the share/OG image (descriptive; not a filename)
shareImageAlt: "CODEY STUFF logo",
// default favicon / site icon used when no per-subsite override is provided
favicon: "/images/favicon.png",
// additional icons array (optional) for multi-icon support
icons: [
{ rel: 'icon', href: '/images/favicon.png' },
],
2025-06-18 07:46:59 -04:00
};
2025-12-19 11:59:00 -05:00
export const API_URL: string = "https://api.codey.lol";
export const RADIO_API_URL: string = "https://radio-api.codey.lol";
2025-12-19 11:59:00 -05:00
export const socialLinks: Record<string, string> = {
2025-06-18 07:46:59 -04:00
};
2025-07-19 22:57:35 -04:00
2025-12-19 13:45:30 -05:00
export const MAJOR_VERSION: string = "0.6"
2025-12-19 11:59:00 -05:00
export const RELEASE_FLAG: string | null = null;
export const ENVIRONMENT: "Dev" | "Prod" = import.meta.env.DEV ? "Dev" : "Prod";
// Whitelabel overrides
2025-12-19 11:59:00 -05:00
export const WHITELABELS: Record<string, WhitelabelConfig> = {
'req.boatson.boats': {
title: 'Request Media',
name: 'REQ',
2025-12-02 10:05:43 -05:00
brandColor: '', // inherit
siteTitle: 'Request Media',
logoText: 'Request Media',
2025-12-02 10:05:43 -05:00
// optional meta overrides for whitelabel/subsite
shareTitle: 'Request Media',
shareDescription: 'Request Media',
ogImage: '/images/req.png',
shareImageAlt: 'Request Media logo',
favicon: '/images/req.png',
// optional canonical/base url for this subsite (useful when host-forcing or in prod)
baseUrl: 'https://req.boatson.boats',
// human-readable site name for social meta
siteName: 'Request Media'
},
};
// Subsite mapping: host -> site path
2025-12-19 11:59:00 -05:00
export const SUBSITES: Record<string, string> = {
'req.boatson.boats': '/subsites/req',
};
// Protected routes configuration
// Routes listed here require authentication - middleware will redirect to /login if not authenticated
// Can be a string (just auth required) or object with roles array for role-based access
2025-12-17 13:33:31 -05:00
// Use 'exclude' array to exempt specific sub-paths from protection
2025-12-19 11:59:00 -05:00
export const PROTECTED_ROUTES: ProtectedRoute[] = [
{ path: '/discord-logs', roles: ['discord'] },
2025-12-17 13:33:31 -05:00
{ path: '/api/discord', roles: ['discord'], exclude: ['/api/discord/cached-image'] },
2025-12-18 11:19:01 -05:00
{ path: '/TRip', roles: ['trip'] },
{ path: '/TRip/requests', roles: ['trip'] },
{ path: '/lighting', roles: ['lighting'] },
];
// Routes that should skip auth check entirely (public routes)
2025-12-19 11:59:00 -05:00
export const PUBLIC_ROUTES: string[] = [
'/',
'/login',
'/api/',
];