Skip to main content

Environment Variables

All Qaynaq settings can be configured via environment variables.

Runtime

VariableTypeDefaultDescription
ROLEstringcoordinatorNode role: coordinator or worker
GRPC_PORTuintgRPC server port (required)
HTTP_PORTuint8080HTTP port for web UI and REST API
DISCOVERY_URIstringlocalhost:50000Coordinator address for worker discovery
DEBUG_MODEboolfalseEnable debug logging

Security

VariableTypeDefaultDescription
SECRET_KEYstring32-byte encryption key, also used for signing JWT tokens

Authentication

VariableTypeDefaultDescription
AUTH_TYPEstringnoneAuthentication mode: none, basic, or oauth2
AUTH_BASIC_USERNAMEstringUsername for basic auth
AUTH_BASIC_PASSWORDstringPassword for basic auth
AUTH_OAUTH2_CLIENT_IDstringOAuth2 client ID
AUTH_OAUTH2_CLIENT_SECRETstringOAuth2 client secret
AUTH_OAUTH2_ISSUER_URLstringOIDC issuer URL (e.g. https://accounts.google.com, http://localhost:8090/realms/qaynaq). Qaynaq discovers the authorization, token, and userinfo endpoints from <issuer>/.well-known/openid-configuration at startup.
AUTH_OAUTH2_SCOPESstringopenid,email,profileComma-separated OAuth2 scopes
AUTH_OAUTH2_ALLOWED_USERSstringComma-separated allowed email addresses
AUTH_OAUTH2_ALLOWED_DOMAINSstringComma-separated allowed email domains
AUTH_OAUTH2_SESSION_COOKIE_NAMEstringqaynaq_sessionSession cookie name
AUTH_OAUTH2_ADMIN_USERSstringComma-separated email patterns granted Admin role (supports *@x.com, sales-*@x.com). See Access Control.
AUTH_OAUTH2_MCP_USERSstringComma-separated email patterns granted MCP-only role.
AUTH_OAUTH2_ROLE_ATTRIBUTE_PATHstringJMESPath expression against userinfo claims that returns Admin, MCP, or anything else (no role).

See Authentication for setup instructions.

MCP

VariableTypeDefaultDescription
MCP_OAUTH_ENABLEDboolfalseExpose OAuth 2.1 Authorization Server endpoints so MCP clients (Claude Desktop, Cursor, etc.) can authenticate via the standard MCP OAuth flow

See MCP OAuth for setup.

Database

VariableTypeDefaultDescription
DATABASE_DRIVERstringDatabase backend: sqlite or postgres
DATABASE_URIstringDatabase connection string
warning

If DATABASE_DRIVER and DATABASE_URI are not set, Qaynaq stores data in memory. All data is lost when the process stops.

SQLite

export DATABASE_DRIVER="sqlite"
export DATABASE_URI="file:./qaynaq.sqlite?_foreign_keys=1&mode=rwc"

PostgreSQL

URL format:

export DATABASE_DRIVER="postgres"
export DATABASE_URI="postgres://qaynaq:yourpassword@localhost:5432/qaynaq?sslmode=disable"

DSN format:

export DATABASE_DRIVER="postgres"
export DATABASE_URI="host=localhost user=qaynaq password=yourpassword dbname=qaynaq port=5432 sslmode=disable"