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:
@@ -9,6 +9,7 @@ import {INotifier} from 'app/server/lib/INotifier';
|
||||
import {ISandbox, ISandboxCreationOptions} from 'app/server/lib/ISandbox';
|
||||
import {IShell} from 'app/server/lib/IShell';
|
||||
import {createSandbox} from 'app/server/lib/NSandbox';
|
||||
import * as express from 'express';
|
||||
|
||||
export interface ICreate {
|
||||
|
||||
@@ -48,13 +49,18 @@ export interface ICreateStorageOptions {
|
||||
export function makeSimpleCreator(opts: {
|
||||
sessionSecret?: string,
|
||||
storage?: ICreateStorageOptions[],
|
||||
activationMiddleware?: (db: HomeDBManager, app: express.Express) => Promise<void>,
|
||||
}): ICreate {
|
||||
return {
|
||||
Billing() {
|
||||
Billing(db) {
|
||||
return {
|
||||
addEndpoints() { /* do nothing */ },
|
||||
addEventHandlers() { /* do nothing */ },
|
||||
addWebhooks() { /* do nothing */ }
|
||||
addWebhooks() { /* do nothing */ },
|
||||
async addMiddleware(app) {
|
||||
// add activation middleware, if needed.
|
||||
return opts?.activationMiddleware?.(db, app);
|
||||
}
|
||||
};
|
||||
},
|
||||
Notifier() {
|
||||
|
||||
Reference in New Issue
Block a user