96 lines
2.8 KiB
TypeScript
96 lines
2.8 KiB
TypeScript
const DEFAULT_API_URL =
|
|
(import.meta.env.DEV ? import.meta.env.VITE_DEV_API_URL : undefined) ??
|
|
(import.meta.env.VITE_API_URL as string) ??
|
|
"https://stoat.chat/api";
|
|
|
|
export default {
|
|
/**
|
|
* Whether to emit additional debug information
|
|
*/
|
|
DEBUG: import.meta.env.DEV || true,
|
|
/**
|
|
* What API server to connect to by default.
|
|
*/
|
|
DEFAULT_API_URL,
|
|
/**
|
|
* Whether this is Stoat
|
|
*/
|
|
IS_STOAT: [
|
|
// historically...
|
|
"https://api.revolt.chat",
|
|
"https://beta.revolt.chat/api",
|
|
"https://revolt.chat/api",
|
|
// ... and now:
|
|
"https://stoat.chat/api",
|
|
].includes(DEFAULT_API_URL),
|
|
/**
|
|
* What WS server to connect to by default.
|
|
*/
|
|
DEFAULT_WS_URL:
|
|
(import.meta.env.DEV ? import.meta.env.VITE_DEV_WS_URL : undefined) ??
|
|
(import.meta.env.VITE_WS_URL as string) ??
|
|
"wss://stoat.chat/events",
|
|
/**
|
|
* What media server to connect to by default.
|
|
*/
|
|
DEFAULT_MEDIA_URL:
|
|
(import.meta.env.DEV ? import.meta.env.VITE_DEV_MEDIA_URL : undefined) ??
|
|
(import.meta.env.VITE_MEDIA_URL as string) ??
|
|
"https://cdn.stoatusercontent.com",
|
|
/**
|
|
* What proxy server to connect to by default.
|
|
*/
|
|
DEFAULT_PROXY_URL:
|
|
(import.meta.env.DEV ? import.meta.env.VITE_DEV_PROXY_URL : undefined) ??
|
|
(import.meta.env.VITE_PROXY_URL as string) ??
|
|
"https://proxy.stoatusercontent.com",
|
|
/**
|
|
* What gifbox server to connect to by default.
|
|
*/
|
|
DEFAULT_GIFBOX_URL:
|
|
(import.meta.env.DEV ? import.meta.env.VITE_DEV_GIFBOX_URL : undefined) ??
|
|
(import.meta.env.VITE_GIFBOX_URL as string) ??
|
|
"https://api.gifbox.me",
|
|
/**
|
|
* hCaptcha site key to use if enabled
|
|
*/
|
|
HCAPTCHA_SITEKEY: import.meta.env.VITE_HCAPTCHA_SITEKEY as string,
|
|
/**
|
|
* Maximum number of replies a message can have
|
|
*/
|
|
MAX_REPLIES: (import.meta.env.VITE_CFG_MAX_REPLIES as number) ?? 5,
|
|
/**
|
|
* Maximum number of attachments a message can have
|
|
*/
|
|
MAX_ATTACHMENTS: (import.meta.env.VITE_CFG_MAX_ATTACHMENTS as number) ?? 5,
|
|
/**
|
|
* Maximum number of emoji a server can have
|
|
*/
|
|
MAX_EMOJI: (import.meta.env.VITE_CFG_MAX_EMOJI as number) ?? 100,
|
|
/**
|
|
* Max file size allowed for uploads (in bytes)
|
|
* 20 MB = 20 * 1024 * 1024 = 20,971,520 bytes
|
|
* I kinda wonder if this should be a setting, or something fetched from the backend dynamically.
|
|
*/
|
|
MAX_FILE_SIZE:
|
|
(import.meta.env.VITE_CFG_MAX_FILE_SIZE as number) ?? 20_000_000,
|
|
/**
|
|
* Session ID to set during development.
|
|
*/
|
|
DEVELOPMENT_SESSION_ID: import.meta.env.DEV
|
|
? (import.meta.env.VITE_SESSION_ID as string)
|
|
: undefined,
|
|
/**
|
|
* Token to set during development.
|
|
*/
|
|
DEVELOPMENT_TOKEN: import.meta.env.DEV
|
|
? (import.meta.env.VITE_TOKEN as string)
|
|
: undefined,
|
|
/**
|
|
* User ID to set during development.
|
|
*/
|
|
DEVELOPMENT_USER_ID: import.meta.env.DEV
|
|
? (import.meta.env.VITE_USER_ID as string)
|
|
: undefined,
|
|
};
|