Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
sudo sed -i '1i host all all 127.0.0.1/32 trust\nhost all all ::1/128 trust' "$HBA"
sudo -u postgres psql -qc 'SELECT pg_reload_conf()'
createdb -h localhost copper_cloud_test_core
createdb -h localhost copper_cloud_test_canvas
createdb -h localhost copper_cloud_test_migrate
psql -h localhost -d copper_cloud_test_core -tAc 'SELECT version()'
# Build the portal first so the portal tests run against the real export.
- uses: oven-sh/setup-bun@v2
Expand Down
50 changes: 43 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
[workspace]
resolver = "2"
members = ["crates/core", "crates/canvas", "crates/copper-cloud"]
members = [
"crates/core",
"crates/canvas-link",
"crates/canvas-migrate",
"crates/copper-cloud",
]

[workspace.package]
version = "0.10.0"
version = "0.11.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/copper-browser/copper-cloud"
Expand All @@ -28,7 +33,8 @@ must_use_candidate = "allow"
# which keeps x86_64 + aarch64 cross builds simple.
[workspace.dependencies]
copper-cloud-core = { path = "crates/core" }
copper-cloud-canvas = { path = "crates/canvas" }
copper-cloud-canvas-link = { path = "crates/canvas-link" }
copper-cloud-canvas-migrate = { path = "crates/canvas-migrate" }

anyhow = "1"
thiserror = "2"
Expand Down Expand Up @@ -92,8 +98,12 @@ rust-embed = { version = "8", features = ["interpolate-folder-path", "mime-guess
# backend) and Stored are the only methods accepted.
zip = { version = "8", default-features = false, features = ["deflate-flate2-zlib-rs"] }

# HTTP client: SSO provider calls (core) and the test suites
# HTTP client: SSO provider calls (core), the canvas link (HTTP + WebSocket client to a
# linked Canvas Cloud; rustls `ring`, no aws-lc) and the test suites
reqwest = { version = "0.12", default-features = false, features = ["json", "stream"] }
tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "handshake", "rustls-tls-webpki-roots"] }
url = "2"
webpki-roots = "1"

[profile.release]
lto = "thin"
Expand Down
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Copper Cloud

