Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
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
8 changes: 8 additions & 0 deletions clients/dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ the actual compiled native/WASM SDKs; no database or bucket is required. Ports
external platform-specific dependency. Build it for the target OS/architecture.
Do not run the standalone production server with Bun.

## Docker deployment

Core and the dashboard serve HTTP only; built-in TLS is not currently planned,
though it could be added later. Put them behind cloudflared or an HTTPS reverse
proxy with access control. **Do not expose the dashboard directly to the internet
on port 80.** See the [Docker Compose examples](../../docker/examples/README.md)
for internal networking, Caddy and Cloudflare Tunnel.

## Behavior and constraints

- SSR falls back to localized error states after five seconds without a core
Expand Down
6 changes: 6 additions & 0 deletions docker/examples/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{$DASHBOARD_HOST} {
basic_auth {
admin {$DASHBOARD_PASSWORD_HASH}
}
reverse_proxy dashboard:4321
}
104 changes: 104 additions & 0 deletions docker/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Dashboard behind a proxy

Condite core and the dashboard currently serve **plain HTTP only**. Built-in TLS
is not currently planned, though it could be added eventually. For deployments
in 2026, put Condite behind cloudflared or a reverse proxy that handles HTTPS.
**Exposing the dashboard directly to the internet on port 80 is a horrible idea:**
traffic is unencrypted, and every visitor can use the dashboard's configured API
key. HTTPS alone does not restrict who can use that key; protect the dashboard
with authentication or trusted private access.

These examples publish no core or dashboard ports. Docker DNS connects the
proxy to `dashboard:4321`, and the dashboard's server-side API proxy connects to
`core:8080` on an `internal: true` network. Only core and the ingress container
also join an outbound-capable network. Do not combine these files with
[`../compose.yaml`](../compose.yaml), which publishes development ports.

The request path is browser → HTTPS ingress → HTTP dashboard → HTTP core.
File uploads/downloads still go directly between the browser and S3 using signed
URLs. Keep browser-facing storage URLs HTTPS and configure bucket CORS for the
public dashboard origin; the ingress does not rewrite those URLs. See the
[dashboard README](../../clients/dashboard/README.md).

## Prepare

Run commands from the repository root. Configure `crates/condite-core/.env` from
its example, including real storage settings. Choose a hostname you control:

```sh
export DASHBOARD_HOST=dashboard.example.com
export DASHBOARD_ORIGIN="https://$DASHBOARD_HOST"
# Check CPU/RAM/disk first; this builds the Rust SDKs as well as the dashboard.
docker build -f docker/dashboard.Dockerfile \
--build-arg CARGO_BUILD_JOBS=1 \
--build-arg DASHBOARD_ORIGIN="$DASHBOARD_ORIGIN" \
-t condite-dashboard:local .

# Bootstrap core without publishing any ports.
docker compose -f docker/examples/compose.yaml run -d --name condite-bootstrap core
docker exec condite-bootstrap ctl apikey generate
# Save the generated key privately, then remove the bootstrap container.
docker stop condite-bootstrap
docker rm condite-bootstrap
read -rsp 'Dashboard API key: ' CONDITE_API_KEY; echo
export CONDITE_API_KEY
```

`DASHBOARD_ORIGIN` is a **build-time** host-validation setting. Setting it only at
runtime does not work; rebuild when changing the public origin. The published
image may have been built for a different origin, so these examples use a local
build. Keep keys and tunnel tokens out of Git. Back up the persistent core volume
before upgrading; startup applies database migrations.

## Caddy: HTTPS and password protection

Point the hostname's DNS at the server and allow inbound TCP 80/443 to **Caddy**.
Port 80 serves Caddy's HTTPS redirect/certificate handling, not the dashboard.
Generate a password hash interactively:

```sh
docker run --rm -it caddy:2 caddy hash-password
read -rp 'Caddy password hash: ' DASHBOARD_PASSWORD_HASH
export DASHBOARD_PASSWORD_HASH
docker compose -f docker/examples/compose.yaml \
-f docker/examples/compose.caddy.yaml up -d
```

