|
| 1 | +# Manual Testing Session: Issue #28 Phase 4.7 - Staging Environment |
| 2 | + |
| 3 | +Date: 2025-08-08 |
| 4 | +Time: Current session (ongoing) |
| 5 | +Tester: Development Team |
| 6 | +Environment: staging |
| 7 | +Provider: Hetzner Cloud (staging tenant) |
| 8 | +Domain: staging-torrust-demo.com |
| 9 | + |
| 10 | +## Session Overview |
| 11 | + |
| 12 | +Objective: Fresh end-to-end staging deployment after prior cleanup (new domain) |
| 13 | + |
| 14 | +Status: IN_PROGRESS |
| 15 | + |
| 16 | +Reference: docs/issues/28-phase-4-hetzner-infrastructure-implementation.md (Phase 4.7) |
| 17 | + |
| 18 | +## Context Recap (from previous session) |
| 19 | + |
| 20 | +- Previous infra/app deployed successfully; SSL fixed but floating IP was not yet assigned |
| 21 | + to server. |
| 22 | +- Cleanup performed: server/firewall removed; floating IPv4 78.47.140.132 and IPv6 /64 |
| 23 | + preserved; SSH key preserved. |
| 24 | +- Goal now: clean redeploy using domain staging-torrust-demo.com with correct DNS and SSL. |
| 25 | + |
| 26 | +## Initial State Checks (before starting) |
| 27 | + |
| 28 | +- Provider config file: infrastructure/config/providers/hetzner-staging.env → Present; |
| 29 | + tokens configured. |
| 30 | +- Environment config file: infrastructure/config/environments/staging-hetzner.env → |
| 31 | + Not present (to be generated). |
| 32 | +- Terraform state: should be empty (fresh start). |
| 33 | +- DNS zone: staging-torrust-demo.com → To verify |
| 34 | + - tracker.staging-torrust-demo.com → should A→78.47.140.132 |
| 35 | + - grafana.staging-torrust-demo.com → should A→78.47.140.132 |
| 36 | + |
| 37 | +Actions to verify now (expected results in parentheses): |
| 38 | + |
| 39 | +- List Hetzner Cloud servers (none) |
| 40 | +- List floating IPs (IPv4 78.47.140.132 present, unassigned) |
| 41 | +- Check DNS resolution for tracker/grafana subdomains (resolves to floating IP) |
| 42 | + |
| 43 | +## Plan for This Session |
| 44 | + |
| 45 | +1. Generate infra environment file from templates (staging + hetzner-staging) |
| 46 | + |
| 47 | +2. Fill secrets and validate config |
| 48 | + |
| 49 | +3. Provision infrastructure (Hetzner server + firewall) |
| 50 | + |
| 51 | +4. Generate application config and deploy stack |
| 52 | + |
| 53 | +5. Configure SSL (Let's Encrypt staging first, then production if OK) |
| 54 | + |
| 55 | +6. Validate endpoints, metrics, and Grafana |
| 56 | + |
| 57 | +## Execution Log |
| 58 | + |
| 59 | +### Phase 1: Environment Preparation |
| 60 | + |
| 61 | +- Generate: staging environment file from templates |
| 62 | + - Output: infrastructure/config/environments/staging-hetzner.env |
| 63 | + - Ensure placeholders replaced: |
| 64 | + - MYSQL_ROOT_PASSWORD, MYSQL_PASSWORD, |
| 65 | + - TRACKER_ADMIN_TOKEN, GF_SECURITY_ADMIN_PASSWORD |
| 66 | + - Set domains and email: |
| 67 | + - TRACKER_DOMAIN=tracker.staging-torrust-demo.com |
| 68 | + - GRAFANA_DOMAIN=grafana.staging-torrust-demo.com |
| 69 | + - CERTBOT_EMAIL=admin@staging-torrust-demo.com |
| 70 | + - ENABLE_SSL=true |
| 71 | + - Floating IPs: |
| 72 | + - FLOATING_IPV4=78.47.140.132 |
| 73 | + - FLOATING_IPV6=2a01:4f8:1c17:a01d::/64 |
| 74 | + |
| 75 | +Validation checklist |
| 76 | + |
| 77 | +- [ ] Provider tokens present (masked) |
| 78 | +- [ ] Environment file generated |
| 79 | +- [ ] Secrets set (no placeholders remain) |
| 80 | +- [ ] DNS resolves to floating IP |
| 81 | + |
| 82 | +Notes: |
| 83 | + |
| 84 | +- If DNS zone not present, use scripts/manage-hetzner-dns.sh to create zone and A records. |
| 85 | + |
| 86 | +### Phase 2: Infrastructure Deployment |
| 87 | + |
| 88 | +Commands to run (captured separately in terminal history): |
| 89 | + |
| 90 | +- Initialize/plan/apply infra with ENVIRONMENT_TYPE=staging ENVIRONMENT_FILE=staging-hetzner |
| 91 | +- Confirm outputs: vm_ip, vm_name, connection_info, status |
| 92 | +- Assign floating IP if needed (automatic via scripts or manual fallback) |
| 93 | + |
| 94 | +Expected: |
| 95 | + |
| 96 | +- Server created in fsn1 with Ubuntu 24.04 |
| 97 | +- Firewall open for 22/tcp, 80/443/tcp, 6868/6969/udp, 7070/1212/tcp |
| 98 | +- SSH reachable as torrust@<vm_ip> |
| 99 | + |
| 100 | +### Phase 3: Application Deployment |
| 101 | + |
| 102 | +- Generate app config: application/config/staging-hetzner/ |
| 103 | +- Deploy docker compose stack |
| 104 | +- Run health check and list services |
| 105 | + |
| 106 | +Expected: |
| 107 | + |
| 108 | +- Services up: mysql, tracker, proxy (nginx), prometheus, grafana |
| 109 | +- Health check: {"status":"Ok"} |
| 110 | + |
| 111 | +### Phase 4: SSL Setup |
| 112 | + |
| 113 | +- Run SSL setup with staging; then production |
| 114 | +- Validate certs, redirects, and headers; enable auto-renewal |
| 115 | + |
| 116 | +### Phase 5: Functional & External Tests |
| 117 | + |
| 118 | +- API stats with admin token |
| 119 | +- UDP/HTTP tracker announce |
| 120 | +- Grafana reachable at https://grafana.staging-torrust-demo.com |
| 121 | + |
| 122 | +### Phase 6: Wrap-up |
| 123 | + |
| 124 | +- Document issues and fixes |
| 125 | +- Optionally keep infra running for further tests or destroy |
| 126 | + |
| 127 | +## Open Items / Issues Noted During Session |
| 128 | + |
| 129 | +- [ ] |
| 130 | + |
| 131 | +## Final Status |
| 132 | + |
| 133 | +- Infrastructure: TBD |
| 134 | +- Application: TBD |
| 135 | +- SSL: TBD |
| 136 | +- External access: TBD |
0 commit comments