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/next/lib/share/proxy/project.ts
Views: 687
1
import getPool from "@cocalc/database/pool";
2
import { isValidUUID } from "@cocalc/util/misc";
3
4
export default async function getProxyProjectId(): Promise<string> {
5
const pool = getPool("long");
6
const { rows } = await pool.query(
7
"SELECT value FROM server_settings WHERE name='github_project_id'"
8
);
9
if (rows.length == 0 || !isValidUUID(rows[0].value)) {
10
throw Error("github_project_id is not configured");
11
}
12
return rows[0].value;
13
}
14
15