Self-hosted sync + collaborative canvas server for the [Copper](https://github.com/copper-browser/Copper)
Self-hosted sync server for the [Copper](https://github.com/copper-browser/Copper)
browser. One Rust daemon (`copper-cloud`), one Postgres. Install it on any Linux VM with one
command, or deploy to AWS with Terraform (`deploy/aws`).

What it syncs between your Coppers: spaces + pinned tabs, settings (safe subset), bookmarks,
history (append-only; people can delete theirs), each device's open tabs, and shared canvases
(live Yjs rooms). It can also hand every signed-in Copper the instance's AI keys (Jev + LLM
router), set once by the admin, so nobody pastes keys by hand.
history (append-only; people can delete theirs) and each device's open tabs. It can also hand
every signed-in Copper the instance's AI keys (Jev + LLM router), set once by the admin, so
nobody pastes keys by hand.

Shared canvases (live Yjs rooms, chat, mentions, invites, share links) are served by a linked
[Canvas Cloud](https://github.com/copper-browser/canvas-cloud) (since 0.11.0): copper-cloud
proxies the unchanged canvas API to it as the signed-in user, so Coppers need no update. See
[docs/canvas-link.md](docs/canvas-link.md); upgrading a 0.10.x (or older) instance with canvases:
[docs/canvas-migration.md](docs/canvas-migration.md).

People can join with **company single sign-on** (Google Workspace or any OpenID Connect
provider): share one `https://HOST/start` page, they install Copper and click *Continue with
Expand All @@ -24,7 +30,7 @@ curl -fsSL https://raw.githubusercontent.com/copper-browser/copper-cloud/main/in
or from a release tarball:

```sh
tar xzf copper-cloud-0.10.0-linux-x86_64.tar.gz && sudo ./install.sh
tar xzf copper-cloud-0.11.0-linux-x86_64.tar.gz && sudo ./install.sh
```

The installer sets up Postgres (unless you pass `DATABASE_URL`), a `copper-cloud` system user,
Expand Down Expand Up @@ -52,6 +58,17 @@ link code for everyone) with `COPPER_CLOUD_ACCESS_MODE=open`. Re-running the ins
in place and keeps keys, certificate, admins and data. Details: [docs/install.md](docs/install.md),
[docs/operations.md](docs/operations.md#admin-portal).

For canvases, install a [Canvas Cloud](https://github.com/copper-browser/canvas-cloud) (the
small setup: same host, `127.0.0.1:8480`, TLS off), create an app key there with
`canvas-cloud apps create --name "Copper Cloud" --allow-import`, and link it:

```sh
sudo copper-cloud canvas link --url http://127.0.0.1:8480 --key-file /root/canvas-app.key
```

Until then canvas requests answer `503 canvas_unavailable` and `doctor` warns. Details:
[docs/canvas-link.md](docs/canvas-link.md#linking).

AWS (EC2 + RDS + Elastic IP; link code and admin password in SSM): see
[deploy/aws/README.md](deploy/aws/README.md).

Expand Down Expand Up @@ -88,7 +105,7 @@ on `127.0.0.1:9464`. Every config key can be overridden with `COPPER_CLOUD_<KEY>
| `copper-cloud [serve]` | run the server (applies migrations first; `--no-migrate` to skip) |
| `copper-cloud migrate` | apply database migrations |
| `copper-cloud link-code [--sso]` | print the link code (`--sso`: the single sign-on join link, no secret) |
| `copper-cloud doctor` | check config, database, migrations, TLS, listener |
| `copper-cloud doctor` | check config, database, migrations, TLS, listener, SSO, Canvas Cloud link |
| `copper-cloud healthcheck --wait 60` | wait for `/healthz` (pinned TLS) |
| `copper-cloud tls-init [--force] [--name N]` | create the self-signed certificate |
| `copper-cloud init-config --write PATH` | write a config with fresh keys |
Expand All @@ -101,6 +118,9 @@ on `127.0.0.1:9464`. Every config key can be overridden with `COPPER_CLOUD_<KEY>
| `copper-cloud admin history delete --user EMAIL\|UUID [--since T] [--until T] [--device ID] [--dry-run]` | delete (or count) a user's synced history wholesale, by time window/device only (never by content) |
| `copper-cloud intelligence set\|show\|clear\|enable\|disable` | cloud-wide Jev + LLM router keys every signed-in Copper receives (keys from files/stdin, shown masked), plus the org-wide agent round budget (`--agent-max-turns`, `clear --agent`) |
| `copper-cloud addons list\|slots\|upload FILE --slot SLOT\|enable ID --everyone\|--people a@x,b@y\|disable ID\|settings ID --json '{…}'\|delete ID --yes` | addons: web bundles that replace a slot of the Copper window (e.g. the agent sidebar), handed to everyone or listed people ([docs/addons.md](docs/addons.md)); also `copper-cloud admin addons …` |
| `copper-cloud canvas link --url URL --key-file F [--fingerprint HEX] [--no-sync]` | link a Canvas Cloud (app key from a file/stdin, never argv) and provision every user |
| `copper-cloud canvas unlink\|status\|sync-users [--prune]` | remove the link / show it and test it / push every user now (`--prune`: also delete Canvas Cloud users that no longer exist here) |
| `copper-cloud canvas migrate [--dry-run] [--only ID]… [--replace] [--concurrency N] [--json]` | copy legacy canvases into the linked Canvas Cloud, verified by digest ([docs/canvas-migration.md](docs/canvas-migration.md)) |
| `copper-cloud version` | version |

All commands take `--config PATH` (default `/etc/copper-cloud/copper-cloud.toml`, env
Expand All @@ -112,28 +132,35 @@ All commands take `--config PATH` (default `/etc/copper-cloud/copper-cloud.toml`
- [HTTP API](docs/api.md) — every endpoint with requests and responses
- [Admin API](docs/admin-api.md) — the admin portal's `/admin/api/*` contract
- [Addons](docs/addons.md) — slot addons: manifest, bundles, who gets what, API, CLI, security
- [Canvas](docs/canvas.md) — canvases REST + WebSocket rooms
- [Canvas link](docs/canvas-link.md) — how canvases are served by a linked Canvas Cloud:
proxy, events, provisioning, linking, security
- [Canvas migration](docs/canvas-migration.md) — moving legacy canvases to Canvas Cloud
(runbook, rollback)
- [Canvas](docs/canvas.md) · [Canvas protocol](docs/canvas-protocol.md) — pointers to the
canvas API, now documented in Canvas Cloud
- [Security](docs/security.md) — threat model, access keys, pairing, admin sessions,
encryption at rest, TLS pinning
- [Install](docs/install.md) — VM one-liner, manual install, configuration reference
- [Operations](docs/operations.md) — doctor, logs, metrics, backups, upgrades
- [Onboarding a team](docs/onboarding.md) — single sign-on first, link codes, people, keeping links valid
- [Single sign-on + agent integrations](docs/sso.md) — Google / OIDC setup, `/start`, agent pairing
- [v0.10.0 release notes](docs/v0.10.0.md) · [v0.9.0](docs/v0.9.0.md) · [v0.8.1](docs/v0.8.1.md) · [v0.8.0](docs/v0.8.0.md) · [v0.7.0](docs/v0.7.0.md) · [v0.6.0](docs/v0.6.0.md) · [v0.5.0](docs/v0.5.0.md) · [v0.4.0](docs/v0.4.0.md) · [v0.3.0](docs/v0.3.0.md)
- [v0.11.0 release notes](docs/v0.11.0.md) · [v0.10.0](docs/v0.10.0.md) · [v0.9.0](docs/v0.9.0.md) · [v0.8.1](docs/v0.8.1.md) · [v0.8.0](docs/v0.8.0.md) · [v0.7.0](docs/v0.7.0.md) · [v0.6.0](docs/v0.6.0.md) · [v0.5.0](docs/v0.5.0.md) · [v0.4.0](docs/v0.4.0.md) · [v0.3.0](docs/v0.3.0.md)

## Development

```sh
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
createdb copper_cloud_test_core && createdb copper_cloud_test_canvas # once
createdb copper_cloud_test_core # once
createdb copper_cloud_test_migrate # once, for crates/canvas-migrate
cargo test --workspace
```

Tests use a real native Postgres (`COPPER_CLOUD_TEST_DATABASE_URL`, default
`postgres://localhost:5432/copper_cloud_test_core`; the canvas crate's tests use
`COPPER_CLOUD_TEST_CANVAS_DATABASE_URL`, default `…/copper_cloud_test_canvas`); never a
container. Releases: push a
`postgres://localhost:5432/copper_cloud_test_core`; the migration tests use
`COPPER_CLOUD_TEST_MIGRATE_DATABASE_URL`, default
`postgres://localhost:5432/copper_cloud_test_migrate`); never a
container. The canvas-link tests run against an in-process mock Canvas Cloud. Releases: push a
`vX.Y.Z` tag matching the crate version; CI builds `copper-cloud-X.Y.Z-linux-{x86_64,aarch64}.tar.gz`
(+ `.sha256`) and publishes the GitHub release.

Expand Down
19 changes: 10 additions & 9 deletions crates/canvas/Cargo.toml → crates/canvas-link/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "copper-cloud-canvas"
description = "Canvases REST API and Yjs WebSocket rooms for copper-cloud"
name = "copper-cloud-canvas-link"
description = "Canvas link for copper-cloud: proxies the canvas API to a linked Canvas Cloud, bridges its events and provisions users"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand All @@ -18,24 +18,25 @@ workspace = true
copper-cloud-core.workspace = true
anyhow.workspace = true
axum.workspace = true
base64.workspace = true
bytes.workspace = true
futures.workspace = true
governor.workspace = true
hex.workspace = true
metrics.workspace = true
reqwest = { workspace = true, features = ["rustls-tls-manual-roots"] }
rustls.workspace = true
serde.workspace = true
serde_json.workspace = true
sqlx.workspace = true
time.workspace = true
tokio.workspace = true
tokio-tungstenite.workspace = true
tracing.workspace = true
url = "2"
url.workspace = true
uuid.workspace = true
# yrs ≥ 0.18 ships the y-sync protocol (DefaultProtocol, Awareness, sync::Message) as
# `yrs::sync`; the standalone `y-sync` crate is frozen on yrs 0.17.
yrs = { version = "0.28", features = ["sync"] }
webpki-roots.workspace = true
zeroize.workspace = true

[dev-dependencies]
tokio-tungstenite = "0.29"
axum-server.workspace = true
tower.workspace = true
http-body-util.workspace = true
Loading
Loading