Examples
Complete, runnable configurations for common Turna setups. Most examples are a single turna.yaml; Turna reads it from the current directory, or from the file in CONFIG_FILE:
sh
turna
CONFIG_FILE=examples/auth.yaml turnaIn containers the configuration usually comes from Consul or Vault instead, see Wrap an Application.
Serving and routing
| Example | Shows |
|---|---|
| Reverse Proxy | API gateway with service, strip_prefix, cors, gzip, rate_limit, and access_log. |
| File Server | Static files and SPA serving with the folder middleware. |
| TLS | HTTPS entrypoints with self-signed certificates or automatic ACME (Let's Encrypt). |
| View | Swagger documentation UI with the view middleware. |
| Single Page App | A frontend image served by Turna with a shared login, permission checks and a custom sign-in page. |
Authentication
| Example | Shows |
|---|---|
| Auth | An identity service with the PostgreSQL-backed auth middleware, session, login, logout and a permission endpoint for other applications. |
| Basic Auth | Protecting paths with htpasswd-style basic_auth. |
| Login | Browser sessions against an external OAuth2 provider with session, login, and role. |
| Kafka OAUTHBEARER With GCP | gcp_token as a local token endpoint for Redpanda Console using X.509 workload identity federation. |
Configuration and processes
| Example | Shows |
|---|---|
| Wrap an Application | Turna as the entrypoint of an existing image: config from Consul or Vault, the application started with its environment, files written before start, and a proxy in front. |
| Environment Values | Loading values with loads and templating them into service environments. |
| Preprocess | Replacing placeholders in files before serving them. |
TCP and UDP
| Example | Shows |
|---|---|
| SOCKS5 Proxy | A SOCKS5 proxy on a TCP entrypoint with credentials and hostname mapping. |
| DNS Server | A DNS responder on a UDP entrypoint with static records and upstream fallback. |