wiki-plugin-shoppe 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/server.js +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-shoppe",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Multi-tenant digital goods shoppe for federated wiki, powered by Sanora",
5
5
  "keywords": [
6
6
  "wiki",
package/server/server.js CHANGED
@@ -9,9 +9,10 @@ const sessionless = require('sessionless-node');
9
9
 
10
10
  const SHOPPE_BASE_EMOJI = process.env.SHOPPE_BASE_EMOJI || '🛍️🎨🎁';
11
11
 
12
- const TENANTS_FILE = path.join(__dirname, '../.shoppe-tenants.json');
13
- const CONFIG_FILE = path.join(__dirname, '../.shoppe-config.json');
14
- const TMP_DIR = '/tmp/shoppe-uploads';
12
+ const DATA_DIR = path.join(process.env.HOME || '/root', '.shoppe');
13
+ const TENANTS_FILE = path.join(DATA_DIR, 'tenants.json');
14
+ const CONFIG_FILE = path.join(DATA_DIR, 'config.json');
15
+ const TMP_DIR = '/tmp/shoppe-uploads';
15
16
 
16
17
  // ============================================================
17
18
  // CONFIG (allyabase URL, etc.)
@@ -705,7 +706,8 @@ function generateShoppeHTML(tenant, goods) {
705
706
  async function startServer(params) {
706
707
  const app = params.app;
707
708
 
708
- if (!fs.existsSync(TMP_DIR)) fs.mkdirSync(TMP_DIR, { recursive: true });
709
+ if (!fs.existsSync(DATA_DIR)) fs.mkdirSync(DATA_DIR, { recursive: true });
710
+ if (!fs.existsSync(TMP_DIR)) fs.mkdirSync(TMP_DIR, { recursive: true });
709
711
  console.log('🛍️ wiki-plugin-shoppe starting...');
710
712
 
711
713
  const owner = (req, res, next) => {