Revert "Revert "prevent slashtags from accessing disk""

This reverts commit 391773be5e.
This commit is contained in:
keyan 2023-07-23 10:08:56 -05:00
parent 567b1b9e88
commit 437faca197
3 changed files with 5 additions and 9 deletions

View File

@ -1,4 +0,0 @@
#!/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

View File

@ -1,4 +0,0 @@
#!/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

View File

@ -1,6 +1,7 @@
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
@ -19,7 +20,10 @@ 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 })
const sdk = new SDK({
primaryKey: process.env.SLASHTAGS_SECRET ? Buffer.from(process.env.SLASHTAGS_SECRET, 'hex') : undefined,
storage: new RAM()
})
// Get the default slashtag
const slashtag = sdk.slashtag()