Skip to content

About

Secure self-hosted Orca relay. Closed enrollment, zero upstream patches, Docker ready. | 安全轻量的 Orca 自托管中继,封闭式设备配对,零上游补丁,Docker 开箱即用。

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Orca Relay Next

English | 简体中文

A private, self-hosted relay for Orca—your devices, your infrastructure.

Build MIT License Docker Upstream

Want to connect your Orca desktop and mobile devices through your own server without leaving a relay open to the internet? Orca Relay Next wraps the official Orca Relay with a lightweight Auth adapter and an enrollment Guard: only your pre-approved desktops can connect, and once your phones are paired, you can lock the door to all new sign-ins—with zero upstream patches and no external database.

  • Locked by default: Only pre-approved desktop keys are accepted. Open a temporary pairing window when adding a device, then lock it back down (or let it expire automatically).
  • Official Stable releases: Automatically tracks the latest non-prerelease Orca release—never nightly or RC builds.
  • Simple Docker Compose stack: Three lightweight, multi-arch images (amd64 / arm64) backed by a single SQLite volume.
  • Zero-patch architecture: The official Relay runs unmodified, so upstream upgrades stay decoupled from the security layer.

Images and releases

Recommended: deploy the pre-built images from GitHub Container Registry (GHCR). Public images for Linux amd64 and arm64 are ready to use without local builds or a registry login.

Component GHCR Image
Auth ghcr.io/ahang39/orca-relay-next/auth:latest
Relay ghcr.io/ahang39/orca-relay-next/relay:latest
Guard ghcr.io/ahang39/orca-relay-next/guard:latest
  • Tagging: All three components share identical tags. latest tracks the newest passing Stable build, while project release tags (v*) publish fixed project versions.
  • Recommended for production: Pin all three services to the same immutable build tag (orca-vX.Y.Z-<source revision>-r<run ID>-<attempt>). The three latest tags are promoted sequentially rather than transactionally, so pinning avoids version drift during rollouts.
  • Browse published packages and builds. Follow Quick start to deploy the images together.

Quick start

Download the ready-to-use Docker deployment bundle from GitHub Releases. No source checkout is required.

Prerequisites:

  • Docker Compose v2
  • Python 3 and OpenSSL (for one-time initialization)
  • Two HTTPS domains routed via your reverse proxy (one for Auth, one for Relay/Guard)

1. Initialize configuration

Download the Docker deployment ZIP and extract it. The bundle pins all three images to the same tested build.

cd orca-relay-next-docker
python3 init.py

Alternatively, clone the repository and use the docker/ directory (cd docker). It contains the canonical Compose file, template and initialization script.

