mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add housekeeping endpoints for cleaning doc snapshots+state
Summary: This adds endpoints that allow the support user to remove unlisted snapshots for a document, and to remove all action history for a document. This does increase what the support user can do, but not in a way that would be particularly valuable to attack. It would have some destructive value, for removing history (removing unlisted snapshots doesn't impact the user, by contrast). This would simplify some maintenance operations. Test Plan: added test for snapshots; tested states manually Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2699
This commit is contained in:
@@ -1106,9 +1106,10 @@ export class FlexServer implements GristServer {
|
||||
}
|
||||
|
||||
public async addHousekeeper() {
|
||||
if (this._check('housekeeper', 'start', 'homedb', 'map')) { return; }
|
||||
if (this._check('housekeeper', 'start', 'homedb', 'map', 'json', 'api-mw')) { return; }
|
||||
const store = this._docWorkerMap;
|
||||
this.housekeeper = new Housekeeper(this.dbManager, this, store, store);
|
||||
this.housekeeper.addEndpoints(this.app);
|
||||
await this.housekeeper.start();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ export async function main(port: number, serverTypes: ServerType[],
|
||||
if (includeHome) {
|
||||
if (!includeApp) {
|
||||
server.addUsage();
|
||||
await server.addHousekeeper();
|
||||
}
|
||||
if (!includeDocs) {
|
||||
server.addDocApiForwarder();
|
||||
@@ -115,9 +114,8 @@ export async function main(port: number, serverTypes: ServerType[],
|
||||
if (!includeApp) {
|
||||
server.addHomeApi();
|
||||
server.addBillingApi();
|
||||
}
|
||||
if (!includeApp) {
|
||||
server.addNotifier();
|
||||
await server.addHousekeeper();
|
||||
}
|
||||
server.addLoginRoutes();
|
||||
server.addBillingPages();
|
||||
|
||||
Reference in New Issue
Block a user