Open `https://dashboard.example.com/en/` and sign in as `admin` with the password
you hashed. [Caddy automatically obtains and renews certificates](https://caddyserver.com/docs/automatic-https).
Its [basic_auth](https://caddyserver.com/docs/caddyfile/directives/basic_auth)
protects SSR pages and API requests. The [reverse proxy](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy)
preserves the public host and sets forwarded headers so dashboard write-origin
checks see the HTTPS origin. Do not cache SSR or authenticated API responses.

For an existing Docker reverse proxy, attach it to this stack's backend network
(or use a dedicated shared ingress network), target `http://dashboard:4321`,
preserve the public Host, and overwrite forwarded host/protocol headers with
trusted values. Keep core private and enforce authentication at the proxy.
No Docker socket mount or automatic container discovery is needed here.

## Cloudflare Tunnel: no inbound ports

As an alternative to Caddy, create a remotely managed
[Cloudflare Tunnel](https://developers.cloudflare.com/tunnel/get-started/).
**Before publishing it**, configure a Cloudflare Access self-hosted application
for the dashboard hostname with an allow policy limited to your users. A tunnel
alone does not authenticate visitors.

Set the tunnel's published application hostname to `dashboard.example.com` and
its service URL to `http://dashboard:4321`. Preserve the public HTTP Host header
(do not override it with the Docker service name). Use the same public HTTPS
origin that was compiled into the dashboard.

```sh
read -rsp 'Tunnel token: ' TUNNEL_TOKEN; echo
export TUNNEL_TOKEN
docker compose -f docker/examples/compose.yaml \
-f docker/examples/compose.cloudflared.yaml up -d
```

Open `https://dashboard.example.com/en/` through Access. This variant publishes
**no host ports**; cloudflared connects outbound to Cloudflare, which terminates
public HTTPS. HTTP stays on the private Docker hop to the dashboard. The tunnel
and Caddy variants are alternatives; run only one. Pin ingress images to tested
versions or digests for reproducible production deployments.
19 changes: 19 additions & 0 deletions docker/examples/compose.caddy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
caddy:
image: caddy:2
environment:
DASHBOARD_HOST: ${DASHBOARD_HOST:?Set the public dashboard hostname}
DASHBOARD_PASSWORD_HASH: ${DASHBOARD_PASSWORD_HASH:?Set a Caddy password hash}
ports:
- '80:80'
- '443:443'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
networks: [backend, egress]
depends_on: [dashboard]
restart: unless-stopped
volumes:
caddy-data:
caddy-config:
9 changes: 9 additions & 0 deletions docker/examples/compose.cloudflared.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel --no-autoupdate run
environment:
TUNNEL_TOKEN: ${TUNNEL_TOKEN:?Set the Cloudflare Tunnel token}
networks: [backend, egress]
depends_on: [dashboard]
restart: unless-stopped
28 changes: 28 additions & 0 deletions docker/examples/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use with exactly one ingress example; see README.md.
services:
core:
image: ghcr.io/hexvale-labs/condite/core:${CORE_VERSION:-0.1.0}
env_file: ../../crates/condite-core/.env
environment:
SQL_CONN_URL: turso:/app/data/condite.db
volumes:
- core-data:/app/data
networks: [backend, egress]
restart: unless-stopped
stop_grace_period: 30s
dashboard:
# Build this image for DASHBOARD_ORIGIN first (see README.md).
image: condite-dashboard:local
environment:
CONDITE_API_URL: http://core:8080
CONDITE_API_KEY: ${CONDITE_API_KEY:?Set a dashboard API key}
networks: [backend]
depends_on: [core]
restart: unless-stopped
networks:
backend:
internal: true
# Core needs outbound access to S3; ingress needs certificates or tunnel access.
egress: {}
volumes:
core-data:
4 changes: 4 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ Local builds: `docker build -f docker/core.Dockerfile -t condite-core .` and
`docker build -f docker/dashboard.Dockerfile --build-arg DASHBOARD_ORIGIN=https://dashboard.example -t condite-dashboard .`.
Run `bash scripts/release/smoke-images.sh COMPONENT IMAGE` before using them.

See the [dashboard ingress examples](../docker/examples/README.md) for private
Docker networking with Caddy or Cloudflare Tunnel. Core and dashboard have no
built-in TLS; do not expose their HTTP listeners directly to the internet.

## Vencord assets

Publishing a GitHub release for a matching umbrella or Vencord SemVer tag builds
Expand Down