diff --git a/.env.sample b/.env.sample index 1d26394..de9f220 100644 --- a/.env.sample +++ b/.env.sample @@ -20,3 +20,7 @@ CONFIG_ENABLE_EMAILS="false" # if true, email verification will be required for CONFIG_ENABLE_FOREVER_SIGNUP="true" # if true, all signups become active for 100 years # CONFIG_ALLOWED_COOKIE_DOMAINS="example.com,example.net" # can be set to allow more than the BASE_URL's domain for session cookies # CONFIG_SKIP_COOKIE_DOMAIN_SECURITY="true" # if true, the cookie domain will not be strictly set and checked against. This skipping slightly reduces security, but is usually necessary for reverse proxies like Cloudflare Tunnel. + +# CUSTOM_TITLE="" +# CUSTOM_DESCRIPTION="" +HELP_EMAIL="help@bewcloud.com" # if empty, "need help" sections will be disabled \ No newline at end of file diff --git a/islands/Settings.tsx b/islands/Settings.tsx index 11f4003..64fea72 100644 --- a/islands/Settings.tsx +++ b/islands/Settings.tsx @@ -194,8 +194,13 @@ export default function Settings({ formData: formDataObject, error, notice, curr

Delete your account

- Deleting your account is instant and deletes all your data. If you need help, please{' '} - reach out. + Deleting your account is instant and deletes all your data. {helpEmail !== '' + ? ( + <> + If you need help, please reach out. + + ) + : null}

diff --git a/lib/utils/misc.ts b/lib/utils/misc.ts index d475baa..31c305e 100644 --- a/lib/utils/misc.ts +++ b/lib/utils/misc.ts @@ -4,17 +4,24 @@ import { SupportedCurrencySymbol } from '/lib/types.ts'; let BASE_URL = typeof window !== 'undefined' && window.location ? `${window.location.protocol}//${window.location.host}` : ''; +let CUSTOM_TITLE = ''; +let CUSTOM_DESCRIPTION = ''; +let HELP_EMAIL = ''; if (typeof Deno !== 'undefined') { await import('std/dotenv/load.ts'); BASE_URL = Deno.env.get('BASE_URL') || ''; + + CUSTOM_TITLE = Deno.env.get('CUSTOM_TITLE') || ''; + CUSTOM_DESCRIPTION = Deno.env.get('CUSTOM_DESCRIPTION') || ''; + HELP_EMAIL = Deno.env.get('HELP_EMAIL') || ''; } export const baseUrl = BASE_URL || 'http://localhost:8000'; -export const defaultTitle = 'bewCloud is a modern and simpler alternative to Nextcloud and ownCloud'; -export const defaultDescription = `Have your files under your own control.`; -export const helpEmail = 'help@bewcloud.com'; +export const defaultTitle = CUSTOM_TITLE || 'bewCloud is a modern and simpler alternative to Nextcloud and ownCloud'; +export const defaultDescription = CUSTOM_DESCRIPTION || `Have your files under your own control.`; +export const helpEmail = HELP_EMAIL; export function isRunningLocally(request: Request): boolean { try { diff --git a/routes/login.tsx b/routes/login.tsx index 7bd6b67..195d112 100644 --- a/routes/login.tsx +++ b/routes/login.tsx @@ -173,13 +173,19 @@ export default function Login({ data }: PageProps) { .

-

Need help?

-

- If you're having any issues or have any questions,{' '} - - please reach out - . -

+ {helpEmail !== '' + ? ( + <> +

Need help?

+

+ If you're having any issues or have any questions,{' '} + + please reach out + . +

+ + ) + : null} ); diff --git a/routes/signup.tsx b/routes/signup.tsx index 263b066..0ed8492 100644 --- a/routes/signup.tsx +++ b/routes/signup.tsx @@ -144,13 +144,19 @@ export default function Signup({ data }: PageProps) { .

-

Need help?

-

- If you're having any issues or have any questions,{' '} - - please reach out - . -

+ {helpEmail !== '' + ? ( + <> +

Need help?

+

+ If you're having any issues or have any questions,{' '} + + please reach out + . +

+ + ) + : null} );