Skip to content

Commit 2da4339

Browse files
committed
Domain; version
1 parent 0b8723a commit 2da4339

File tree

9 files changed

+39
-13
lines changed

9 files changed

+39
-13
lines changed

AGENTS.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ catty new --api http://127.0.0.1:4815
6565
```
6666
┌─────────────┐ ┌─────────────────────┐ ┌──────────────────────┐
6767
│ catty │────▶│ catty-api │────▶│ Fly Machines API │
68-
│ (CLI) │ │ (catty-api.fly.dev) │ │ (internal) │
68+
│ (CLI) │ │ (api.catty.dev) │ │ (internal) │
6969
└──────┬──────┘ └─────────────────────┘ └──────────────────────┘
7070
7171
│ HTTP (upload) + WebSocket (terminal)
@@ -159,7 +159,7 @@ catty/
159159
**catty CLI:**
160160
| Variable | Description | Default |
161161
|----------|-------------|---------|
162-
| `CATTY_API_ADDR` | Override API URL | `https://catty-api.fly.dev` |
162+
| `CATTY_API_ADDR` | Override API URL | `https://api.catty.dev` |
163163
| `ANTHROPIC_API_KEY` | Passed to remote sessions | Required for Claude |
164164

165165
**catty-api (hosted on Fly):**
@@ -168,6 +168,7 @@ catty/
168168
| `FLY_API_TOKEN` | Fly.io API token | Required (set as secret) |
169169
| `FLY_MACHINES_API_BASE` | Machines API URL | `http://_api.internal:4280` |
170170
| `CATTY_EXEC_APP` | Fly app name for executor | `catty-exec` |
171+
| `CATTY_EXEC_HOST` | Hostname for executor WebSocket connections | `exec.catty.dev` |
171172
| `CATTY_API_ADDR` | API listen address | `0.0.0.0:8080` |
172173
| `ANTHROPIC_API_KEY` | Passed to machines for Claude | Required (set as secret) |
173174
| `WORKOS_CLIENT_ID` | WorkOS application client ID | Required (set as secret) |
@@ -517,7 +518,7 @@ Response:
517518
{
518519
"session_id": "uuid",
519520
"machine_id": "...",
520-
"connect_url": "wss://catty-exec.fly.dev/connect",
521+
"connect_url": "wss://exec.catty.dev/connect",
521522
"connect_token": "base64url",
522523
"headers": {
523524
"fly-force-instance-id": "..."
@@ -625,12 +626,12 @@ fly secrets list -a catty-api
625626

626627
## Roadmap
627628

628-
### Custom Domain
629-
Move to own domain (e.g., `api.catty.sh`) so no Fly URLs are exposed to users:
630-
- Register domain
631-
- Configure Fly custom domains for both `catty-api` and `catty-exec`
632-
- Update CLI default API URL
633-
- Update WebSocket connect URLs returned by API
629+
### Custom Domain
630+
Custom domains configured:
631+
- `api.catty.dev` - API server
632+
- `exec.catty.dev` - Executor WebSocket connections
633+
634+
CLI default updated to use `api.catty.dev`. WebSocket URLs use `CATTY_EXEC_HOST` env var.
634635

635636
### Usage Metering & Billing
636637
Track per-user token usage and implement billing:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Maximum upload size: 100MB
7474

7575
## Roadmap
7676

77-
- **Custom domain** - Move away from *.fly.dev URLs
77+
- ~~**Custom domain** - Move away from *.fly.dev URLs~~
7878
- **Usage metering & billing** - Track per-user token usage, free tier + subscription ($25/mo target)
7979
- **Multi-key support** - Pool of API keys for handling load spikes
8080
- **Database backend** - Persistent storage for users, sessions, and usage (Supabase)

catty

9.04 MB
Binary file not shown.

catty-api

9.73 MB
Binary file not shown.

cmd/catty/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ import (
99

1010
const (
1111
// DefaultAPIAddr is the default API server address
12-
DefaultAPIAddr = "https://catty-api.fly.dev"
12+
DefaultAPIAddr = "https://api.catty.dev"
1313
)
1414

15+
// Version is set at build time via -ldflags
16+
var Version = "dev"
17+
1518
var apiAddr string
1619

1720
func main() {
@@ -29,6 +32,7 @@ func main() {
2932
rootCmd.AddCommand(stopAllCmd)
3033
rootCmd.AddCommand(loginCmd)
3134
rootCmd.AddCommand(logoutCmd)
35+
rootCmd.AddCommand(versionCmd)
3236

3337
if err := rootCmd.Execute(); err != nil {
3438
fmt.Fprintln(os.Stderr, err)

cmd/catty/version.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var versionCmd = &cobra.Command{
10+
Use: "version",
11+
Short: "Print the version number",
12+
Run: func(cmd *cobra.Command, args []string) {
13+
fmt.Println(Version)
14+
},
15+
}

fly.api.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ primary_region = "iad"
1818
# Use Fly's internal Machines API when running on Fly
1919
FLY_MACHINES_API_BASE = "http://_api.internal:4280"
2020
CATTY_EXEC_APP = "catty-exec"
21+
CATTY_EXEC_HOST = "exec.catty.dev"
2122
CATTY_API_ADDR = "0.0.0.0:8080"
2223

2324
[http_service]

internal/api/handlers.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ func (h *Handlers) CreateSession(w http.ResponseWriter, r *http.Request) {
170170
}
171171

172172
// Build connect URL
173-
connectURL := fmt.Sprintf("wss://%s.fly.dev/connect", h.flyClient.AppName())
173+
// Use custom domain if set, otherwise fall back to fly.dev
174+
execHost := os.Getenv("CATTY_EXEC_HOST")
175+
if execHost == "" {
176+
execHost = fmt.Sprintf("%s.fly.dev", h.flyClient.AppName())
177+
}
178+
connectURL := fmt.Sprintf("wss://%s/connect", execHost)
174179

175180
// Save session
176181
session := &Session{

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@izalutski/catty",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Run Claude Code sessions remotely",
55
"keywords": [
66
"ai",

0 commit comments

Comments
 (0)