prevent slashtags from accessing disk

This commit is contained in:
keyan 2023-07-21 20:05:04 -05:00
parent 67509fe2be
commit 3c6c2a72b2
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 models from '../models'
import SDK, { SlashURL } from '@synonymdev/slashtags-sdk' import SDK, { SlashURL } from '@synonymdev/slashtags-sdk'
import { Server } from '@synonymdev/slashtags-auth' import { Server } from '@synonymdev/slashtags-auth'
import RAM from 'random-access-memory'
const HOUR = 1000 * 60 * 60 const HOUR = 1000 * 60 * 60
@ -19,7 +20,10 @@ async function createProfile (slashtag) {
const slashtags = global.slashtags || (() => { const slashtags = global.slashtags || (() => {
console.log('initing 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 // Get the default slashtag
const slashtag = sdk.slashtag() const slashtag = sdk.slashtag()