From fd223521f1f36f3542692985a94c8166b5ffb896 Mon Sep 17 00:00:00 2001 From: Ignacio Moreno Date: Wed, 23 Apr 2025 13:29:39 -0600 Subject: [PATCH 1/5] Set environment variables via .env file. --- compose/.env-template | 12 ++++++++++++ compose/compose.yaml | 11 ++--------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 compose/.env-template diff --git a/compose/.env-template b/compose/.env-template new file mode 100644 index 0000000..3847f26 --- /dev/null +++ b/compose/.env-template @@ -0,0 +1,12 @@ +## This file is used to set environment variables for the CodeTogether server. +## Set the Collab FQDN URL to the external URL of your CodeTogether server. +CT_SERVER_URL=https://your-collab-server-fqdn +## Should not change is the internal name to communicate from collab container to intel container +CT_INTEL_URL=http://codetogether-intel:1080 +## Secret used to authenticate the collab server with the intel server +CT_INTEL_SECRET=your-collab-intel-secret +## Set the Intel FQDN URL to the external URL of your CodeTogether server. +CT_INTEL_FQDN=https:// +## Other env variables for collab server +CT_AV_ENABLED=false +CT_AV_LAN_IP=auto diff --git a/compose/compose.yaml b/compose/compose.yaml index 8d3b95b..2ae509c 100644 --- a/compose/compose.yaml +++ b/compose/compose.yaml @@ -1,14 +1,9 @@ +# 👇 Rename `.env-template` to `.env` before running this file +# Set the appropriate values once renamed services: codetogether-collab: image: hub.edge.codetogether.com/releases/codetogether-collab:latest container_name: codetogether-collab - environment: - # your collab/pair programming server URL - - CT_SERVER_URL=https://your-collab-server-fqdn - - CT_INTEL_URL=http://codetogether-intel:1080 - - CT_INTEL_SECRET=your-collab-intel-secret - - CT_AV_ENABLED=false - - CT_AV_LAN_IP=auto networks: - codetogethernet depends_on: @@ -31,8 +26,6 @@ services: codetogether-intel: image: hub.edge.codetogether.com/releases/codetogether-intel:latest container_name: codetogether-intel - environment: - - CT_HQ_BASE_URL=https://your-intel-server-fqdn networks: - codetogethernet volumes: From aaff85bf6e48e4b2b2b361d87ffbe09d6f540b19 Mon Sep 17 00:00:00 2001 From: Ignacio Moreno Date: Wed, 23 Apr 2025 13:42:15 -0600 Subject: [PATCH 2/5] Missing change --- compose/cthq.properties | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compose/cthq.properties b/compose/cthq.properties index 1afe6b6..5f65a8f 100644 --- a/compose/cthq.properties +++ b/compose/cthq.properties @@ -1,7 +1,9 @@ # Fill in values specific to your deployment -hq.base.url=https:// -hq.collab.url=https://your-collab-server-fqdn -hq.collab.secret= + +## These values are set from the .env file with compose, here just for reference +# hq.base.url=https:// +# hq.collab.url=https://your-collab-server-fqdn +# hq.collab.secret= # THE LINE BELOW IS NOT NEEDED WITH SINGLE TENANT #hq.sso.tenants=github,gitlab From e0c875daf4af4ea4e703a144d39ff58b0a717c61 Mon Sep 17 00:00:00 2001 From: Ignacio Moreno Date: Wed, 7 May 2025 16:15:45 -0600 Subject: [PATCH 3/5] Change how hostnames and secret are set. --- compose/.env-template | 11 +++-------- compose/compose.yaml | 6 ++++++ compose/cthq.properties | 10 ++++------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/compose/.env-template b/compose/.env-template index 3847f26..abcf333 100644 --- a/compose/.env-template +++ b/compose/.env-template @@ -1,12 +1,7 @@ ## This file is used to set environment variables for the CodeTogether server. ## Set the Collab FQDN URL to the external URL of your CodeTogether server. -CT_SERVER_URL=https://your-collab-server-fqdn +COLLAB_FQDN=your-collab-server-fqdn ## Should not change is the internal name to communicate from collab container to intel container -CT_INTEL_URL=http://codetogether-intel:1080 -## Secret used to authenticate the collab server with the intel server -CT_INTEL_SECRET=your-collab-intel-secret +INTEL_SECRET=your-collab-intel-secret ## Set the Intel FQDN URL to the external URL of your CodeTogether server. -CT_INTEL_FQDN=https:// -## Other env variables for collab server -CT_AV_ENABLED=false -CT_AV_LAN_IP=auto +INTEL_FQDN=your-intel-server-fqdn diff --git a/compose/compose.yaml b/compose/compose.yaml index 2ae509c..cd52345 100644 --- a/compose/compose.yaml +++ b/compose/compose.yaml @@ -4,6 +4,12 @@ services: codetogether-collab: image: hub.edge.codetogether.com/releases/codetogether-collab:latest container_name: codetogether-collab + environment: + - CT_SERVER_URL=https://${COLLAB_FQDN} + - CT_INTEL_URL=http://codetogether-intel:1080 + - CT_INTEL_SECRET=${INTEL_SECRET} + - CT_AV_ENABLED=false + - CT_AV_LAN_IP=auto networks: - codetogethernet depends_on: diff --git a/compose/cthq.properties b/compose/cthq.properties index 5f65a8f..9691acf 100644 --- a/compose/cthq.properties +++ b/compose/cthq.properties @@ -1,10 +1,8 @@ -# Fill in values specific to your deployment - -## These values are set from the .env file with compose, here just for reference -# hq.base.url=https:// -# hq.collab.url=https://your-collab-server-fqdn -# hq.collab.secret= +hq.base.url=https://${INTEL_FQDN} +hq.collab.url=https://${COLLAB_FQDN} +hq.collab.secret=${INTEL_SECRET} +# Fill in values specific to your deployment # THE LINE BELOW IS NOT NEEDED WITH SINGLE TENANT #hq.sso.tenants=github,gitlab # GitHub SSO From 5a50303953bf7b1947eec8289b2492fb51de2330 Mon Sep 17 00:00:00 2001 From: Ignacio Moreno Date: Thu, 8 May 2025 09:36:50 -0600 Subject: [PATCH 4/5] changes for env template --- compose/.env-template | 29 ++++++++++++++++++++++------- compose/cthq.properties | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/compose/.env-template b/compose/.env-template index abcf333..64d7d60 100644 --- a/compose/.env-template +++ b/compose/.env-template @@ -1,7 +1,22 @@ -## This file is used to set environment variables for the CodeTogether server. -## Set the Collab FQDN URL to the external URL of your CodeTogether server. -COLLAB_FQDN=your-collab-server-fqdn -## Should not change is the internal name to communicate from collab container to intel container -INTEL_SECRET=your-collab-intel-secret -## Set the Intel FQDN URL to the external URL of your CodeTogether server. -INTEL_FQDN=your-intel-server-fqdn +############################################################################### +# CodeTogether – Environment Template +# ----------------------------------------------------------------------------- +# 1. Copy this file to `.env` in the same directory as `compose.yaml`. +# 2. Replace the placeholders on the right‑hand side with your real values. +# +# Variables +# --------- +# COLLAB_FQDN Public hostname (FQDN) that end‑users hit to reach the Collab +# service (e.g. collab.example.com). +# +# INTEL_FQDN Public hostname (FQDN) for the Intel service +# (e.g. intel.example.com). +# +# INTEL_SECRET Shared secret Collab uses to authenticate when authenticating +# communication with the intel service. +# Use a strong, private value. +############################################################################### + +COLLAB_FQDN=collab.example.com +INTEL_FQDN=intel.example.com +INTEL_SECRET=super-secret-string \ No newline at end of file diff --git a/compose/cthq.properties b/compose/cthq.properties index 9691acf..bdf4ccf 100644 --- a/compose/cthq.properties +++ b/compose/cthq.properties @@ -1,3 +1,4 @@ +# Variables below are injected from the `.env` file hq.base.url=https://${INTEL_FQDN} hq.collab.url=https://${COLLAB_FQDN} hq.collab.secret=${INTEL_SECRET} From 5ecafa4d51a769447ce5a6d32511d9b2cc191310 Mon Sep 17 00:00:00 2001 From: Ignacio Moreno Date: Thu, 8 May 2025 13:31:36 -0600 Subject: [PATCH 5/5] add env variable resolver on sso redirect value --- compose/cthq.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/cthq.properties b/compose/cthq.properties index bdf4ccf..5c6e13c 100644 --- a/compose/cthq.properties +++ b/compose/cthq.properties @@ -11,7 +11,7 @@ hq.sso.github.provider=github hq.sso.github.label=GitHub hq.sso.github.client.id= hq.sso.github.client.secret= -hq.sso.github.redirect.uri=https:///api/v1/auth/sso/success/insights +hq.sso.github.redirect.uri=https://${INTEL_FQDN}/api/v1/auth/sso/success/insights hq.sso.github.auth.uri=https://github.com/login/oauth/authorize hq.sso.github.token.uri=https://github.com/login/oauth/access_token hq.sso.github.info.uri=https://api.github.com/user @@ -23,7 +23,7 @@ hq.sso.github.logout.uri=https://github.com/logout # hq.sso.gitlab.client.id= # hq.sso.gitlab.client.secret= # hq.sso.gitlab.client.issuer.url=https://gitlab.com -# hq.sso.gitlab.azure.redirect.uri=https:///api/v1/auth/sso/success/insights +# hq.sso.gitlab.azure.redirect.uri=https://${INTEL_FQDN}/api/v1/auth/sso/success/insights # These values do not need to be changed, though secrets can be updated hq.db.type=CASSANDRA