11import express from 'express' ;
22// eslint-disable-next-line import/no-unresolved, node/no-missing-import
33import { stringify as csvStringify } from 'csv-stringify/sync' ; // https://github.com/adaltas/node-csv/issues/323
4- import { domain , actorInfo , parseJSON } from '../util.js' ;
4+ import { domain , actorInfo , parseJSON , dataDir } from '../util.js' ;
55import { isAuthenticated } from '../session-auth.js' ;
66import { lookupActorInfo , createFollowMessage , createUnfollowMessage , signAndSend , getInboxFromActorProfile } from '../activitypub.js' ;
77
8- const DATA_PATH = '/app/.data' ;
9-
108const ADMIN_LINKS = [
119 { href : '/admin' , label : 'Bookmarklet' } ,
1210 { href : '/admin/bookmarks' , label : 'Import bookmarks' } ,
@@ -98,7 +96,7 @@ router.get('/data', isAuthenticated, async (req, res) => {
9896} ) ;
9997
10098router . get ( '/bookmarks.db' , isAuthenticated , async ( req , res ) => {
101- const filePath = `${ DATA_PATH } /bookmarks.db` ;
99+ const filePath = `${ dataDir } /bookmarks.db` ;
102100
103101 res . setHeader ( 'Content-Type' , 'application/vnd.sqlite3' ) ;
104102 res . setHeader ( 'Content-Disposition' , 'attachment; filename="bookmarks.db"' ) ;
@@ -118,7 +116,7 @@ router.get('/bookmarks.csv', isAuthenticated, async (req, res) => {
118116} ) ;
119117
120118router . get ( '/activitypub.db' , isAuthenticated , async ( req , res ) => {
121- const filePath = `${ DATA_PATH } /activitypub.db` ;
119+ const filePath = `${ dataDir } /activitypub.db` ;
122120
123121 res . setHeader ( 'Content-Type' , 'application/vnd.sqlite3' ) ;
124122 res . setHeader ( 'Content-Disposition' , 'attachment; filename="activitypub.db"' ) ;
0 commit comments