depository-deploy 1.1.20 → 1.2.3

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.
@@ -236,6 +236,13 @@ if [ ! -d "$UI_SRC" ]; then
236
236
  fi
237
237
  cp -r "$UI_SRC/"* "$INSTALL_DIR/ui/"
238
238
 
239
+ # Inject API base URL so the React app routes through the nginx proxy (same origin → no CORS)
240
+ UI_INDEX="$INSTALL_DIR/ui/index.html"
241
+ if [ -f "$UI_INDEX" ]; then
242
+ sed -i.bak "s|</head>|<script>window.__API_BASE__='${SITE_URL}';window.__CORE_API_BASE__='${SITE_URL}';</script></head>|" "$UI_INDEX" && rm -f "${UI_INDEX}.bak"
243
+ info "UI configured: API base → $SITE_URL"
244
+ fi
245
+
239
246
  chmod +x "$INSTALL_DIR/api/DEPOSITORY.API.REST"
240
247
  chmod +x "$INSTALL_DIR/auth/DEPOSITORY.API.OATH"
241
248
  chmod +x "$INSTALL_DIR/worker/DEPOSITORY.CORE.WORKER"
@@ -222,6 +222,17 @@ if (-not (Test-Path $uiSrc)) {
222
222
  }
223
223
  if (-not (Test-Path $uiSrc)) { Write-Fail "UI folder not found at $ReleaseDir\ui or $(Split-Path -Parent $ReleaseDir)\ui" }
224
224
  Copy-Item "$uiSrc\*" (Join-Path $INSTALL_DIR "ui") -Recurse -Force
225
+
226
+ # Inject API base URL so the React app routes through the IIS proxy (same origin → no CORS)
227
+ $uiIndex = Join-Path $INSTALL_DIR "ui\index.html"
228
+ if (Test-Path $uiIndex) {
229
+ $html = Get-Content $uiIndex -Raw -Encoding UTF8
230
+ $inject = "<script>window.__API_BASE__='$SITE_URL';window.__CORE_API_BASE__='$SITE_URL';</script>"
231
+ $html = $html -replace '</head>', "$inject</head>"
232
+ Set-Content $uiIndex -Value $html -Encoding UTF8
233
+ Write-OK "UI configured: API base → $SITE_URL"
234
+ }
235
+
225
236
  $setupSrc = Join-Path $ReleaseDir "setup"
226
237
  if (Test-Path $setupSrc) {
227
238
  Copy-Item "$setupSrc\*" (Join-Path $INSTALL_DIR "setup") -Recurse -Force
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "ApplicationSettings": {
15
15
  "JWT_Secret": "{{JWT_SECRET}}",
16
+ "Client_URL": "{{SITE_URL}}",
16
17
  "BatchWorkingRoot": "{{DATA_DIR}}",
17
18
  "AzureMainRoot": "main",
18
19
  "AzureStagingRoot": "staging",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "depository-deploy",
3
- "version": "1.1.20",
3
+ "version": "1.2.3",
4
4
  "description": "Depository document management system – deployment wizard and installers",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -25,9 +25,9 @@
25
25
  "scripts/publish.mjs"
26
26
  ],
27
27
  "optionalDependencies": {
28
- "depository-deploy-linux": "1.1.20",
29
- "depository-deploy-macos": "1.1.20",
30
- "depository-deploy-windows": "1.1.20"
28
+ "depository-deploy-linux": "1.2.3",
29
+ "depository-deploy-macos": "1.2.3",
30
+ "depository-deploy-windows": "1.2.3"
31
31
  },
32
32
  "scripts": {
33
33
  "start": "node wizard-server.mjs"
package/wizard-server.mjs CHANGED
@@ -347,13 +347,7 @@ const server = createServer((req, res) => {
347
347
  for (const sub of job.subs) sendSSE(sub, 'line', { text });
348
348
  }
349
349
 
350
- // Detect if running via npx/global install and pick the right update command
351
- const scriptPath = process.argv[1] || '';
352
- const isGlobal = scriptPath.includes('node_modules') ||
353
- process.env.npm_config_global === 'true';
354
- const cmd = isGlobal
355
- ? ['npm', ['install', '-g', `${PKG_NAME}@latest`]]
356
- : ['npx', [`${PKG_NAME}@latest`]];
350
+ const cmd = ['npm', ['install', '-g', `${PKG_NAME}@latest`]];
357
351
 
358
352
  pushLine(`Updating ${PKG_NAME} → latest...`);
359
353
  pushLine(`Running: ${cmd[0]} ${cmd[1].join(' ')}`);
package/wizard.html CHANGED
@@ -2235,9 +2235,11 @@ async function selfUpdate() {
2235
2235
  const { id } = await r.json();
2236
2236
 
2237
2237
  // Stream the update log via SSE
2238
+ let lastLine = '';
2238
2239
  const es = new EventSource(SERVER_BASE + '/api/install-stream/' + id);
2239
2240
  es.addEventListener('line', e => {
2240
2241
  const { text } = JSON.parse(e.data);
2242
+ if (text) lastLine = text;
2241
2243
  status.textContent = text;
2242
2244
  });
2243
2245
  es.addEventListener('done', e => {
@@ -2249,7 +2251,8 @@ async function selfUpdate() {
2249
2251
  } else {
2250
2252
  btn.disabled = false;
2251
2253
  btn.textContent = t('update_btn');
2252
- status.textContent = t('update_failed');
2254
+ const hint = t('update_failed');
2255
+ status.textContent = lastLine ? `${lastLine} — ${hint}` : hint;
2253
2256
  }
2254
2257
  });
2255
2258
  es.onerror = () => {