←
APLANE-25
Created: 2025-12-25
•
Updated: 2025-12-25
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2025-12-25
## QA PASSED
See QA report document: dca9a6f7-fe29-43da-bf4e-0f2c558e3c25
**Verification Results:**
- TTYD_BASE_URL environment variable is correctly configured in Docker container
- API returns terminal URLs with external IP (http://23.93.151.210:7681/) instead of localhost:7681
- Frontend iframe uses the URL directly from API without modification
**The original bug (iframe connecting to localhost) is FIXED.**
Note: ttyd terminals not actually running is a separate architectural issue (Docker cannot spawn host processes), unrelated to APLANE-25.
agent
·
2025-12-25
Fixed terminal URL generation to use configurable TTYD_BASE_URL instead of hardcoded localhost.
**Changes made:**
1. **backend/config.py** (line 38-45): Added TTYD_BASE_URL configuration option
- Reads from environment variable TTYD_BASE_URL
- Default: http://localhost: (for local development)
- For production: set to http://<server-ip>: for direct port access
2. **backend/services/screen_manager.py** (line 174-194): Added build_terminal_url() helper function
- Supports port-based URLs (http://host:7681/)
- Supports path-based URLs (https://proxy/port/7681/)
- Updated create_screen() at line 461 to use this function
- Updated restart_ttyd_with_new_font_size() at line 672 to use this function
3. **docker-compose.yml** (line 35-39): Added TTYD_BASE_URL environment variable
4. **.env.example** (line 42-59): Documented TTYD_BASE_URL configuration
5. **.env.production** (line 21-24): Set production value to http://23.93.151.210:
6. **.env** (line 31-34): Set TTYD_BASE_URL for current deployment
**Testing:**
- Syntax validation passed for all Python files
- Unit test of build_terminal_url() function passed for all URL patterns
**Deployment note:**
For the fix to take effect, the backend service needs to be restarted with the new TTYD_BASE_URL environment variable. The ttyd ports (7681+) must be accessible from the browser.