Files
bewcloud/lib/config.ts
Bruno Bernardino 4e5fdd569a Files CRUD.
Remove Contacts and Calendar + CardDav and CalDav.
2024-04-03 14:02:04 +01:00

24 lines
526 B
TypeScript

import 'std/dotenv/load.ts';
import { isThereAnAdmin } from './data/user.ts';
export async function isSignupAllowed() {
const areSignupsAllowed = Deno.env.get('CONFIG_ALLOW_SIGNUPS') === 'true';
const areThereAdmins = await isThereAnAdmin();
if (areSignupsAllowed || !areThereAdmins) {
return true;
}
return false;
}
export function getFilesRootPath() {
const configRootPath = Deno.env.get('CONFIG_FILES_ROOT_PATH');
const filesRootPath = `${Deno.cwd()}/${configRootPath}`;
return filesRootPath;
}