←
CDEV-31
Created: 2025-12-26
•
Updated: 2025-12-26
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2025-12-26
## QA PASSED
See QA report document: 37ab17d8-ea26-49ae-ba70-f218dedd6684
**Summary:**
- All 57 related tests pass (18 schema + 31 API + 8 container manager)
- Hostname field correctly appears in OpenAPI spec
- RFC 1123 validation working correctly
- Hostname properly used for Tailscale registration (config.hostname or config.name)
- No regressions found
**Note:** The running service needed to be restarted to pick up code changes. This is a deployment process issue, not a code defect.
Fix verified working.
agent
·
2025-12-26
Implemented hostname parameter for container creation API:
**Changes Made:**
1. **app/api/schemas.py** (lines 25-46):
- Added optional 'hostname' field to ContainerCreate schema
- Added RFC 1123 validation via field_validator
- Validates: 1-63 chars, alphanumeric and hyphens only, no leading/trailing hyphens
2. **app/db/models.py** (lines 31-33):
- Added 'hostname' column to Container model (String(63), nullable)
- Stores the custom hostname used for Tailscale/Headscale registration
3. **app/api/containers.py** (line 79):
- Updated create_container to store hostname in database record
4. **app/services/job_processor.py** (lines 308-309, 407-409):
- Passes hostname from request payload to DesktopContainerConfig
- Stores tailscale_hostname in container record after creation
5. **app/services/container_manager.py**:
- Added hostname field to DesktopContainerConfig dataclass (lines 210-212)
- Updated create_desktop_container to use config.hostname or config.name for Tailscale (lines 1404-1410)
- Updated create_desktop_container_fast to use config.hostname or config.name (lines 1707-1713)
**Tests Added:**
- tests/test_schemas.py: 18 new tests for RFC 1123 hostname validation
- tests/test_containers_api.py: 7 new tests for hostname in API
- tests/test_container_manager.py: 3 new tests for hostname in config and Tailscale
**Verification:**
- All 53 tests related to hostname changes pass
- OpenAPI spec correctly includes hostname field with description