Every framework env var now requires the TINA4_ prefix. The legacy un-prefixed names (DATABASE_URL, SECRET, SMTP_HOST, HOST_NAME, etc.) no longer work. Setting them at startup makes the framework refuse to boot with a list of renames.
Run tina4 env --migrate to rewrite your existing .env automatically, or rename manually using the table below. The runtime guard prints the same mapping if it detects legacy names.
Conventional names stay un-prefixed:PORT, HOST, NODE_ENV, RACK_ENV, RUBY_ENV, ENVIRONMENT. These are runtime/PaaS conventions, not framework config.
Tina4 Ruby is configured through environment variables, read from .env at the project root. Every variable has a sensible default, so most projects set three or four values and leave the rest alone.
This chapter lists every variable the Ruby framework reads, grouped by subsystem. Start with the minimum-config examples at the end, then come back here when you need to tune something specific.
Connection URL. Scheme selects the driver: sqlite, postgres, mysql, firebird.
TINA4_DATABASE_USERNAME
(empty)
Overrides the username embedded in TINA4_DATABASE_URL.
TINA4_DATABASE_PASSWORD
(empty)
Overrides the password embedded in TINA4_DATABASE_URL.
TINA4_DATABASE_FIREBIRD_PATH
(empty)
Overrides the database path/alias parsed from TINA4_DATABASE_URL for Firebird. Useful for Windows backslash paths and split-config setups.
TINA4_DATABASE_URL
(empty)
Legacy alias for TINA4_DATABASE_URL.
TINA4_AUTOCOMMIT
true
Standalone writes auto-commit on their own connection (durable + visible across a pool); explicit transactions stay atomic. Set false for strict manual-commit mode.
TINA4_DB_CACHE
false
Enables in-memory query-result caching for read queries.
TINA4_DB_CACHE_TTL
30
Query cache TTL in seconds when TINA4_DB_CACHE=true.
TINA4_ORM_PLURAL_TABLE_NAMES
true
When true, the ORM pluralises class names into table names (User → users). Set false to keep them singular.
TINA4_DB_POOL
0
Connection pool size used by Tina4::Database.new(url, pool:) when the caller doesn't pass pool: explicitly. 0 disables pooling.
Response cache backend. Options: memory, file, redis, valkey, memcached, mongodb, database. Falls back to file if the configured backend is unreachable.
TINA4_CACHE_DIR
data/cache
Cache directory for the file backend.
TINA4_CACHE_TTL
0
Default cache TTL in seconds (0 disables caching for the global instance; the singleton helper uses 60 when unset).
TINA4_CACHE_MAX_ENTRIES
1000
Maximum cache entries before eviction.
TINA4_CACHE_URL
redis://localhost:6379
Connection URL for remote cache backends. For database, falls back to TINA4_DATABASE_URL when unset.
TINA4_CACHE_USERNAME
(none)
Username for the cache backend. May also be embedded in TINA4_CACHE_URL.
TINA4_CACHE_PASSWORD
(none)
Password for the cache backend. May also be embedded in TINA4_CACHE_URL (e.g. redis://:pass@host). Memcached is unauthenticated.
IMAP authentication username. Mapped from legacy IMAP_USER.
TINA4_MAIL_IMAP_PASSWORD
(inherits SMTP password)
IMAP authentication password. Mapped from legacy IMAP_PASS.
TINA4_MAIL_IMAP_ENCRYPTION
tls
IMAP connection encryption. Accepts tls, starttls, or none.
TINA4_MAILBOX_DIR
data/mailbox
Dev mailbox directory. All outbound mail lands here when TINA4_DEBUG=true.
TINA4_MAIL_HOST, TINA4_MAIL_PORT, TINA4_MAIL_USERNAME, TINA4_MAIL_PASSWORD, TINA4_MAIL_FROM, TINA4_MAIL_FROM_NAME, TINA4_MAIL_IMAP_HOST, TINA4_MAIL_IMAP_PORT are accepted as legacy aliases. New projects should use the TINA4_MAIL_* names.
Console log level. Options: [TINA4_LOG_ALL], [TINA4_LOG_DEBUG], [TINA4_LOG_INFO], [TINA4_LOG_WARNING], [TINA4_LOG_ERROR], [TINA4_LOG_NONE]. Also accepts plain DEBUG, INFO, ERROR, etc.
TINA4_LOG_MAX_SIZE
10
Per-file log size limit in megabytes. Rotated when exceeded.
TINA4_LOG_KEEP
5
Number of rotated log files to retain.
Logs default to stdout. Set TINA4_LOG_OUTPUT=file plus TINA4_LOG_FILE=app.log to write to disk; Ruby's stdlib Logger rotates at TINA4_LOG_ROTATE_SIZE bytes and keeps TINA4_LOG_ROTATE_KEEP backups natively.
Variable
Default
Description
TINA4_LOG_FILE
(empty = stdout only)
Explicit log file path. Absolute, or resolved relative to TINA4_LOG_DIR.
TINA4_LOG_DIR
logs
Directory used when TINA4_LOG_FILE is set without an absolute path.
TINA4_LOG_FORMAT
text
Log line format. Accepts text or json.
TINA4_LOG_OUTPUT
stdout
Output sink. Accepts stdout, file, or both.
TINA4_LOG_CRITICAL
false
When true, gates the new critical level and raises on log write failures instead of swallowing them.
TINA4_LOG_ROTATE_SIZE
10485760
Per-file rotation threshold in bytes (10 MB). 0 disables rotation. Handled natively by stdlib Logger.new(path, shift_age, shift_size).
The dashboard AI chat and the framework's RAG-based code search both default to a local qwen2.5-coder model served via Ollama. Nothing leaves your machine unless you point TINA4_AI_URL at a remote endpoint.
Variable
Default
Description
TINA4_AI_URL
http://localhost:11434
OpenAI-compatible HTTP endpoint for the chat/completion model (Ollama by default).
TINA4_AI_MODEL
qwen2.5-coder
Model identifier the endpoint should serve.
TINA4_RAG_URL
(inherits TINA4_AI_URL)
Embedding endpoint for the framework RAG index.
TINA4_AI_MODEL
nomic-embed-text
Embedding model used to index the framework and src/.
TINA4_MCP_REMOTE
false
Allow the MCP server to bind on non-localhost interfaces. Never enable in production.
TINA4_NO_AI_PORT
false
Disables the MCP port listener in dev mode.
TINA4_OVERRIDE_CLIENT
false
Allow the framework to start without the Rust CLI (tina4 serve). Used in Docker images and CI runners; bypasses SCSS compilation, the file watcher, and live reload.
The tables above list every knob. These are the setups most apps actually reach for, ready to paste into .env. Each block sets only what the feature needs. Everything else keeps its default.
One URL points the ORM, the migrations, and the query builder at Postgres. Credentials can ride in the URL or sit in their own variables, which keeps the password out of your shell history.
The response cache and the cross-request query cache both speak to the same Redis. Point them at it and every instance shares one cache, invalidated globally on every write.
The file backend is fine for a single server. Move sessions to Redis the moment you run more than one instance, so a user stays logged in whichever instance answers the next request.
The dashboard AI talks to a local model through Ollama by default, so nothing leaves your machine. Point the URLs elsewhere only when you run the hosted Tina4 AI services.
Debug mode lights up the Swagger UI, the dev dashboard, detailed error pages, and live reload. Keeping the browser flag on stops a new tab opening every time you save a file.
No TINA4_DEBUG. It defaults to false, which is what you want in production. Set a real secret, a real database, locked-down CORS origins, HSTS, and SMTP credentials if you send email. Everything else has a production-appropriate default.