@lightupai/polaris 0.0.27 → 0.0.28
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/deploy.sh +1 -1
- package/docker/Caddyfile +2 -2
- package/docker-compose.prod.yml +2 -2
- package/docs/deploy-hetzner.md +9 -9
- package/package.json +1 -1
- package/src/cli/cli.ts +3 -3
- package/src/daemon/daemon.ts +1 -1
package/deploy.sh
CHANGED
package/docker/Caddyfile
CHANGED
package/docker-compose.prod.yml
CHANGED
|
@@ -41,10 +41,10 @@ services:
|
|
|
41
41
|
WEB_PORT: 3000
|
|
42
42
|
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
|
|
43
43
|
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
|
|
44
|
-
GOOGLE_REDIRECT_URI: https://app.
|
|
44
|
+
GOOGLE_REDIRECT_URI: https://app.withpolaris.ai/auth/google/callback
|
|
45
45
|
SLACK_CLIENT_ID: ${SLACK_CLIENT_ID}
|
|
46
46
|
SLACK_CLIENT_SECRET: ${SLACK_CLIENT_SECRET}
|
|
47
|
-
SLACK_REDIRECT_URI: https://app.
|
|
47
|
+
SLACK_REDIRECT_URI: https://app.withpolaris.ai/slack/callback
|
|
48
48
|
depends_on:
|
|
49
49
|
postgres:
|
|
50
50
|
condition: service_healthy
|
package/docs/deploy-hetzner.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Polaris runs entirely on localhost. We need a production deployment so the API, web dashboard, Slack bridge, and Postgres all run on a Hetzner Cloud VPS with proper HTTPS. The daemon and MCP client stay local on each developer's machine — they talk to the cloud API.
|
|
6
6
|
|
|
7
|
-
Domain: `
|
|
7
|
+
Domain: `withpolaris.ai` (subdomains: `api.withpolaris.ai`, `app.withpolaris.ai`)
|
|
8
8
|
|
|
9
9
|
## Architecture
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ Domain: `polaris.lightup.ai` (subdomains: `api.polaris.lightup.ai`, `app.polaris
|
|
|
25
25
|
| File | Purpose |
|
|
26
26
|
|------|---------|
|
|
27
27
|
| `docker/Dockerfile` | Single Bun image, each service overrides CMD |
|
|
28
|
-
| `docker/Caddyfile` | Reverse proxy: app.
|
|
28
|
+
| `docker/Caddyfile` | Reverse proxy: app.withpolaris.ai → web:3000, api.withpolaris.ai → api:4321 |
|
|
29
29
|
| `docker/bridge-entrypoint.sh` | Wait for Postgres, discover org ID, start bridge |
|
|
30
30
|
| `src/bridge-discover-org.ts` | Tiny script: query DB for Slack-connected org ID |
|
|
31
31
|
| `docker-compose.prod.yml` | Full production orchestration |
|
|
@@ -58,11 +58,11 @@ CMD ["bun", "run", "src/service/server.ts"]
|
|
|
58
58
|
## Caddy Config
|
|
59
59
|
|
|
60
60
|
```
|
|
61
|
-
app.
|
|
61
|
+
app.withpolaris.ai {
|
|
62
62
|
reverse_proxy web:3000
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
api.
|
|
65
|
+
api.withpolaris.ai {
|
|
66
66
|
reverse_proxy api:4321
|
|
67
67
|
}
|
|
68
68
|
```
|
|
@@ -84,16 +84,16 @@ Caddy auto-provisions Let's Encrypt certs. WebSocket upgrades pass through trans
|
|
|
84
84
|
3. Create deploy user, add SSH key
|
|
85
85
|
4. Clone repo to `/opt/polaris`
|
|
86
86
|
5. Create `.env` with production secrets
|
|
87
|
-
6. DNS: A records for `api.
|
|
88
|
-
7. Update Google OAuth + Slack redirect URIs to `https://app.
|
|
87
|
+
6. DNS: A records for `api.withpolaris.ai` and `app.withpolaris.ai` → VPS IP
|
|
88
|
+
7. Update Google OAuth + Slack redirect URIs to `https://app.withpolaris.ai/...`
|
|
89
89
|
8. Firewall: allow 80, 443, 22 only
|
|
90
90
|
9. `docker compose -f docker-compose.prod.yml up -d`
|
|
91
91
|
|
|
92
92
|
## Verification
|
|
93
93
|
|
|
94
94
|
1. `docker compose -f docker-compose.prod.yml up --build` locally — all services start
|
|
95
|
-
2. `curl https://api.
|
|
96
|
-
3. `https://app.
|
|
95
|
+
2. `curl https://api.withpolaris.ai/status` returns `{"ok":true}`
|
|
96
|
+
3. `https://app.withpolaris.ai` loads login page
|
|
97
97
|
4. Google SSO login works end-to-end
|
|
98
98
|
5. Slack bridge connects and posts to channels
|
|
99
|
-
6. Local daemon connects to `https://api.
|
|
99
|
+
6. Local daemon connects to `https://api.withpolaris.ai` and events flow
|
package/package.json
CHANGED
package/src/cli/cli.ts
CHANGED
|
@@ -22,7 +22,7 @@ const CONFIG_FILE = join(POLARIS_DIR, "config.json");
|
|
|
22
22
|
const LEGACY_CREDENTIALS_FILE = join(POLARIS_DIR, "credentials.json");
|
|
23
23
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
24
24
|
|
|
25
|
-
const DEFAULT_APP_URL = "https://app.
|
|
25
|
+
const DEFAULT_APP_URL = "https://app.withpolaris.ai";
|
|
26
26
|
const LOCAL_APP_URL = "http://localhost:3000";
|
|
27
27
|
|
|
28
28
|
// --- Config ---
|
|
@@ -88,8 +88,8 @@ function deriveProfileName(appUrl: string): string {
|
|
|
88
88
|
if (appUrl.includes("localhost") || appUrl.includes("127.0.0.1")) return "local";
|
|
89
89
|
try {
|
|
90
90
|
const host = new URL(appUrl).hostname;
|
|
91
|
-
// app.
|
|
92
|
-
if (host.includes("
|
|
91
|
+
// app.withpolaris.ai → prod
|
|
92
|
+
if (host.includes("withpolaris.ai")) return "prod";
|
|
93
93
|
// strip common prefixes
|
|
94
94
|
return host.replace(/^app\./, "").replace(/\./g, "-");
|
|
95
95
|
} catch {
|
package/src/daemon/daemon.ts
CHANGED
|
@@ -53,7 +53,7 @@ function getServiceUrl(): string {
|
|
|
53
53
|
return cachedConfig.profiles[cachedConfig.active].api;
|
|
54
54
|
}
|
|
55
55
|
// 3. Fallback
|
|
56
|
-
return "https://api.
|
|
56
|
+
return "https://api.withpolaris.ai";
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
let cachedToken: string | null | undefined = undefined;
|