CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/database/postgres/site-license/quota-site-settings.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { getServerSettings } from "@cocalc/database/settings";
7
import { KUCALC_ON_PREMISES } from "@cocalc/util/db-schema/site-defaults";
8
import { SiteSettingsQuotas } from "@cocalc/util/upgrades/quota";
9
10
export async function getQuotaSiteSettings(): Promise<
11
SiteSettingsQuotas | undefined
12
> {
13
const allSettings = await getServerSettings();
14
// default_quotas and max_upgrades only play a role for cocalc-onprem
15
// it's fine to pass down "undefined" to the quota calculation function
16
if (allSettings.kucalc === KUCALC_ON_PREMISES) {
17
return {
18
default_quotas: allSettings.default_quotas,
19
max_upgrades: allSettings.max_upgrades,
20
};
21
}
22
}
23
24