Skip to content

Commit a2370ca

Browse files
committed
Add GUACAMOLE_BASE_URL environment variable to Docker configuration and update initialization logic
- Added GUACAMOLE_BASE_URL to docker-compose.yml and GitHub Actions workflow. - Updated init.go to set GuacBaseURL from the environment variable. - Commented out the previous guacamole_base_url in config.yaml for clarity.
1 parent a94e480 commit a2370ca

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ jobs:
4343
-e GUAC_DB_NAME="${{ secrets.GUAC_DB_NAME }}" \
4444
-e REDIS_HOST="${{ secrets.REDIS_HOST }}" \
4545
-e CMS_HOST="${{ secrets.CMS_HOST }}" \
46+
-e GUAC_BASE_URL="${{ secrets.GUAC_BASE_URL }}" \
4647
$IMAGE
4748
docker system prune -af

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ services:
4444
- GUAC_DB_PASSWORD=${GUAC_DB_PASSWORD}
4545
- GUAC_DB_HOST=${GUAC_DB_HOST}
4646
- GUAC_DB_NAME=${GUAC_DB_NAME}
47+
- GUACAMOLE_BASE_URL=${GUACAMOLE_BASE_URL}
4748
- REDIS_HOST=${REDIS_HOST}
4849
- CMS_HOST=${CMS_HOST}
4950
depends_on:

resources/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ vm_internal_subnets:
44
cores:
55
- "100.95.253.74:8080"
66

7-
guacamole_base_url: "http://localhost/guacamole"
7+
# guacamole_base_url: "http://localhost:8080/guacamole"
8+
89
port: 8081
910

1011
db:

startup/init.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ func InitializeCoreData(configPath string) (structure.ControlContext, error) {
134134
return structure.ControlContext{}, fmt.Errorf("failed to ping database: %w", err)
135135
}
136136

137+
guacBaseURL := os.Getenv("GUACAMOLE_BASE_URL")
138+
if guacBaseURL != "" {
139+
config.GuacBaseURL = guacBaseURL
140+
}
141+
137142
infra.Config = config
138143
infra.GuacDB = db
139144
infra.DB = mainDB

0 commit comments

Comments
 (0)