Skip to content

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 turna

In containers the configuration usually comes from Consul or Vault instead, see Wrap an Application.

Serving and routing ​

ExampleShows
Reverse ProxyAPI gateway with service, strip_prefix, cors, gzip, rate_limit, and access_log.
File ServerStatic files and SPA serving with the folder middleware.
TLSHTTPS entrypoints with self-signed certificates or automatic ACME (Let's Encrypt).
ViewSwagger documentation UI with the view middleware.
Single Page AppA frontend image served by Turna with a shared login, permission checks and a custom sign-in page.

Authentication ​

ExampleShows
AuthAn identity service with the PostgreSQL-backed auth middleware, session, login, logout and a permission endpoint for other applications.
Basic AuthProtecting paths with htpasswd-style basic_auth.
LoginBrowser sessions against an external OAuth2 provider with session, login, and role.
Kafka OAUTHBEARER With GCPgcp_token as a local token endpoint for Redpanda Console using X.509 workload identity federation.

Configuration and processes ​

ExampleShows
Wrap an ApplicationTurna 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 ValuesLoading values with loads and templating them into service environments.
PreprocessReplacing placeholders in files before serving them.

TCP and UDP ​

ExampleShows
SOCKS5 ProxyA SOCKS5 proxy on a TCP entrypoint with credentials and hostname mapping.
DNS ServerA DNS responder on a UDP entrypoint with static records and upstream fallback.