Open the generated .env file and set:

  • AUTH_ORIGIN — your HTTPS domain for Auth (e.g., https://auth.example.com)
  • RELAY_ORIGIN — your HTTPS domain for Guard/Relay (e.g., https://relay.example.com)
  • AUTH_ALLOWED_RELAY_HOSTS — comma-separated list of approved desktop host IDs

Tip

How to get a desktop host ID: Start Orca on your desktop, locate orca-e2ee-keypair.json in its active profile directory, download the same init.py on that desktop if needed, and run locally:

python3 init.py host-id /path/to/orca-e2ee-keypair.json

Copy only the printed host ID to your server—never upload or copy the keypair file itself. Your login password is automatically generated and saved as AUTH_PASSWORD in .env.

2. Pull images and start services

docker compose pull
docker compose up -d --wait

Next, point your HTTPS reverse proxy to the local loopback ports:

  • Auth (AUTH_ORIGIN) → 127.0.0.1:18970
  • Guard (RELAY_ORIGIN) → 127.0.0.1:18971

The official Relay stays strictly inside the Docker network and is never exposed directly. Once the proxy is ready, configure your desktop's cloud and relay environment variables—see the deployment guide for copyable macOS/Windows commands and keypair locations.

3. Pair devices, then lock it down

New sign-ins and device pairings are blocked by default. To pair your devices, temporarily open an enrollment window:

  1. Generate a deadline (for example, 1 hour from now in UTC):

    python3 -c 'from datetime import datetime, timezone, timedelta; print((datetime.now(timezone.utc)+timedelta(hours=1)).strftime("%Y-%m-%dT%H:%M:%SZ"))'
  2. Open the window: paste the timestamp into AUTH_ENROLLMENT_UNTIL in .env and reload Auth and Guard:

    docker compose up -d --no-deps --wait auth guard
  3. Pair your devices: sign in to Orca with AUTH_PASSWORD, pair your mobile devices, and verify they connect.

  4. Lock enrollment ("Turtle mode"): clear AUTH_ENROLLMENT_UNTIL= in .env and run the same docker compose up -d --no-deps --wait auth guard command (or wait for the deadline to expire automatically).

    • What stays working: Already-paired devices continue to reconnect and renew credentials normally.
    • What gets blocked: New sign-ins, invitations, and new device credential installations are rejected.
    • Note: Recreating Guard briefly interrupts active connections—confirm your paired devices reconnect.
  5. Verify the lock against your Auth domain:

    curl -i https://auth.example.com/v1/desktop/auth/authorize
    # Expected: HTTP 403, {"error":"enrollment_locked"}

For upgrades, verification, and troubleshooting, see operations and troubleshooting. Never expose the internal Relay port directly.

Architecture

flowchart TD
    D[Orca Desktop] --> P[HTTPS reverse proxy]
    M[Orca Mobile] --> P
    P --> A[Auth / approved host keys]
    P --> G[Guard / enrollment policy]
    G --> R[Official Orca Relay]
    R --> S[(SQLite)]
    R -. JWKS .-> A
Loading
  • Auth (127.0.0.1:18970): Enforces the desktop host allowlist, issues tokens, and exposes JWKS to the Relay.
  • Guard (127.0.0.1:18971): Shares the same enrollment deadline with Auth and gates incoming traffic before it reaches the Relay.
  • Official Orca Relay (internal only): Runs completely unmodified inside the Compose network, handling host proofs, device credentials, and end-to-end encrypted transport over a single SQLite volume.

Security and limitations

This project is designed for single-owner self-hosting, not as a multi-tenant authentication platform. Please review SECURITY.md for the full threat model, and keep these boundaries in mind:

  • Existing stateless refresh credentials are not immediately revoked upon logout.
  • Enrollment locking does not protect against an already-compromised trusted device or volumetric denial-of-service (DDoS) attacks.

Development

On every release run, GitHub Actions resolves the latest official Orca Stable release and pins its exact commit across the entire pipeline. It verifies source blobs, runs Auth/Guard unit tests and a live upstream Relay integration test, and publishes multi-arch images (linux/amd64, linux/arm64) to GHCR.

Run the local test suite and full integration verification:

git clone https://github.com/ahang39/orca-relay-next.git
cd orca-relay-next
node --test auth/auth.test.mjs
go -C guard test -race ./...
go -C guard vet ./...
python3 scripts/build.py
python3 tests/test_integration.py
  • relay/upstream.json pins the reproducible local Stable snapshot; run python3 relay/fetch.py --latest to refresh it (CI always resolves a fresh official Stable snapshot).
  • The integration test runner spins up isolated temporary secrets, ports, and a disposable SQLite volume, cleaning everything up afterward.
  • Real desktop-to-mobile pairing should still be tested manually whenever the upstream Orca protocol changes.

License

MIT. This is an unofficial community project and is not affiliated with Orca or Stably.

Upstream license notices (Orca MIT and Gorilla WebSocket BSD) are preserved in LICENSES. The official upstream Dockerfile is used as provided, with a final distribution stage that adds only its license notice.

About

Secure self-hosted Orca relay. Closed enrollment, zero upstream patches, Docker ready. | 安全轻量的 Orca 自托管中继,封闭式设备配对,零上游补丁,Docker 开箱即用。

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages