2021-07-01 15:15:43 +00:00
|
|
|
import {ActiveDoc} from 'app/server/lib/ActiveDoc';
|
|
|
|
import {ICreate} from 'app/server/lib/ICreate';
|
2021-07-12 16:10:04 +00:00
|
|
|
import {ScopedSession} from 'app/server/lib/BrowserSession';
|
2021-07-01 15:15:43 +00:00
|
|
|
import {NSandboxCreator} from 'app/server/lib/NSandbox';
|
2020-07-23 20:04:40 +00:00
|
|
|
|
|
|
|
// Use raw python - update when pynbox or other solution is set up for core.
|
|
|
|
const sandboxCreator = new NSandboxCreator('unsandboxed');
|
2020-07-21 13:20:51 +00:00
|
|
|
|
|
|
|
export const create: ICreate = {
|
2021-07-12 16:10:04 +00:00
|
|
|
adjustSession(scopedSession: ScopedSession): void {
|
|
|
|
const email = process.env.GRIST_DEFAULT_EMAIL || 'anon@getgrist.com';
|
|
|
|
const profile = {email, name: email};
|
|
|
|
scopedSession.getSessionProfile = async () => profile;
|
2020-07-21 13:20:51 +00:00
|
|
|
},
|
2021-07-01 15:15:43 +00:00
|
|
|
Billing() {
|
2020-07-21 13:20:51 +00:00
|
|
|
return {
|
2021-07-01 15:15:43 +00:00
|
|
|
addEndpoints() { /* do nothing */ },
|
2020-07-21 13:20:51 +00:00
|
|
|
addEventHandlers() { /* do nothing */ },
|
2021-07-01 15:15:43 +00:00
|
|
|
addWebhooks() { /* do nothing */ }
|
2020-07-21 13:20:51 +00:00
|
|
|
};
|
|
|
|
},
|
2020-10-06 21:32:56 +00:00
|
|
|
Notifier() {
|
2020-07-21 13:20:51 +00:00
|
|
|
return {
|
|
|
|
get testPending() { return false; }
|
|
|
|
};
|
|
|
|
},
|
|
|
|
Shell() {
|
|
|
|
return {
|
|
|
|
moveItemToTrash() { throw new Error('moveToTrash unavailable'); },
|
|
|
|
showItemInFolder() { throw new Error('showItemInFolder unavailable'); }
|
|
|
|
};
|
|
|
|
},
|
|
|
|
ExternalStorage() { return undefined; },
|
2021-03-18 22:40:02 +00:00
|
|
|
ActiveDoc(docManager, docName, options) { return new ActiveDoc(docManager, docName, options); },
|
2020-07-21 13:20:51 +00:00
|
|
|
NSandbox(options) {
|
2020-07-23 20:04:40 +00:00
|
|
|
return sandboxCreator.create(options);
|
2020-07-21 13:20:51 +00:00
|
|
|
},
|
|
|
|
sessionSecret() {
|
|
|
|
return process.env.GRIST_SESSION_SECRET ||
|
|
|
|
'Phoo2ag1jaiz6Moo2Iese2xoaphahbai3oNg7diemohlah0ohtae9iengafieS2Hae7quungoCi9iaPh';
|
2020-10-30 16:53:23 +00:00
|
|
|
},
|
|
|
|
configurationOptions() {
|
|
|
|
return {};
|
2020-07-21 13:20:51 +00:00
|
|
|
}
|
|
|
|
};
|