ework-web 0.10.3 → 0.10.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-web",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
@@ -29,6 +29,7 @@ export interface BatchTarget {
29
29
 
30
30
  const FORWARD_KEYS = [
31
31
  "WORK_DB_DRIVER",
32
+ "WORK_DB_PORT",
32
33
  "WORK_DB_USER",
33
34
  "WORK_DB_PASSWORD",
34
35
  "WORK_DB_NAME",
@@ -78,14 +79,16 @@ function buildEnvBlock(env: Map<string, string>, target: DeployTarget): string {
78
79
  if (v === undefined) continue;
79
80
  lines.push(`${k}=${v}`);
80
81
  }
81
- lines.push(`WORK_DB_HOST=${target.mysqlHost}`);
82
+ const mysqlHost = String(target.mysqlHost).replace(/:\d+$/, "");
83
+ lines.push(`WORK_DB_HOST=${mysqlHost}`);
82
84
  lines.push(`DAEMON_PORT=${String(target.daemonPort ?? 3101)}`);
83
85
  lines.push(`DAEMON_HOST=0.0.0.0`);
84
86
  lines.push(`DAEMON_ENV=production`);
85
87
  return lines.join("\n");
86
88
  }
87
89
 
88
- function buildSetupScript(envBlock: string, daemonPort: number, mysqlHost: string, mysqlPort: string): string {
90
+ function buildSetupScript(envBlock: string, daemonPort: number, mysqlHostRaw: string, mysqlPort: string): string {
91
+ const mysqlHost = mysqlHostRaw.replace(/:\d+$/, "");
89
92
  return [
90
93
  "set -e",
91
94
  `command -v npm >/dev/null 2>&1 || { curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -; sudo apt-get install -y nodejs; }`,
@@ -111,8 +114,9 @@ function buildSetupScript(envBlock: string, daemonPort: number, mysqlHost: strin
111
114
  `echo "[4/5] starting daemon..."`,
112
115
  `ework-aio start daemon`,
113
116
  `echo "[5/5] verifying daemon is alive..."`,
114
- `sleep 2`,
115
- `curl -sf --max-time 3 http://127.0.0.1:${String(daemonPort)}/api/status >/dev/null 2>&1 && echo "DAEMON_ALIVE" || echo "DAEMON_WARNING: status check failed (may need a moment to boot)"`,
117
+ `sleep 3`,
118
+ `curl -sf --max-time 5 http://127.0.0.1:${String(daemonPort)}/api/status 2>/dev/null && echo "DAEMON_ALIVE" || { echo "DAEMON_FAILED: status check failed"; echo "=== daemon log (last 20 lines) ==="; tail -20 ~/.local/share/ework-aio/run/daemon.log 2>/dev/null || echo "(no log)"; exit 1; }`,
119
+ `echo "=== hostname: $(hostname) ==="`,
116
120
  `echo DAEMON_STARTED`,
117
121
  ].join("\n");
118
122
  }