Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix: guide SSH installs to token login (#5318)
Multica Eve220fa58264be
diff --git a/.env.example b/.env.exampleindex 50bcd9f3e5..f8645877f7 100644--- a/.env.example+++ b/.env.example@@ -204,7 +204,7 @@ LOCAL_UPLOAD_DIR=./data/uploads# Security# Comma-separated list of allowed origins for CORS and WebSocket connections.# Defaults to localhost dev origins when unset.-# Example: CORS_ALLOWED_ORIGINS=https://app.multica.ai,https://staging.multica.ai+# Example: CORS_ALLOWED_ORIGINS=https://multica.ai,https://staging.multica.aiCORS_ALLOWED_ORIGINS=# ==================== Rate limiting (optional Redis) ====================diff --git a/CLI_INSTALL.md b/CLI_INSTALL.mdindex 03a967f3c1..6978c576a2 100644--- a/CLI_INSTALL.md+++ b/CLI_INSTALL.md@@ -140,7 +140,7 @@ multica auth statusExpected output should show the authenticated user and server URL.**If login fails:**-- If no browser is available (headless environment), the user can generate a Personal Access Token at `https://app.multica.ai/settings` and run: `multica login --token <mul_...>` (use `--token=` with an empty value to be prompted interactively).+- If no browser is available (headless environment), the user can generate a Personal Access Token at `https://multica.ai/settings?tab=tokens` and run: `multica login --token <mul_...>` (use `--token=` with an empty value to be prompted interactively).- If the server URL needs to be customized: `multica config set server_url <url>` before logging in.---diff --git a/apps/docs/content/docs/environment-variables.ja.mdx b/apps/docs/content/docs/environment-variables.ja.mdxindex 837fd667b6..56f59782a0 100644--- a/apps/docs/content/docs/environment-variables.ja.mdx+++ b/apps/docs/content/docs/environment-variables.ja.mdx@@ -199,12 +199,12 @@ S3 の前段に CloudFront を置く場合、3 つの変数が適用されます| 変数 | デフォルト | 説明 ||---|---|---|-| `FRONTEND_ORIGIN` | 空 | フロントエンドアドレス。招待メールのリンク、CORS 許可リスト、cookie ドメインはすべてこの値から派生します。設定しない場合、招待メールのリンクはホスト型ドメイン `https://app.multica.ai` にフォールバックします — セルフホストはこれを明示的に設定する必要があります |+| `FRONTEND_ORIGIN` | 空 | フロントエンドアドレス。招待メールのリンク、CORS 許可リスト、cookie ドメインはすべてこの値から派生します。設定しない場合、招待メールのリンクはホスト型ドメイン `https://multica.ai` にフォールバックします — セルフホストはこれを明示的に設定する必要があります || `CORS_ALLOWED_ORIGINS` | 空 | 追加で許可する CORS origin(カンマ区切り) || `ALLOWED_ORIGINS` | 空 | WebSocket 専用の origin 許可リスト(カンマ区切り)。設定しない場合、フォールバック順序は `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` です |<Callout type="warning">-**`FRONTEND_ORIGIN` を設定しないと 2 つの静かな失敗が発生します**: (1) 招待メールのリンクが `https://app.multica.ai`(ホスト型ドメイン)を指し、クリックしてもユーザーがセルフホストインスタンスに戻ってこない。(2) WebSocket の Origin チェックが `localhost:3000 / 5173 / 5174` にフォールバックするため、プロダクションデプロイのすべての WebSocket 接続が拒否され、フロントエンドが「リアルタイム更新を受け取れない」ように見える。+**`FRONTEND_ORIGIN` を設定しないと 2 つの静かな失敗が発生します**: (1) 招待メールのリンクが `https://multica.ai`(ホスト型ドメイン)を指し、クリックしてもユーザーがセルフホストインスタンスに戻ってこない。(2) WebSocket の Origin チェックが `localhost:3000 / 5173 / 5174` にフォールバックするため、プロダクションデプロイのすべての WebSocket 接続が拒否され、フロントエンドが「リアルタイム更新を受け取れない」ように見える。</Callout>## GitHub 連携diff --git a/apps/docs/content/docs/environment-variables.ko.mdx b/apps/docs/content/docs/environment-variables.ko.mdxindex aecca0ff84..67427f31e8 100644--- a/apps/docs/content/docs/environment-variables.ko.mdx+++ b/apps/docs/content/docs/environment-variables.ko.mdx@@ -199,12 +199,12 @@ S3 앞에 CloudFront를 두는 경우 세 가지 변수가 적용됩니다: `CLO| 변수 | 기본값 | 설명 ||---|---|---|-| `FRONTEND_ORIGIN` | 비어 있음 | 프론트엔드 주소. 초대 이메일 링크, CORS 허용 목록, cookie 도메인이 모두 이 값에서 파생됩니다. 설정하지 않으면 초대 이메일 링크는 호스팅 도메인 `https://app.multica.ai`로 폴백합니다 — 자체 호스팅은 이를 명시적으로 설정해야 합니다 |+| `FRONTEND_ORIGIN` | 비어 있음 | 프론트엔드 주소. 초대 이메일 링크, CORS 허용 목록, cookie 도메인이 모두 이 값에서 파생됩니다. 설정하지 않으면 초대 이메일 링크는 호스팅 도메인 `https://multica.ai`로 폴백합니다 — 자체 호스팅은 이를 명시적으로 설정해야 합니다 || `CORS_ALLOWED_ORIGINS` | 비어 있음 | 추가로 허용할 CORS origin (쉼표로 구분) || `ALLOWED_ORIGINS` | 비어 있음 | WebSocket 전용 origin 허용 목록 (쉼표로 구분); 설정하지 않으면 폴백 순서는 `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174`입니다 |<Callout type="warning">-**`FRONTEND_ORIGIN`을 설정하지 않으면 두 가지 조용한 실패가 발생합니다**: (1) 초대 이메일 링크가 `https://app.multica.ai`(호스팅 도메인)를 가리켜, 클릭해도 사용자가 자체 호스팅 인스턴스로 돌아오지 않습니다; (2) WebSocket Origin 검사가 `localhost:3000 / 5173 / 5174`로 폴백하여, 프로덕션 배포의 모든 WebSocket 연결이 거부되고 프론트엔드가 "실시간 업데이트를 받지 못하는" 것처럼 보입니다.+**`FRONTEND_ORIGIN`을 설정하지 않으면 두 가지 조용한 실패가 발생합니다**: (1) 초대 이메일 링크가 `https://multica.ai`(호스팅 도메인)를 가리켜, 클릭해도 사용자가 자체 호스팅 인스턴스로 돌아오지 않습니다; (2) WebSocket Origin 검사가 `localhost:3000 / 5173 / 5174`로 폴백하여, 프로덕션 배포의 모든 WebSocket 연결이 거부되고 프론트엔드가 "실시간 업데이트를 받지 못하는" 것처럼 보입니다.</Callout>## GitHub 연동diff --git a/apps/docs/content/docs/environment-variables.mdx b/apps/docs/content/docs/environment-variables.mdxindex a29dd9526a..527c7fdc50 100644--- a/apps/docs/content/docs/environment-variables.mdx+++ b/apps/docs/content/docs/environment-variables.mdx@@ -199,14 +199,14 @@ These set a **fleet-wide default** layer of CLI flags for a backend — a conven| Variable | Default | Description ||---|---|---|-| `FRONTEND_ORIGIN` | empty | Frontend address. Invite email links, the CORS allowlist, and the cookie domain are all derived from this. When unset, invite email links fall back to the hosted domain `https://app.multica.ai` — self-host must set this explicitly |+| `FRONTEND_ORIGIN` | empty | Frontend address. Invite email links, the CORS allowlist, and the cookie domain are all derived from this. When unset, invite email links fall back to the hosted domain `https://multica.ai` — self-host must set this explicitly || `MULTICA_APP_URL` | empty | Frontend URL for CLI login flow. Also used by the web UI to show self-host daemon setup commands with your app domain; for same-origin deployments this is also used as daemon `server_url` when `MULTICA_PUBLIC_URL` is unset || `MULTICA_PUBLIC_URL` | empty | Public API URL, without trailing slash. Used for autopilot webhook URLs and by the web UI as the daemon `server_url` || `CORS_ALLOWED_ORIGINS` | empty | Additional allowed CORS origins (comma-separated) || `ALLOWED_ORIGINS` | empty | WebSocket-specific origin allowlist (comma-separated); when unset, fallback order is `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` |<Callout type="warning">-**Leaving `FRONTEND_ORIGIN` unset creates two silent failures**: (1) invite email links point at `https://app.multica.ai` (the hosted domain), and clicking them doesn't bring users back to your self-hosted instance; (2) WebSocket Origin checks fall back to `localhost:3000 / 5173 / 5174`, so every WebSocket connection in a production deployment is rejected and the frontend appears to "lose real-time updates."+**Leaving `FRONTEND_ORIGIN` unset creates two silent failures**: (1) invite email links point at `https://multica.ai` (the hosted domain), and clicking them doesn't bring users back to your self-hosted instance; (2) WebSocket Origin checks fall back to `localhost:3000 / 5173 / 5174`, so every WebSocket connection in a production deployment is rejected and the frontend appears to "lose real-time updates."</Callout>## GitHub integrationdiff --git a/apps/docs/content/docs/environment-variables.zh.mdx b/apps/docs/content/docs/environment-variables.zh.mdxindex 76214b0e80..3a58a67e45 100644--- a/apps/docs/content/docs/environment-variables.zh.mdx+++ b/apps/docs/content/docs/environment-variables.zh.mdx@@ -202,14 +202,14 @@ API 返回的 `download_url` 在未配置 CloudFront 签名时会指向 `GET /ap| 环境变量 | 默认值 | 说明 ||---|---|---|-| `FRONTEND_ORIGIN` | 空 | 前端地址。邀请邮件里的链接、CORS 白名单、cookie domain 都从这里推导。邮件链接在不设时会 fallback 到托管版域名 `https://app.multica.ai`——self-host 必须显式填 |+| `FRONTEND_ORIGIN` | 空 | 前端地址。邀请邮件里的链接、CORS 白名单、cookie domain 都从这里推导。邮件链接在不设时会 fallback 到托管版域名 `https://multica.ai`——self-host 必须显式填 || `MULTICA_APP_URL` | 空 | CLI 登录流程使用的前端 URL。Web UI 也会用它显示带你自己 app domain 的 self-host 守护进程 setup 命令;同源部署中,如果 `MULTICA_PUBLIC_URL` 未设置,它也会作为守护进程的 `server_url` || `MULTICA_PUBLIC_URL` | 空 | 公开 API URL,不带结尾 slash。用于 autopilot webhook URL,也会被 Web UI 用作守护进程的 `server_url` || `CORS_ALLOWED_ORIGINS` | 空 | 额外的 CORS 允许来源(逗号分隔)|| `ALLOWED_ORIGINS` | 空 | WebSocket 专用的 origin 白名单(逗号分隔);不设就按 `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` 顺序回落 |<Callout type="warning">-**`FRONTEND_ORIGIN` 不设就有两个静默失败**:(1)邀请邮件里的链接指向 `https://app.multica.ai`(托管版的域名),用户点了跳不回你的 self-host 实例;(2)WebSocket 连接的 Origin 校验回落到 `localhost:3000 / 5173 / 5174`,生产部署的 WebSocket 全部被拒,前端看起来「实时更新不工作」。+**`FRONTEND_ORIGIN` 不设就有两个静默失败**:(1)邀请邮件里的链接指向 `https://multica.ai`(托管版的域名),用户点了跳不回你的 self-host 实例;(2)WebSocket 连接的 Origin 校验回落到 `localhost:3000 / 5173 / 5174`,生产部署的 WebSocket 全部被拒,前端看起来「实时更新不工作」。</Callout>## GitHub 集成diff --git a/apps/web/app/auth/callback/page.tsx b/apps/web/app/auth/callback/page.tsxindex 4d3c2d3c1d..4b863a9ffb 100644--- a/apps/web/app/auth/callback/page.tsx+++ b/apps/web/app/auth/callback/page.tsx@@ -108,7 +108,7 @@ function CallbackContent() {// 2. Un-onboarded users may have pending invitations on their// email even when no `next=` was carried (came from a fresh- // login on app.multica.ai instead of clicking the email link,+ // login on multica.ai instead of clicking the email link,// or `state` was lost across the round-trip). Look them up by// email and route to the batch /invitations page if any.// Already-onboarded users skip this lookup — their new invitesdiff --git a/scripts/install.sh b/scripts/install.shindex 905a2f3ee5..54d87a3100 100755--- a/scripts/install.sh+++ b/scripts/install.sh@@ -41,6 +41,25 @@ fail() { printf "${BOLD}${RED}✗ %s${RESET}\n" "$*" >&2; exit 1; }command_exists() { command -v "$1" >/dev/null 2>&1; }+running_in_ssh_session() {+ [ -n "${SSH_CONNECTION:-}" ] || [ -n "${SSH_CLIENT:-}" ] || [ -n "${SSH_TTY:-}" ]+}++print_remote_server_token_hint() {+ if ! running_in_ssh_session; then+ return+ fi++ printf " ${BOLD}Looks like a remote/SSH session.${RESET} Browser login may not be able to call back to this machine's localhost.\n"+ printf " Token login is usually simpler here:\n"+ printf " 1. On your local computer, open ${CYAN}https://multica.ai/settings?tab=tokens${RESET}\n"+ printf " and create a token under ${BOLD}Settings > API Tokens${RESET}.\n"+ printf " 2. On this server, run:\n"+ printf " ${CYAN}multica login --token <YOUR_TOKEN>${RESET}\n"+ printf " ${CYAN}multica daemon start${RESET}\n"+ printf "\n"+}+env_file_value() {local file="$1"local key="$2"@@ -426,6 +445,7 @@ run_default() {printf " ${CYAN}multica setup${RESET} # Connect to Multica Cloud (multica.ai)\n"printf " ${CYAN}multica setup self-host${RESET} # Connect to a self-hosted server\n"printf "\n"+ print_remote_server_token_hintprintf " ${BOLD}Self-hosting?${RESET} Install the server first:\n"printf " curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash -s -- --with-server\n"printf "\n"diff --git a/scripts/install.test.sh b/scripts/install.test.shindex 439b036ca3..da68b4a8c1 100644--- a/scripts/install.test.sh+++ b/scripts/install.test.sh@@ -130,6 +130,114 @@ STUB_run_installer "$tmp"}+test_remote_ssh_install_prints_token_login_hint() {+ local tmp+ tmp="$(mktemp -d)"+ trap 'rm -rf "$tmp"' RETURN++ _setup_sandbox "$tmp"+ cat >"$tmp/stub-bin/brew" <<'STUB'+#!/usr/bin/env bash+case "${1:-}" in+ tap)+ exit 0+ ;;+ install)+ echo "simulated brew install failure" >&2+ exit 42+ ;;+ list)+ exit 1+ ;;+ *)+ exit 0+ ;;+esac+STUB+ chmod +x "$tmp/stub-bin/brew"++ (+ export SSH_CONNECTION="192.0.2.10 54321 198.51.100.20 22"+ _run_installer "$tmp"+ )++ if ! grep -q "Looks like a remote/SSH session" "$tmp/install.out"; then+ echo "expected remote/SSH token-login hint in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if ! grep -q "https://multica.ai/settings?tab=tokens" "$tmp/install.out"; then+ echo "expected direct API Tokens settings URL in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if ! grep -q "Settings > API Tokens" "$tmp/install.out"; then+ echo "expected API Tokens tab name in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if ! grep -q "multica login --token <YOUR_TOKEN>" "$tmp/install.out"; then+ echo "expected token login command in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if grep -q "multica config set server_url" "$tmp/install.out"; then+ echo "did not expect default cloud server config command in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if grep -q "multica config set app_url" "$tmp/install.out"; then+ echo "did not expect default cloud app config command in installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+}++test_local_install_does_not_print_token_login_hint() {+ local tmp+ tmp="$(mktemp -d)"+ trap 'rm -rf "$tmp"' RETURN++ _setup_sandbox "$tmp"+ cat >"$tmp/stub-bin/brew" <<'STUB'+#!/usr/bin/env bash+case "${1:-}" in+ tap)+ exit 0+ ;;+ install)+ echo "simulated brew install failure" >&2+ exit 42+ ;;+ list)+ exit 1+ ;;+ *)+ exit 0+ ;;+esac+STUB+ chmod +x "$tmp/stub-bin/brew"++ (+ unset SSH_CONNECTION SSH_CLIENT SSH_TTY+ _run_installer "$tmp"+ )++ if grep -q "Looks like a remote/SSH session" "$tmp/install.out"; then+ echo "did not expect remote/SSH token-login hint in local installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+ if grep -q "multica login --token <YOUR_TOKEN>" "$tmp/install.out"; then+ echo "did not expect token login command in local installer output" >&2+ cat "$tmp/install.out" >&2 || true+ return 1+ fi+}+test_brew_install_failure_falls_back_to_release_binarytest_brew_tap_failure_falls_back_to_release_binary+test_remote_ssh_install_prints_token_login_hint+test_local_install_does_not_print_token_login_hintecho "install.sh tests passed"diff --git a/server/cmd/multica/cmd_agent.go b/server/cmd/multica/cmd_agent.goindex 84688ae3cb..6052dd7b2d 100644--- a/server/cmd/multica/cmd_agent.go+++ b/server/cmd/multica/cmd_agent.go@@ -281,7 +281,12 @@ func newAPIClient(cmd *cobra.Command) (*cli.APIClient, error) {return client, nil}-func resolveServerURL(cmd *cobra.Command) string {+const (+ defaultCloudServerURL = "https://api.multica.ai"+ defaultCloudAppURL = "https://multica.ai"+)++func tryResolveServerURL(cmd *cobra.Command) string {val := cli.FlagOrEnv(cmd, "server-url", "MULTICA_SERVER_URL", "")if val != "" {return normalizeAPIBaseURL(val)@@ -291,11 +296,25 @@ func resolveServerURL(cmd *cobra.Command) string {if err == nil && cfg.ServerURL != "" {return normalizeAPIBaseURL(cfg.ServerURL)}+ return ""+}++func resolveServerURL(cmd *cobra.Command) string {+ if val := tryResolveServerURL(cmd); val != "" {+ return val+ }fmt.Fprintln(os.Stderr, "No server configured. Run 'multica setup' first.")os.Exit(1)return "" // unreachable}+func resolveLoginTokenServerURL(cmd *cobra.Command) string {+ if val := tryResolveServerURL(cmd); val != "" {+ return val+ }+ return defaultCloudServerURL+}+func normalizeAPIBaseURL(raw string) string {normalized, err := daemon.NormalizeServerBaseURL(raw)if err == nil {diff --git a/server/cmd/multica/cmd_auth.go b/server/cmd/multica/cmd_auth.goindex 913bb7a3de..e930089d06 100644--- a/server/cmd/multica/cmd_auth.go+++ b/server/cmd/multica/cmd_auth.go@@ -430,7 +430,7 @@ func runAuthLoginToken(cmd *cobra.Command, providedToken string) error {return err}- serverURL := resolveServerURL(cmd)+ serverURL := resolveLoginTokenServerURL(cmd)client := cli.NewAPIClient(serverURL, "", token)ctx, cancel := cli.APIContext(context.Background())@@ -449,6 +449,9 @@ func runAuthLoginToken(cmd *cobra.Command, providedToken string) error {cfg.WorkspaceID = ""cfg.Token = tokencfg.ServerURL = serverURL+ if cfg.AppURL == "" && serverURL == defaultCloudServerURL {+ cfg.AppURL = defaultCloudAppURL+ }if err := cli.SaveCLIConfigForProfile(cfg, profile); err != nil {return fmt.Errorf("failed to save config: %w", err)}diff --git a/server/cmd/multica/cmd_login_test.go b/server/cmd/multica/cmd_login_test.goindex 1eb73def0f..fe4bcb002a 100644--- a/server/cmd/multica/cmd_login_test.go+++ b/server/cmd/multica/cmd_login_test.go@@ -19,6 +19,27 @@ func newLoginTestCmd() *cobra.Command {return cmd}+func TestResolveLoginTokenServerURLDefaultsToCloud(t *testing.T) {+ t.Setenv("HOME", t.TempDir())+ t.Setenv("MULTICA_SERVER_URL", "")++ if got := resolveLoginTokenServerURL(newLoginTestCmd()); got != defaultCloudServerURL {+ t.Fatalf("resolveLoginTokenServerURL() = %q, want %q", got, defaultCloudServerURL)+ }+}++func TestResolveLoginTokenServerURLPrefersConfiguredServer(t *testing.T) {+ t.Setenv("HOME", t.TempDir())+ t.Setenv("MULTICA_SERVER_URL", "")+ if err := cli.SaveCLIConfig(cli.CLIConfig{ServerURL: "https://api.example.test/"}); err != nil {+ t.Fatalf("SaveCLIConfig: %v", err)+ }++ if got := resolveLoginTokenServerURL(newLoginTestCmd()); got != "https://api.example.test" {+ t.Fatalf("resolveLoginTokenServerURL() = %q, want configured server", got)+ }+}+func TestRunLoginTokenAutoWatchesDiscoveredWorkspaces(t *testing.T) {t.Setenv("HOME", t.TempDir())t.Setenv("MULTICA_TOKEN", "")diff --git a/server/cmd/multica/cmd_setup.go b/server/cmd/multica/cmd_setup.goindex 3b347cd226..33907bfd40 100644--- a/server/cmd/multica/cmd_setup.go+++ b/server/cmd/multica/cmd_setup.go@@ -142,8 +142,8 @@ func runSetupCloud(cmd *cobra.Command, args []string) error {profile := resolveProfile(cmd)cfg := cli.CLIConfig{- ServerURL: "https://api.multica.ai",- AppURL: "https://multica.ai",+ ServerURL: defaultCloudServerURL,+ AppURL: defaultCloudAppURL,}ok, err := confirmOverwrite(profile, cfg.ServerURL, cfg.AppURL)diff --git a/server/internal/cli/config_test.go b/server/internal/cli/config_test.goindex b16a2b7435..6caf3e5823 100644--- a/server/internal/cli/config_test.go+++ b/server/internal/cli/config_test.go@@ -24,7 +24,7 @@ func TestCLIConfig_BackwardCompat_OldFileLoadsWithNilBackends(t *testing.T) {}historical := `{"server_url": "https://api.multica.ai",- "app_url": "https://app.multica.ai",+ "app_url": "https://multica.ai","workspace_id": "ws-123","token": "mul_abcdef"}`@@ -177,7 +177,7 @@ func TestCLIConfig_ProfileCommandOverrides_RoundTrip(t *testing.T) {original := CLIConfig{ServerURL: "https://api.multica.ai",- AppURL: "https://app.multica.ai",+ AppURL: "https://multica.ai",WorkspaceID: "ws-123",Token: "mul_xyz",Backends: &BackendOverrides{diff --git a/server/internal/handler/config.go b/server/internal/handler/config.goindex 267ae2d65f..157dcdc53e 100644--- a/server/internal/handler/config.go+++ b/server/internal/handler/config.go@@ -106,8 +106,8 @@ func normalizePublicURL(raw string) string {}// isOfficialCloudDaemonConfig reports whether this deployment is the official-// Multica Cloud, identified by its frontend host alone (multica.ai /-// app.multica.ai). The daemon setup for the managed cloud is always+// Multica Cloud, identified by its frontend host alone (multica.ai). The+// daemon setup for the managed cloud is always// `multica setup` (which hardcodes api.multica.ai), so the per-deployment URLs// must be omitted from /api/config even when MULTICA_PUBLIC_URL is unset or// misconfigured. Previously this also required serverURL==api.multica.ai, so a@@ -115,7 +115,7 @@ func normalizePublicURL(raw string) string {// `setup self-host --server-url https://multica.ai` command — pointing the// daemon's backend at the frontend (no /health, no WebSocket proxy).func isOfficialCloudDaemonConfig(appURL string) bool {- return urlHostEquals(appURL, "multica.ai") || urlHostEquals(appURL, "app.multica.ai")+ return urlHostEquals(appURL, "multica.ai")}func urlHostEquals(raw, want string) bool {diff --git a/server/internal/handler/config_test.go b/server/internal/handler/config_test.goindex eb3a650aae..d6ef7f1e16 100644--- a/server/internal/handler/config_test.go+++ b/server/internal/handler/config_test.go@@ -210,11 +210,11 @@ func TestGetConfigOmitsCloudDaemonSetupWithoutPublicURL(t *testing.T) {}}-// TestGetConfigOmitsCloudDaemonSetupForAppSubdomain covers the app.multica.ai-// frontend variant of the official cloud.-func TestGetConfigOmitsCloudDaemonSetupForAppSubdomain(t *testing.T) {+// TestGetConfigOmitsCloudDaemonSetupForConfiguredAppURL covers the official+// cloud frontend when it is configured through MULTICA_APP_URL.+func TestGetConfigOmitsCloudDaemonSetupForConfiguredAppURL(t *testing.T) {t.Setenv("MULTICA_PUBLIC_URL", "")- t.Setenv("MULTICA_APP_URL", "https://app.multica.ai")+ t.Setenv("MULTICA_APP_URL", "https://multica.ai")t.Setenv("FRONTEND_ORIGIN", "")req := httptest.NewRequest(http.MethodGet, "/api/config", nil)diff --git a/server/internal/handler/handler.go b/server/internal/handler/handler.goindex 5120b578ef..b31e71d88d 100644--- a/server/internal/handler/handler.go+++ b/server/internal/handler/handler.go@@ -66,7 +66,7 @@ type Config struct {// the UI can hide every "Create workspace" affordance — see #3433.DisableWorkspaceCreation bool// PublicURL is the absolute base URL the API is reachable at from the- // public internet, with no trailing slash (e.g. "https://app.multica.ai").+ // public internet, with no trailing slash (e.g. "https://multica.ai").// Used only to build webhook_url responses for autopilot webhook triggers// — never for auth, routing, or workspace resolution. Empty when unset,// in which case clients fall back to webhook_path + their own origin.diff --git a/server/internal/handler/integrations_composio_test.go b/server/internal/handler/integrations_composio_test.goindex dc480557a8..56330b9471 100644--- a/server/internal/handler/integrations_composio_test.go+++ b/server/internal/handler/integrations_composio_test.go@@ -139,8 +139,8 @@ func newComposioTestHandler(t *testing.T, sdkFake composio.SDK, store composio.St.Helper()svc, err := composio.NewService(sdkFake, store, composio.Config{StateSecret: []byte("handler-test-secret"),- CallbackBaseURL: "https://app.multica.ai",- FrontendBaseURL: "https://app.multica.ai",+ CallbackBaseURL: "https://multica.ai",+ FrontendBaseURL: "https://multica.ai",})if err != nil {t.Fatalf("NewService: %v", err)diff --git a/server/internal/integrations/composio/service.go b/server/internal/integrations/composio/service.goindex cd4cfd4475..ca08be5a70 100644--- a/server/internal/integrations/composio/service.go+++ b/server/internal/integrations/composio/service.go@@ -97,11 +97,11 @@ type Config struct {// StateSecret signs the connect-state HMAC. Required (non-empty).StateSecret []byte// CallbackBaseURL is the absolute, public base URL of THIS API, with no- // trailing slash (e.g. "https://app.multica.ai"). The Composio callback+ // trailing slash (e.g. "https://multica.ai"). The Composio callback// URL is built as CallbackBaseURL + CallbackPath. Required.CallbackBaseURL string// FrontendBaseURL is the web app base used to build the post-callback- // browser redirect (e.g. "https://app.multica.ai"). May be empty, in which+ // browser redirect (e.g. "https://multica.ai"). May be empty, in which// case CallbackRedirect returns a site-relative path.FrontendBaseURL string// StateTTL overrides the default connect-state lifetime. Zero usesdiff --git a/server/internal/integrations/composio/service_test.go b/server/internal/integrations/composio/service_test.goindex bc98f07d19..4a3a503003 100644--- a/server/internal/integrations/composio/service_test.go+++ b/server/internal/integrations/composio/service_test.go@@ -206,8 +206,8 @@ func newTestService(t *testing.T, client SDK, store Store) *Service {t.Helper()svc, err := NewService(client, store, Config{StateSecret: testSecret,- CallbackBaseURL: "https://app.multica.ai",- FrontendBaseURL: "https://app.multica.ai",+ CallbackBaseURL: "https://multica.ai",+ FrontendBaseURL: "https://multica.ai",Now: func() time.Time { return time.Unix(1_700_000_000, 0) },})if err != nil {@@ -257,7 +257,7 @@ func TestBeginConnect_MappingAndState(t *testing.T) {}// callback URL carries the signed state and points at our callback pathcb := sdkFake.lastCreateLink.CallbackURL- if !strings.HasPrefix(cb, "https://app.multica.ai"+callbackPath+"?state=") {+ if !strings.HasPrefix(cb, "https://multica.ai"+callbackPath+"?state=") {t.Fatalf("callback url = %q", cb)}u, _ := url.Parse(cb)@@ -709,10 +709,10 @@ func TestCreateMCPSession_PinsConnectedAccounts(t *testing.T) {func TestCallbackRedirect(t *testing.T) {t.Parallel()svc := newTestService(t, &fakeSDK{}, newFakeStore())- if got := svc.CallbackRedirect("notion", true); got != "https://app.multica.ai/settings?tab=integrations&connected=notion" {+ if got := svc.CallbackRedirect("notion", true); got != "https://multica.ai/settings?tab=integrations&connected=notion" {t.Errorf("success redirect = %q", got)}- if got := svc.CallbackRedirect("notion", false); got != "https://app.multica.ai/settings?tab=integrations&error=composio_connect_failed" {+ if got := svc.CallbackRedirect("notion", false); got != "https://multica.ai/settings?tab=integrations&error=composio_connect_failed" {t.Errorf("failure redirect = %q", got)}}diff --git a/server/internal/realtime/hub_test.go b/server/internal/realtime/hub_test.goindex 10dcdc8131..fd58d0b4be 100644--- a/server/internal/realtime/hub_test.go+++ b/server/internal/realtime/hub_test.go@@ -394,7 +394,7 @@ func TestCheckOrigin(t *testing.T) {{"X-Forwarded-Host from trusted CIDR range matches origin", "internal.proxy", "https://multica.ai", "multica.ai", "10.5.6.7:5678", true},{"X-Forwarded-Host from trusted IPv6 proxy matches origin", "internal.proxy", "https://multica.ai", "multica.ai", "[::1]:5678", true},{"X-Forwarded-Host comma list uses first (client-facing) value", "internal.proxy", "https://multica.ai", "multica.ai, proxy.internal", "127.0.0.1:5678", true},- {"X-Forwarded-Host comma list ignores trailing values", "internal.proxy", "https://app.multica.ai", "proxy.internal, app.multica.ai", "127.0.0.1:5678", false},+ {"X-Forwarded-Host comma list ignores trailing values", "internal.proxy", "https://staging.multica.ai", "proxy.internal, staging.multica.ai", "127.0.0.1:5678", false},}for _, tc := range cases {diff --git a/server/internal/service/email.go b/server/internal/service/email.goindex 98f461aba9..7564611827 100644--- a/server/internal/service/email.go+++ b/server/internal/service/email.go@@ -354,7 +354,7 @@ func (s *EmailService) SendVerificationCode(to, code string) error {func (s *EmailService) SendInvitationEmail(to, inviterName, workspaceName, invitationID string) error {appURL := strings.TrimSpace(os.Getenv("FRONTEND_ORIGIN"))if appURL == "" {- appURL = "https://app.multica.ai"+ appURL = "https://multica.ai"}inviteURL := fmt.Sprintf("%s/invite/%s", appURL, invitationID)diff --git a/server/internal/service/email_test.go b/server/internal/service/email_test.goindex 2de2c8657f..4ebb392d93 100644--- a/server/internal/service/email_test.go+++ b/server/internal/service/email_test.go@@ -256,7 +256,7 @@ func TestBuildInvitationParams_EscapesHTMLInBody(t *testing.T) {tt.inviter,tt.workspace,- "https://app.multica.ai/invite/abc-123",+ "https://multica.ai/invite/abc-123",)for _, needle := range tt.wantInBody {if !strings.Contains(p.Html, needle) {@@ -278,7 +278,7 @@ func TestBuildInvitationParams_SubjectStripsControls(t *testing.T) {"Alice\r\n","Acme\t",- "https://app.multica.ai/invite/abc",+ "https://multica.ai/invite/abc",)if strings.ContainsAny(p.Subject, "\r\n\t") {t.Errorf("subject still contains control characters: %q", p.Subject)@@ -295,7 +295,7 @@ func TestBuildInvitationParams_SubjectNotHTMLEscaped(t *testing.T) {"Alice","Acme & Co.",- "https://app.multica.ai/invite/abc",+ "https://multica.ai/invite/abc",)if strings.Contains(p.Subject, "&") {t.Errorf("subject should not be HTML-escaped, got %q", p.Subject)@@ -312,7 +312,7 @@ func TestBuildInvitationParams_SubjectTruncated(t *testing.T) {"Alice",longWorkspace,- "https://app.multica.ai/invite/abc",+ "https://multica.ai/invite/abc",)// Template: "Alice invited you to <ws> on Multica"// ws is capped at maxSubjectFieldRunes; overall subject should also be bounded.@@ -331,7 +331,7 @@ func TestBuildInvitationParams_ToAndFromPassedThrough(t *testing.T) {"Alice","Acme",- "https://app.multica.ai/invite/abc",+ "https://multica.ai/invite/abc",)if p.From != "[email protected]" {t.Errorf("From = %q", p.From)@@ -339,7 +339,7 @@ func TestBuildInvitationParams_ToAndFromPassedThrough(t *testing.T) {if len(p.To) != 1 || p.To[0] != "[email protected]" {t.Errorf("To = %v", p.To)}- if !strings.Contains(p.Html, "https://app.multica.ai/invite/abc") {+ if !strings.Contains(p.Html, "https://multica.ai/invite/abc") {t.Errorf("body missing invite URL: %s", p.Html)}}diff --git a/server/pkg/composio/README.md b/server/pkg/composio/README.mdindex eda9cdc97a..c928bb9ea4 100644--- a/server/pkg/composio/README.md+++ b/server/pkg/composio/README.md@@ -44,7 +44,7 @@ if err != nil { /* ... */ }link, err := client.CreateLink(ctx, composio.CreateLinkRequest{AuthConfigID: "ac_xxxxxxxx", // configured in the Composio dashboardUserID: multicaUserID.String(), // your own user id- CallbackURL: "https://app.multica.ai/api/integrations/composio/callback",+ CallbackURL: "https://multica.ai/api/integrations/composio/callback",})// → http.Redirect(w, r, link.RedirectURL, http.StatusFound)@@ -58,7 +58,7 @@ accounts, err := client.ListConnectedAccounts(ctx, composio.ListConnectedAccountsession, err := client.CreateSession(ctx, composio.CreateSessionRequest{UserID: multicaUserID.String(),ManageConnections: &composio.ManageConnections{- CallbackURL: "https://app.multica.ai/settings/integrations",+ CallbackURL: "https://multica.ai/settings/integrations",},})mcpURL := session.MCP.URL