2026-09-27 15:58:44 +02:00
|
|
|
# Configuration for the production instance learn.halkyon.eu.
|
feat(assistant): Claude reads studysets through a connector on the instance
A Claude plan can't drive a chat inside another app, but Claude's apps
(every plan, the phone apps too) can add a remote MCP server as a custom
connector. The instance now is one (ADR 0006): Serverpod's web server
serves the MCP endpoint (/mcp, Streamable HTTP, JSON answers, no
sessions) with five read-only tools over the person's own synced rows
(their studysets, a studyset's cards and notes a page at a time, a
search across cards, a note, their progress), and the OAuth the
specification asks for: protected resource and authorization server
metadata, dynamic client registration, authorization code with PKCE
(S256 only), tokens bound to the resource, iss in the response, refresh
tokens that rotate. Caddy forwards these paths alone to the web server,
which production now runs on 8082.
People connect with a code from the app (Settings › Assistant › Connect
Claude): eight Crockford characters, valid for ten minutes and once,
typed on the authorization page, which names where it returns to, loads
nothing from elsewhere and may not be framed. Anonymous people can
connect too. Codes and tokens are kept only as SHA-256 hashes; an access
token lives an hour, a refresh token 30 days. The app lists what is
connected and disconnects it, which ends its tokens at once; deleting
the account deletes it; a daily job forgets what expired and clients
nobody connected within a week. InstanceInfo says where the connector is
(additive); the migration only adds server-only tables, so devices and
older apps are untouched.
The handlers take plain requests, so the integration tests drive the
whole flow (registration, the code, tokens, refresh, the tools, another
person's content, disconnecting, expiry, pruning, account deletion)
without a web server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-10 12:13:00 +02:00
|
|
|
# Caddy terminates TLS on 443 and forwards to the API server on 8080, and the
|
|
|
|
|
# assistant connector's paths to the web server on 8082; Insights doesn't run.
|
2026-09-16 19:24:59 +02:00
|
|
|
|
|
|
|
|
# Configuration for the main API server.
|
|
|
|
|
apiServer:
|
|
|
|
|
port: 8080
|
2026-09-27 15:58:44 +02:00
|
|
|
publicHost: learn.halkyon.eu
|
2026-09-16 19:24:59 +02:00
|
|
|
publicPort: 443
|
|
|
|
|
publicScheme: https
|
|
|
|
|
|
2026-09-27 15:58:44 +02:00
|
|
|
# No insightsServer: without this block Serverpod doesn't start Insights at all (it
|
|
|
|
|
# would otherwise listen on every interface). To use Insights later, add the block
|
|
|
|
|
# back (port 8081), set `serviceSecret` in the production passwords, and reach the
|
|
|
|
|
# port through an SSH tunnel, never through Caddy.
|
feat(assistant): Claude reads studysets through a connector on the instance
A Claude plan can't drive a chat inside another app, but Claude's apps
(every plan, the phone apps too) can add a remote MCP server as a custom
connector. The instance now is one (ADR 0006): Serverpod's web server
serves the MCP endpoint (/mcp, Streamable HTTP, JSON answers, no
sessions) with five read-only tools over the person's own synced rows
(their studysets, a studyset's cards and notes a page at a time, a
search across cards, a note, their progress), and the OAuth the
specification asks for: protected resource and authorization server
metadata, dynamic client registration, authorization code with PKCE
(S256 only), tokens bound to the resource, iss in the response, refresh
tokens that rotate. Caddy forwards these paths alone to the web server,
which production now runs on 8082.
People connect with a code from the app (Settings › Assistant › Connect
Claude): eight Crockford characters, valid for ten minutes and once,
typed on the authorization page, which names where it returns to, loads
nothing from elsewhere and may not be framed. Anonymous people can
connect too. Codes and tokens are kept only as SHA-256 hashes; an access
token lives an hour, a refresh token 30 days. The app lists what is
connected and disconnects it, which ends its tokens at once; deleting
the account deletes it; a daily job forgets what expired and clients
nobody connected within a week. InstanceInfo says where the connector is
(additive); the migration only adds server-only tables, so devices and
older apps are untouched.
The handlers take plain requests, so the integration tests drive the
whole flow (registration, the code, tokens, refresh, the tools, another
person's content, disconnecting, expiry, pruning, account deletion)
without a web server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-10 12:13:00 +02:00
|
|
|
|
|
|
|
|
# The web server serves only the assistant connector (ADR 0006): the MCP endpoint
|
|
|
|
|
# and its OAuth pages and metadata. Caddy forwards those paths alone to it
|
|
|
|
|
# (deploy/Caddyfile); everything else stays on the API server.
|
|
|
|
|
webServer:
|
|
|
|
|
port: 8082
|
|
|
|
|
publicHost: learn.halkyon.eu
|
|
|
|
|
publicPort: 443
|
|
|
|
|
publicScheme: https
|
2026-09-16 19:24:59 +02:00
|
|
|
|
feat(deploy): Docker Compose stack for the instance
Caddy, the Serverpod server and PostgreSQL 16 in deploy/. Only Caddy publishes ports; the server and Postgres are reachable only inside the Compose network (Docker bypasses ufw, and the server listens on every interface). Secrets come from deploy/.env as environment variables; there is no production passwords.yaml, and .dockerignore keeps local secrets out of the build context.
The server image builds on Serverpod's template with an Ubuntu 24.04 runtime: complete glibc incl. libgcc_s for the SQLite libraries Serverpod 4 bundles, CA certificates, a non-root user, and exec so SIGTERM reaches the server. The scaffold's dev-only docker-compose.yaml is removed.
Verified locally: image builds, all native libraries resolve, no passwords.yaml in the image, migrations apply at start, Caddy serves 200, port 8080 unreachable from the host, Postgres in UTC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-27 17:18:31 +02:00
|
|
|
# The database: the `postgres` service of deploy/compose.yaml, reachable only inside
|
|
|
|
|
# the Compose network (it publishes no port), so no TLS between server and database.
|
|
|
|
|
# The password comes from the environment (SERVERPOD_DATABASE_PASSWORD, set in
|
|
|
|
|
# deploy/.env); there is no production passwords.yaml.
|
2026-09-16 19:24:59 +02:00
|
|
|
database:
|
feat(deploy): Docker Compose stack for the instance
Caddy, the Serverpod server and PostgreSQL 16 in deploy/. Only Caddy publishes ports; the server and Postgres are reachable only inside the Compose network (Docker bypasses ufw, and the server listens on every interface). Secrets come from deploy/.env as environment variables; there is no production passwords.yaml, and .dockerignore keeps local secrets out of the build context.
The server image builds on Serverpod's template with an Ubuntu 24.04 runtime: complete glibc incl. libgcc_s for the SQLite libraries Serverpod 4 bundles, CA certificates, a non-root user, and exec so SIGTERM reaches the server. The scaffold's dev-only docker-compose.yaml is removed.
Verified locally: image builds, all native libraries resolve, no passwords.yaml in the image, migrations apply at start, Caddy serves 200, port 8080 unreachable from the host, Postgres in UTC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-27 17:18:31 +02:00
|
|
|
host: postgres
|
2026-09-16 19:24:59 +02:00
|
|
|
port: 5432
|
feat(deploy): Docker Compose stack for the instance
Caddy, the Serverpod server and PostgreSQL 16 in deploy/. Only Caddy publishes ports; the server and Postgres are reachable only inside the Compose network (Docker bypasses ufw, and the server listens on every interface). Secrets come from deploy/.env as environment variables; there is no production passwords.yaml, and .dockerignore keeps local secrets out of the build context.
The server image builds on Serverpod's template with an Ubuntu 24.04 runtime: complete glibc incl. libgcc_s for the SQLite libraries Serverpod 4 bundles, CA certificates, a non-root user, and exec so SIGTERM reaches the server. The scaffold's dev-only docker-compose.yaml is removed.
Verified locally: image builds, all native libraries resolve, no passwords.yaml in the image, migrations apply at start, Caddy serves 200, port 8080 unreachable from the host, Postgres in UTC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-27 17:18:31 +02:00
|
|
|
name: halkyon_learn
|
|
|
|
|
user: halkyon_learn
|
|
|
|
|
requireSsl: false
|
2026-09-16 19:24:59 +02:00
|
|
|
#isUnixSocket: true # defaults to false
|
|
|
|
|
#maxConnectionCount: 10 # Defaults to 10, a negative or null value removes the limit
|
|
|
|
|
|
|
|
|
|
# This is the setup for Redis. The default for the Google Cloud Engine Terraform
|
|
|
|
|
# configuration is to connect on a private IP address.
|
|
|
|
|
# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you
|
|
|
|
|
# connect on the public IP of the database e.g. redis.examplepod.com.
|
|
|
|
|
redis:
|
|
|
|
|
enabled: false
|
|
|
|
|
host: redis.private-production.examplepod.com
|
|
|
|
|
port: 6379
|
|
|
|
|
#user: # defaults to empty
|
|
|
|
|
#requireSsl: true # defaults to false
|
|
|
|
|
|
|
|
|
|
maxRequestSize: 524288 # The maximum size of requests allowed in bytes
|
|
|
|
|
|
|
|
|
|
sessionLogs:
|
2026-09-24 15:02:52 +02:00
|
|
|
consoleEnabled: true
|
|
|
|
|
persistentEnabled: false
|
2026-09-16 19:24:59 +02:00
|
|
|
# consoleLogFormat: json # Defaults to "json", options are "text" or "json"
|
|
|
|
|
|
|
|
|
|
# futureCallExecutionEnabled: true # Defaults to true
|
|
|
|
|
|
|
|
|
|
#futureCall:
|
|
|
|
|
# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit
|
|
|
|
|
# scanInterval: 5000 # Unit in milliseconds, defaults to 5000
|
|
|
|
|
|
|
|
|
|
# Recommended when serving web clients: keeps auth tokens in httpOnly
|
|
|
|
|
# cookies. Without this, web tokens live in JavaScript-readable storage,
|
|
|
|
|
# where any XSS can steal them. Web clients opt in with
|
|
|
|
|
# `client.cookieAuth = true`. Requires `allowedOrigins`; browsers from
|
|
|
|
|
# origins not in the list lose cross-origin access, including to public
|
|
|
|
|
# endpoints.
|
|
|
|
|
#authCookie:
|
|
|
|
|
# sameSite: lax # Defaults to "lax", options are "strict" or "none"
|
|
|
|
|
# #name: serverpod_auth # Defaults to "serverpod_auth"
|
|
|
|
|
# #refreshName: serverpod_auth_refresh # Defaults to "<name>_refresh"
|
|
|
|
|
# #domain: examplepod.com # Defaults to host-only; set to share across subdomains
|
|
|
|
|
# #path: / # Defaults to "/"
|
|
|
|
|
# #secure: true # Defaults to true; the cookie is only sent over https
|
|
|
|
|
#allowedOrigins:
|
|
|
|
|
# - https://app.examplepod.com # The origin serving your Flutter web app
|