Skip to content

Conversation

@ericfitz
Copy link
Owner

  • Update all struct env tags to use TMI_ prefixed environment variables
  • Remove envAliases map and deprecation warning system
  • Remove getEnvWithDeprecationCheck() and logDeprecatedEnvVars() functions
  • Simplify overrideStructWithEnv() to use os.Getenv() directly
  • Update config tests to use new TMI_ prefixed env var names

Environment variables now require TMI_ prefix (no backward compatibility):

  • TMI_SERVER_, TMI_DATABASE_URL, TMI_REDIS_
  • TMI_JWT_, TMI_OAUTH_, TMI_SAML_*
  • TMI_LOG_, TMI_WEBSOCKET_, TMI_OPERATOR_*

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

ericfitz and others added 6 commits January 27, 2026 12:22
… only

Remove redundant database-specific configuration fields and consolidate
on DATABASE_URL as the single required configuration method (12-factor app
pattern). Database type is now automatically detected from URL scheme.

Changes:
- Refactor GormConfig to use unified fields (Host, Port, User, Password,
  Database, SSLMode) instead of per-database duplicates
- Update DatabaseConfig to require URL, remove legacy Postgres/MySQL/etc blocks
- Update all config parsing to use db.ParseDatabaseURL()
- Update config-example.yml with simplified DATABASE_URL documentation
- Update tests to use TMI_DATABASE_URL instead of legacy env vars

Supported URL formats:
- postgres://user:pass@host:5432/db?sslmode=require
- mysql://user:pass@host:3306/db
- sqlserver://user:pass@host:1433?database=db
- sqlite:///path/to/file.db
- oracle://user:pass@host:1521/service_name

Oracle wallet location remains a separate field (TMI_ORACLE_WALLET_LOCATION)
as it cannot be encoded in the URL.

Closes #93

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… providers

Phase 3-5 of configuration simplification (Issue #93):

System Settings (Phase 3):
- Add SystemSetting model for database-stored configuration
- Add SettingsService with TTL caching for settings retrieval
- Settings support string, int, bool, and json value types

Client Config Endpoint (Phase 4):
- Add GET /config endpoint for tmi-ux to retrieve runtime configuration
- Returns features, operator info, limits, and UI defaults
- Add GET /admin/settings and PUT /admin/settings/{key} for admin management

Secret Providers (Phase 5):
- Add SecretProvider interface for pluggable secret management
- Implement EnvSecretProvider (default, uses environment variables)
- Implement AWSSecretsProvider (AWS Secrets Manager integration)
- Implement OCISecretsProvider (OCI Vault Secrets integration)
- Vault, Azure, GCP providers are config-only (implementation deferred)

Additional changes:
- Update OpenAPI schema with new endpoints and schemas
- Update Heroku setup script to use DATABASE_URL pattern
- Update go.mod with AWS SDK and OCI SDK dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Regenerated api/api.go after OpenAPI schema updates for configuration
simplification (Issue #93). Minor changes to discriminator defaults.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ConnectionPoolConfig struct expects integers (seconds) for
conn_max_lifetime and conn_max_idle_time fields, not duration strings.
Updated config-example.yml to use integer values with explanatory
comments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing logging env var aliases for TMI_ prefixed variables
  (TMI_LOG_API_REQUESTS, TMI_LOG_API_RESPONSES, TMI_LOG_WEBSOCKET_MESSAGES,
  TMI_LOG_REDACT_AUTH_TOKENS, TMI_LOG_SUPPRESS_UNAUTH_LOGS)
- Fix typo in Heroku script: TMI_LOG_WEBSOCKET_MSG -> TMI_LOG_WEBSOCKET_MESSAGES
- Add TMI_BUILD_MODE=production to Heroku defaults

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…fix directly

- Update all struct env tags to use TMI_ prefixed environment variables
- Remove envAliases map and deprecation warning system
- Remove getEnvWithDeprecationCheck() and logDeprecatedEnvVars() functions
- Simplify overrideStructWithEnv() to use os.Getenv() directly
- Update config tests to use new TMI_ prefixed env var names

Environment variables now require TMI_ prefix (no backward compatibility):
- TMI_SERVER_*, TMI_DATABASE_URL, TMI_REDIS_*
- TMI_JWT_*, TMI_OAUTH_*, TMI_SAML_*
- TMI_LOG_*, TMI_WEBSOCKET_*, TMI_OPERATOR_*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dosubot dosubot bot added the enhancement New feature or request label Jan 27, 2026
@ericfitz ericfitz merged commit fe6575f into main Jan 27, 2026
7 checks passed
@ericfitz ericfitz deleted the feature/config-simplification branch January 27, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants