mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add minimal support for activation keys
Summary: For grist-ee, expect an activation key in environment variable `GRIST_ACTIVATION` or in a file pointed to by `GRIST_ACTIVATION_FILE`. In absence of key, start a 30-day trial, during which a banner is shown. Once trial expires, installation goes into document-read-only mode. Test Plan: added a test Reviewers: dsagal Reviewed By: dsagal Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3426
This commit is contained in:
@@ -59,12 +59,13 @@ export async function main() {
|
||||
await fse.mkdirp(process.env.GRIST_DATA_DIR!);
|
||||
// Make a blank db if needed.
|
||||
await updateDb();
|
||||
const db = new HomeDBManager();
|
||||
await db.connect();
|
||||
await db.initializeSpecialIds({skipWorkspaces: true});
|
||||
|
||||
// If a team/organization is specified, make sure it exists.
|
||||
const org = process.env.GRIST_SINGLE_ORG;
|
||||
if (org && org !== 'docs') {
|
||||
const db = new HomeDBManager();
|
||||
await db.connect();
|
||||
await db.initializeSpecialIds({skipWorkspaces: true});
|
||||
try {
|
||||
db.unwrapQueryResult(await db.getOrg({
|
||||
userId: db.getPreviewerUserId(),
|
||||
@@ -94,6 +95,7 @@ export async function main() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Launch single-port, self-contained version of Grist.
|
||||
const server = await mergedServerMain(G.port, ["home", "docs", "static"]);
|
||||
if (process.env.GRIST_TESTING_SOCKET) {
|
||||
|
||||
Reference in New Issue
Block a user