(core) more grist-core cleanup

Summary:
 * Remove duplicate schema file
 * Move version file to a stub in grist-core
 * Simplify sandbox creation in grist-core (although not functional until sandbox code moved)
 * Add a minimal test for buildability

Test Plan: added test

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2560
pull/2/head
Paul Fitzpatrick 4 years ago
parent b7b4b0229b
commit 9b02d16bff

@ -1,5 +1,9 @@
{
"extends": "../../buildtools/tsconfig-base.json",
"include": [
"**/*",
"../../stubs/app/common/**/*"
],
"references": [
{ "path": "../plugin" }
]

@ -1,3 +0,0 @@
export const version = "1.0.2-dev";
export const channel = "devtest";
export const gitcommit = "e33c4e5aeM";

@ -0,0 +1,4 @@
// version tracking not set up in grist-core yet
export const version = "0.1.1";
export const channel = "core";
export const gitcommit = "unknown";

@ -3,7 +3,10 @@ import { ActiveDoc } from 'app/server/lib/ActiveDoc';
import { DocManager } from 'app/server/lib/DocManager';
import { ICreate } from 'app/server/lib/ICreate';
import { LoginSession } from 'app/server/lib/LoginSession';
import { NSandbox } from 'app/server/lib/NSandbox';
import { NSandboxCreator } from 'app/server/lib/NSandbox';
// Use raw python - update when pynbox or other solution is set up for core.
const sandboxCreator = new NSandboxCreator('unsandboxed');
export const create: ICreate = {
LoginSession() {
@ -33,30 +36,7 @@ export const create: ICreate = {
return new DocManager(storageManager, pluginManager, homeDBManager, gristServer);
},
NSandbox(options) {
const args = [options.entryPoint || 'grist/main.pyc'];
if (!options.entryPoint && options.comment) {
// Note that docName isn't used by main.py, but it makes it possible to tell in `ps` output
// which sandbox process is for which document.
args.push(options.comment);
}
const selLdrArgs: string[] = [];
if (options.sandboxMount) {
selLdrArgs.push(
// TODO: Only modules that we share with plugins should be mounted. They could be gathered in
// a "$APPROOT/sandbox/plugin" folder, only which get mounted.
'-E', 'PYTHONPATH=grist:thirdparty',
'-m', `${options.sandboxMount}:/sandbox:ro`);
}
if (options.importMount) {
selLdrArgs.push('-m', `${options.importMount}:/importdir:ro`);
}
return new NSandbox({
args,
logCalls: options.logCalls,
logMeta: options.logMeta,
logTimes: options.logTimes,
selLdrArgs,
});
return sandboxCreator.create(options);
},
sessionSecret() {
return process.env.GRIST_SESSION_SECRET ||

@ -1,3 +1,7 @@
/**
* Main entrypoint for grist-core server.
*/
import {updateDb} from 'app/server/lib/dbUtils';
import {main as mergedServerMain} from 'app/server/mergedServerMain';
import * as fse from 'fs-extra';

Loading…
Cancel
Save