|
|
|
@ -20,7 +20,8 @@ interface Config {
@@ -20,7 +20,8 @@ interface Config {
|
|
|
|
|
TURNSTILE_KEY: string; |
|
|
|
|
CDN_REPLACEMENTS: string; |
|
|
|
|
HAS_ONBOARDING: string; |
|
|
|
|
ONBOARDING_EXTENSION_INSTALL_LINK: string; |
|
|
|
|
ONBOARDING_CHROME_EXTENSION_INSTALL_LINK: string; |
|
|
|
|
ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK: string; |
|
|
|
|
ONBOARDING_PROXY_INSTALL_LINK: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -38,7 +39,8 @@ export interface RuntimeConfig {
@@ -38,7 +39,8 @@ export interface RuntimeConfig {
|
|
|
|
|
TURNSTILE_KEY: string | null; |
|
|
|
|
CDN_REPLACEMENTS: Array<string[]>; |
|
|
|
|
HAS_ONBOARDING: boolean; |
|
|
|
|
ONBOARDING_EXTENSION_INSTALL_LINK: string | null; |
|
|
|
|
ONBOARDING_CHROME_EXTENSION_INSTALL_LINK: string | null; |
|
|
|
|
ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK: string | null; |
|
|
|
|
ONBOARDING_PROXY_INSTALL_LINK: string | null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -48,8 +50,10 @@ const env: Record<keyof Config, undefined | string> = {
@@ -48,8 +50,10 @@ const env: Record<keyof Config, undefined | string> = {
|
|
|
|
|
GITHUB_LINK: undefined, |
|
|
|
|
DONATION_LINK: undefined, |
|
|
|
|
DISCORD_LINK: undefined, |
|
|
|
|
ONBOARDING_EXTENSION_INSTALL_LINK: import.meta.env |
|
|
|
|
.VITE_ONBOARDING_EXTENSION_INSTALL_LINK, |
|
|
|
|
ONBOARDING_CHROME_EXTENSION_INSTALL_LINK: import.meta.env |
|
|
|
|
.VITE_ONBOARDING_CHROME_EXTENSION_INSTALL_LINK, |
|
|
|
|
ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK: import.meta.env |
|
|
|
|
.VITE_ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK, |
|
|
|
|
ONBOARDING_PROXY_INSTALL_LINK: import.meta.env |
|
|
|
|
.VITE_ONBOARDING_PROXY_INSTALL_LINK, |
|
|
|
|
DMCA_EMAIL: import.meta.env.VITE_DMCA_EMAIL, |
|
|
|
@ -80,7 +84,8 @@ function getKey(key: keyof Config, defaultString?: string): string {
@@ -80,7 +84,8 @@ function getKey(key: keyof Config, defaultString?: string): string {
|
|
|
|
|
|
|
|
|
|
export function conf(): RuntimeConfig { |
|
|
|
|
const dmcaEmail = getKey("DMCA_EMAIL"); |
|
|
|
|
const extensionLink = getKey("ONBOARDING_EXTENSION_INSTALL_LINK"); |
|
|
|
|
const chromeExtension = getKey("ONBOARDING_CHROME_EXTENSION_INSTALL_LINK"); |
|
|
|
|
const firefoxExtension = getKey("ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK"); |
|
|
|
|
const proxyInstallLink = getKey("ONBOARDING_PROXY_INSTALL_LINK"); |
|
|
|
|
const turnstileKey = getKey("TURNSTILE_KEY"); |
|
|
|
|
return { |
|
|
|
@ -89,8 +94,10 @@ export function conf(): RuntimeConfig {
@@ -89,8 +94,10 @@ export function conf(): RuntimeConfig {
|
|
|
|
|
DONATION_LINK, |
|
|
|
|
DISCORD_LINK, |
|
|
|
|
DMCA_EMAIL: dmcaEmail.length > 0 ? dmcaEmail : null, |
|
|
|
|
ONBOARDING_EXTENSION_INSTALL_LINK: |
|
|
|
|
extensionLink.length > 0 ? extensionLink : null, |
|
|
|
|
ONBOARDING_CHROME_EXTENSION_INSTALL_LINK: |
|
|
|
|
chromeExtension.length > 0 ? chromeExtension : null, |
|
|
|
|
ONBOARDING_FIREFOX_EXTENSION_INSTALL_LINK: |
|
|
|
|
firefoxExtension.length > 0 ? firefoxExtension : null, |
|
|
|
|
ONBOARDING_PROXY_INSTALL_LINK: |
|
|
|
|
proxyInstallLink.length > 0 ? proxyInstallLink : null, |
|
|
|
|
BACKEND_URL: getKey("BACKEND_URL", BACKEND_URL), |
|
|
|
|