wiki-plugin-allyabase 0.0.12 → 0.0.13

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.
@@ -51,22 +51,9 @@ setup_services() {
51
51
  fi
52
52
 
53
53
  printf '%s\n' "Installing '$service'..."
54
- npm install "$service/src/server/node"
54
+ npm install --prefix "$buildDir/$service/src/server/node"
55
55
  done
56
56
 
57
- # Add logging to BDO service to debug request handling
58
- echo "Adding debug logging to BDO service..."
59
-
60
- # Find the PUT /user/create endpoint and add logging at the start
61
- sed -i.bak "/app.put.*user\/create/,/^app\./ {
62
- /^app\.put/a\\
63
- console.log('[BDO] Received PUT /user/create request');\
64
- console.log('[BDO] Headers:', JSON.stringify(req.headers, null, 2));\
65
- console.log('[BDO] Body:', JSON.stringify(req.body, null, 2));
66
- }" bdo/src/server/node/bdo.js
67
-
68
- echo "✓ Added logging to BDO service"
69
-
70
57
  } # setup_services
71
58
 
72
59
  setup_ecosystem() {
@@ -155,6 +142,8 @@ setup_ecosystem() {
155
142
  " {" \
156
143
  " name: '$service'," \
157
144
  " script: '$buildDir/$service/src/server/node/${service}.js'," \
145
+ " node_args: '--max-old-space-size=256'," \
146
+ " max_memory_restart: '350M'," \
158
147
  " env: $env" \
159
148
  " }," >>"$ecosystem_config"
160
149
  done
@@ -167,12 +156,23 @@ main() {
167
156
  setup_services
168
157
  setup_ecosystem
169
158
 
170
- # Start with pm2 daemon (allows pm2 logs, pm2 status, etc.)
171
- echo "Starting PM2 with ecosystem config..."
172
- ./node_modules/.bin/pm2 start ecosystem.config.js
159
+ # Start BDO first all other services register with it on boot
160
+ echo "Starting BDO first..."
161
+ ./node_modules/.bin/pm2 start ecosystem.config.js --only bdo
162
+
163
+ echo "Waiting for BDO to initialize..."
164
+ sleep 5
165
+
166
+ # Start remaining services one at a time to avoid memory spike on small droplets
167
+ echo "Starting remaining services serially..."
168
+ for service in "${services[@]}"; do
169
+ [[ $service == 'bdo' ]] && continue
170
+ echo " Starting $service..."
171
+ ./node_modules/.bin/pm2 start ecosystem.config.js --only "$service"
172
+ sleep 2
173
+ done
173
174
 
174
- # Wait a moment for services to start
175
- echo "Waiting for services to initialize..."
175
+ echo "Waiting for services to settle..."
176
176
  sleep 5
177
177
 
178
178
  # Show PM2 status
@@ -575,6 +575,9 @@ function emit($item, item) {
575
575
 
576
576
  try {
577
577
  const response = await post('/plugin/allyabase/launch');
578
+ if (response.status === 401) {
579
+ throw new Error('You must be logged in as the wiki owner to launch a base');
580
+ }
578
581
  const result = await response.json();
579
582
 
580
583
  if (result.success) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-allyabase",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Allyabase management plugin for the federated wiki",
5
5
  "keywords": [
6
6
  "wiki",