Custom Title, Description and Help Email (#54)

* Add configuration of Help email, Title, Description

* Format configuration changes

* Use fragments for help sections

* Revert cleanup in misc.ts
This commit is contained in:
Prefex
2025-03-20 16:18:09 +01:00
committed by GitHub
parent 9e05f591b8
commit 5467fb3533
5 changed files with 47 additions and 19 deletions

View File

@@ -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 {