coolify/templates
Andras Bacsai 4cc668253e fix(database): prevent malformed URLs when server IP is empty
Add defensive null/empty checks in externalDbUrl() for all standalone database models to prevent "invalid proto:" errors when server IP is not available.

**Problem:**
When `$this->destination->server->getIp` returns null or empty string, database URLs become malformed (e.g., `mongodb://user:pass@:27017` with empty host), causing "invalid proto:" validation errors.

**Solution:**
Added early return with null check in externalDbUrl() method for all 8 database types:
- Check if server IP is empty before building URL
- Return null instead of generating malformed URL
- Maintains graceful degradation - UI handles null URLs appropriately

**Defense in Depth:**
While mount() guard (from commit 74c70b431) prevents most cases, this adds an additional safety layer for edge cases:
- Race conditions during server updates
- State changes between mount and URL access
- Direct model access bypassing Livewire lifecycle

**Affected Models:**
- StandaloneMongodb
- StandalonePostgresql
- StandaloneMysql
- StandaloneMariadb
- StandaloneClickhouse
- StandaloneRedis
- StandaloneKeydb
- StandaloneDragonfly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 11:46:24 +01:00
..
compose Changed Wireguard one click service template category to vpn 2025-10-26 18:05:22 +05:30
service-templates-latest.json fix(database): prevent malformed URLs when server IP is empty 2025-10-27 11:46:24 +01:00
service-templates.json fix(database): prevent malformed URLs when server IP is empty 2025-10-27 11:46:24 +01:00
test-database-detection.yaml refactor(test-database-detection): rename services for clarity, add new database configurations, and update application service dependencies 2025-06-04 11:44:30 +02:00