A fork of pds-dash for selfhosted.social
1/**
2 * Configuration module for the PDS Dashboard
3 * Uses SvelteKit environment variables
4 */
5import {
6 PUBLIC_PDS_URL,
7 PUBLIC_FRONTEND_URL,
8 PUBLIC_MAX_POSTS,
9 PUBLIC_SHOW_FUTURE_POSTS
10} from '$env/static/public';
11
12export class Config {
13 /**
14 * The base URL of the PDS (Personal Data Server).
15 */
16 static readonly PDS_URL: string = PUBLIC_PDS_URL;
17
18 /**
19 * The base URL of the frontend service for linking to replies/quotes/accounts etc.
20 */
21 static readonly FRONTEND_URL: string = PUBLIC_FRONTEND_URL;
22
23 /**
24 * Maximum number of posts to fetch from the PDS per request
25 */
26 static readonly MAX_POSTS: number = parseInt(PUBLIC_MAX_POSTS, 10);
27
28
29 /**
30 * Whether to show the posts with timestamps that are in the future.
31 */
32 static readonly SHOW_FUTURE_POSTS: boolean = PUBLIC_SHOW_FUTURE_POSTS === 'true';
33}