From ef6f98c149ce6e9bb95f8e9ed926cdde6c6d32d7 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 18 Feb 2022 13:35:20 +0530 Subject: [PATCH] initial serverside components for 'disableEmbedding' functionality --- lib/commands/admin-rpc.js | 1 + lib/decrees.js | 5 +++++ server.js | 1 + 3 files changed, 7 insertions(+) diff --git a/lib/commands/admin-rpc.js b/lib/commands/admin-rpc.js index 59750571e..532deed03 100644 --- a/lib/commands/admin-rpc.js +++ b/lib/commands/admin-rpc.js @@ -300,6 +300,7 @@ var setLastEviction = function (Env, Server, cb, data, unsafeKey) { var instanceStatus = function (Env, Server, cb) { cb(void 0, { restrictRegistration: Env.restrictRegistration, + disableEmbedding: Env.disableEmbedding, launchTime: Env.launchTime, currentTime: +new Date(), diff --git a/lib/decrees.js b/lib/decrees.js index 5f599705e..c1e417ed5 100644 --- a/lib/decrees.js +++ b/lib/decrees.js @@ -48,6 +48,8 @@ ADD_INVITE REVOKE_INVITE REDEEM_INVITE +DISABLE_EMBEDDING + // 2.0 Env.DEV_MODE || Env.FRESH_MODE, @@ -87,6 +89,9 @@ var makeBooleanSetter = function (attr) { }; }; +// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['DISABLE_EMBEDDING', [true]]], console.log) +commands.DISABLE_EMBEDDING = makeBooleanSetter('disableEmbedding'); + // CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['RESTRICT_REGISTRATION', [true]]], console.log) commands.RESTRICT_REGISTRATION = makeBooleanSetter('restrictRegistration'); diff --git a/server.js b/server.js index 73f63a3e1..7d08c3656 100644 --- a/server.js +++ b/server.js @@ -249,6 +249,7 @@ var serveConfig = makeRouteCache(function (host) { premiumUploadSize: Env.premiumUploadSize, restrictRegistration: Env.restrictRegistration, httpSafeOrigin: Env.httpSafeOrigin, + disableEmbedding: Env.disableEmbedding, }, null, '\t'), '});' ].join(';\n')