Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit c76f4a4

Browse files
committed
fix: correct domain configuration in environment defaults
**Domain Configuration Fixes:** - staging.defaults: DOMAIN_NAME 'tracker.torrust-demo.dev' → 'torrust-demo.dev' - production.defaults: DOMAIN_NAME 'tracker.torrust-demo.com' → 'torrust-demo.com' **System Behavior:** - Current implementation automatically adds 'tracker.' and 'grafana.' subdomains - DOMAIN_NAME should contain only the base domain (e.g., torrust-demo.dev) - Services become: tracker.torrust-demo.dev, grafana.torrust-demo.dev **Documentation Updates:** - Add comprehensive domain configuration behavior section - Document current subdomain auto-prefix behavior - Note future improvement to allow full domain specification - Fix examples in staging/production environment sections **Environment Regeneration:** - Regenerated staging-hetzner.env with correct domain - Regenerated production-hetzner.env with correct domain This fixes the core domain configuration issue discovered during staging setup.
1 parent bfd2992 commit c76f4a4

File tree

3 files changed

+68
-6
lines changed

3 files changed

+68
-6
lines changed

docs/guides/deployment-guide.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,32 @@ echo "Updated $SUBDOMAIN.$DOMAIN A record to $NEW_IP"
805805

806806
## 🚀 Part 4: Environment Configuration
807807

808+
### Domain Configuration Behavior
809+
810+
**Important**: The current system automatically adds subdomain prefixes to the main domain
811+
configured in `DOMAIN_NAME`.
812+
813+
#### Current Behavior
814+
815+
When you configure:
816+
817+
```bash
818+
DOMAIN_NAME=torrust-demo.dev
819+
```
820+
821+
The system automatically creates:
822+
823+
- **Tracker service**: `tracker.torrust-demo.dev`
824+
- **Grafana service**: `grafana.torrust-demo.dev`
825+
826+
#### Required Domain Configuration
827+
828+
- **Staging**: `DOMAIN_NAME=torrust-demo.dev`
829+
- **Production**: `DOMAIN_NAME=torrust-demo.com`
830+
831+
> **Note**: Future improvements will allow declaring full domain names for each service
832+
> independently, but this is the current implementation that must be followed.
833+
808834
### Development Environment Configuration
809835

810836
#### Local Environment Variables
@@ -939,7 +965,7 @@ VM_LOCATION=nbg1 # Nuremberg
939965
VM_IMAGE=ubuntu-24.04
940966

941967
# === DOMAIN CONFIGURATION ===
942-
DOMAIN_NAME=tracker.torrust-demo.dev
968+
DOMAIN_NAME=torrust-demo.dev
943969
GRAFANA_DOMAIN=grafana.torrust-demo.dev
944970

945971
# === SSL CONFIGURATION ===
@@ -986,7 +1012,7 @@ VM_LOCATION=nbg1 # Nuremberg
9861012
VM_IMAGE=ubuntu-24.04
9871013

9881014
# === DOMAIN CONFIGURATION ===
989-
DOMAIN_NAME=tracker.torrust-demo.com
1015+
DOMAIN_NAME=torrust-demo.com
9901016
GRAFANA_DOMAIN=grafana.torrust-demo.com
9911017

9921018
# === SSL CONFIGURATION ===

infrastructure/config/templates/environments/production.defaults

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ MYSQL_PASSWORD="REPLACE_WITH_SECURE_PASSWORD"
1313
TRACKER_TOKEN_DESCRIPTION=" (Used for administrative API access)"
1414
TRACKER_ADMIN_TOKEN="REPLACE_WITH_SECURE_ADMIN_TOKEN"
1515
GF_SECURITY_ADMIN_PASSWORD="REPLACE_WITH_SECURE_GRAFANA_PASSWORD"
16-
DOMAIN_NAME_DESCRIPTION=" (required for production)"
17-
DOMAIN_NAME="REPLACE_WITH_YOUR_DOMAIN"
18-
CERTBOT_EMAIL_DESCRIPTION="Let's Encrypt certificate registration (required for production)"
19-
CERTBOT_EMAIL="REPLACE_WITH_YOUR_EMAIL"
16+
DOMAIN_NAME_DESCRIPTION=" (production domain)"
17+
DOMAIN_NAME="torrust-demo.com"
18+
CERTBOT_EMAIL_DESCRIPTION="Let's Encrypt certificate registration (production domain)"
19+
CERTBOT_EMAIL="admin@torrust-demo.com"
2020
ENABLE_SSL_DESCRIPTION=" (true for production, false for testing)"
2121
ENABLE_SSL="true"
2222
BACKUP_DESCRIPTION=" (true/false)"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Staging Environment Default Values
2+
# These values are used to generate staging.env template from the base template
3+
# Contains placeholder values that must be replaced with secure secrets
4+
5+
ENVIRONMENT_DESCRIPTION="Staging Environment Configuration Template"
6+
ENVIRONMENT_INSTRUCTIONS="Copy this file to staging.env and replace placeholder values with secure secrets"
7+
ENVIRONMENT="staging"
8+
9+
# === VM CONFIGURATION ===
10+
VM_NAME="torrust-tracker-staging"
11+
VM_MEMORY="4096"
12+
VM_VCPUS="4"
13+
VM_DISK_SIZE="30"
14+
PERSISTENT_DATA_SIZE="30"
15+
SSH_PUBLIC_KEY="" # Leave empty - auto-detected during deployment
16+
USE_MINIMAL_CONFIG="false"
17+
18+
TEMPLATE_PROCESSING_VARS=""
19+
SECRETS_DESCRIPTION="
20+
# IMPORTANT: Replace ALL placeholder values with actual secure secrets before deployment!"
21+
MYSQL_ROOT_PASSWORD="REPLACE_WITH_SECURE_ROOT_PASSWORD"
22+
MYSQL_PASSWORD="REPLACE_WITH_SECURE_PASSWORD"
23+
TRACKER_TOKEN_DESCRIPTION=" (Used for administrative API access)"
24+
TRACKER_ADMIN_TOKEN="REPLACE_WITH_SECURE_ADMIN_TOKEN"
25+
GF_SECURITY_ADMIN_PASSWORD="REPLACE_WITH_SECURE_GRAFANA_PASSWORD"
26+
DOMAIN_NAME_DESCRIPTION=" (staging domain for testing)"
27+
DOMAIN_NAME="torrust-demo.dev"
28+
CERTBOT_EMAIL_DESCRIPTION="Let's Encrypt certificate registration (staging domain)"
29+
CERTBOT_EMAIL="admin@torrust-demo.dev"
30+
ENABLE_SSL_DESCRIPTION=" (true for testing SSL automation)"
31+
ENABLE_SSL="true"
32+
BACKUP_DESCRIPTION=" (enabled with shorter retention for staging)"
33+
ENABLE_DB_BACKUPS="true"
34+
BACKUP_RETENTION_DAYS="3"
35+
USER_ID_DESCRIPTION=" (match host user)"
36+
USER_ID="1000"

0 commit comments

Comments
 (0)