From 391773be5ee742a9783d36ba7c2eecb5d29dea29 Mon Sep 17 00:00:00 2001 From: keyan Date: Sun, 23 Jul 2023 09:16:02 -0500 Subject: [PATCH] Revert "prevent slashtags from accessing disk" This reverts commit 3c6c2a72b2036635eb7fef34e787edfa7279bd12. --- .platform/confighooks/prebuild/00_npm_install.sh | 4 ++++ .platform/hooks/prebuild/00_npm_install.sh | 4 ++++ api/slashtags/index.js | 6 +----- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100755 .platform/confighooks/prebuild/00_npm_install.sh create mode 100755 .platform/hooks/prebuild/00_npm_install.sh diff --git a/.platform/confighooks/prebuild/00_npm_install.sh b/.platform/confighooks/prebuild/00_npm_install.sh new file mode 100755 index 00000000..7a0e5814 --- /dev/null +++ b/.platform/confighooks/prebuild/00_npm_install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /var/app/staging +sudo -u webapp npm install @synonymdev/slashtags-sdk@1.0.0-alpha.36 +sudo -u webapp npm install @synonymdev/slashtags-auth@1.0.0-alpha.5 \ No newline at end of file diff --git a/.platform/hooks/prebuild/00_npm_install.sh b/.platform/hooks/prebuild/00_npm_install.sh new file mode 100755 index 00000000..7a0e5814 --- /dev/null +++ b/.platform/hooks/prebuild/00_npm_install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /var/app/staging +sudo -u webapp npm install @synonymdev/slashtags-sdk@1.0.0-alpha.36 +sudo -u webapp npm install @synonymdev/slashtags-auth@1.0.0-alpha.5 \ No newline at end of file diff --git a/api/slashtags/index.js b/api/slashtags/index.js index 31f19be0..a57bf222 100644 --- a/api/slashtags/index.js +++ b/api/slashtags/index.js @@ -1,7 +1,6 @@ import models from '../models' import SDK, { SlashURL } from '@synonymdev/slashtags-sdk' import { Server } from '@synonymdev/slashtags-auth' -import RAM from 'random-access-memory' const HOUR = 1000 * 60 * 60 @@ -20,10 +19,7 @@ async function createProfile (slashtag) { const slashtags = global.slashtags || (() => { console.log('initing slashtags') - const sdk = new SDK({ - primaryKey: process.env.SLASHTAGS_SECRET ? Buffer.from(process.env.SLASHTAGS_SECRET, 'hex') : undefined, - storage: new RAM() - }) + const sdk = new SDK({ primaryKey: process.env.SLASHTAGS_SECRET ? Buffer.from(process.env.SLASHTAGS_SECRET, 'hex') : undefined }) // Get the default slashtag const slashtag = sdk.slashtag()