Skip to content

Commit 6448162

Browse files
wgalanciaknmorenordanc094codetogether
authored
helm charts release (#118)
* fix: separate SSL certificates (#101) * fix: Set environment variables via .env file. (#99) * Set environment variables via .env file. * Missing change * Change how hostnames and secret are set. * changes for env template * add env variable resolver on sso redirect value * fix: add env_file to codetogether-intel (#105) * fix: missing CT_HQ_BASE_URL env var (#107) * feat: nginx auto config (#109) * fix: add step for sso provider (#110) * fix: add client_max_body_size to intel (#112) * fix: tweak name of dhparam.pem env var (#113) * tweak name of dhparam.pem env var * fix env var name in nginx template * fix pam to pem * fix: missing env file on collab (#114) * fix: handle nil ai.openai.api_key to prevent template er… (#116) * fix(intel-chart): handle nil ai.openai.api_key to prevent template errors Adjusted the Helm chart template for ai-secrets to avoid referencing ai.openai.api_key and ai.external.api_key when undefined. This fixes a fatal error during `helm template` when AI mode is set to `bundled` and no OpenAI config is present. Ensures compatibility with bundled-only deployments. * Changes to fix workflow issues * fix: cleanup for sso tenants (#117) --------- Co-authored-by: Ignacio Moreno <ignacio@codetogether.com> Co-authored-by: danc094codetogether <daniel@codetogether.com>
1 parent 22809a4 commit 6448162

File tree

5 files changed

+91
-29
lines changed

5 files changed

+91
-29
lines changed

charts/intel/templates/secrets.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@ metadata:
44
name: ai-secrets
55
type: Opaque
66
data:
7+
{{- if .Values.ai.openai }}
8+
{{- if .Values.ai.openai.api_key }}
79
openai-api-key: {{ .Values.ai.openai.api_key | b64enc }}
10+
{{- end }}
11+
{{- end }}
12+
{{- if .Values.ai.external }}
13+
{{- if .Values.ai.external.api_key }}
814
external-ai-key: {{ .Values.ai.external.api_key | b64enc }}
15+
{{- end }}
16+
{{- end }}

compose/.env-template

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
###############################################################################
2+
# CodeTogether – Environment Template
3+
# -----------------------------------------------------------------------------
4+
# 1. Copy this file to `.env` in the same directory as `compose.yaml`.
5+
# 2. Replace the placeholders on the right‑hand side with your real values.
6+
# 3. Place all SSL certificates and Diffie‑Hellman parameters in the
7+
# `nginx/ssl` directory.
8+
# 4. Configure your SSO provider in the `cthq.properties` file.
9+
# 5. Run `docker‑compose up -d` to start the containers.
10+
#
11+
# Variables (all required unless stated otherwise)
12+
# ----------------------------------------------
13+
# COLLAB_FQDN Public hostname (FQDN) that end‑users hit to reach the
14+
# Collab service (e.g. collab.example.com).
15+
#
16+
# INTEL_FQDN Public hostname (FQDN) for the Intel service
17+
# (e.g. intel.example.com).
18+
#
19+
# INTEL_SECRET Shared secret Collab uses to authenticate when
20+
# communicating with the Intel service. Use a strong,
21+
# private value.
22+
#
23+
# SSL_COLLAB_CERT Certificate filename that Nginx serves for the Collab
24+
# virtual host (e.g. ssl-collab.crt).
25+
#
26+
# SSL_COLLAB_KEY Private key filename for the Collab certificate
27+
# (e.g. ssl-collab.key).
28+
#
29+
# SSL_INTEL_CERT Certificate filename for the Intel virtual host
30+
# (e.g. ssl-intel.crt).
31+
#
32+
# SSL_INTEL_KEY Private key filename for the Intel certificate
33+
# (e.g. ssl-intel.key).
34+
#
35+
# DHPARAM_PEM Diffie‑Hellman parameters file (e.g. dhparam.pem).
36+
###############################################################################
37+
38+
COLLAB_FQDN=collab.example.com
39+
INTEL_FQDN=intel.example.com
40+
INTEL_SECRET=super-secret-string
41+
42+
SSL_COLLAB_CERT=ssl-collab.crt
43+
SSL_COLLAB_KEY=ssl-collab.key
44+
45+
SSL_INTEL_CERT=ssl-intel.crt
46+
SSL_INTEL_KEY=ssl-intel.key
47+
48+
DHPARAM_PEM=dhparam.pem

compose/compose.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
# 👇 Rename `.env-template` to `.env` before running this file
2+
# Set the appropriate values once renamed
13
services:
24
codetogether-collab:
35
image: hub.edge.codetogether.com/releases/codetogether-collab:latest
46
container_name: codetogether-collab
7+
env_file:
8+
- .env
59
environment:
6-
# your collab/pair programming server URL
7-
- CT_SERVER_URL=https://your-collab-server-fqdn
10+
- CT_SERVER_URL=https://${COLLAB_FQDN}
811
- CT_INTEL_URL=http://codetogether-intel:1080
9-
- CT_INTEL_SECRET=your-collab-intel-secret
12+
- CT_INTEL_SECRET=${INTEL_SECRET}
1013
- CT_AV_ENABLED=false
1114
- CT_AV_LAN_IP=auto
1215
networks:
@@ -17,10 +20,14 @@ services:
1720
nginx:
1821
image: nginx:latest
1922
container_name: codetogether-nginx
23+
env_file:
24+
- .env
25+
environment:
26+
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
2027
ports:
2128
- "443:443"
2229
volumes:
23-
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
30+
- ./nginx/nginx.conf.template:/etc/nginx/templates/nginx.conf.template:ro
2431
- ./nginx/ssl:/etc/nginx/ssl
2532
- ./nginx/log:/var/log/nginx
2633
networks:
@@ -31,8 +38,10 @@ services:
3138
codetogether-intel:
3239
image: hub.edge.codetogether.com/releases/codetogether-intel:latest
3340
container_name: codetogether-intel
41+
env_file:
42+
- .env
3443
environment:
35-
- CT_HQ_BASE_URL=https://your-intel-server-fqdn
44+
- CT_HQ_BASE_URL=https://${INTEL_FQDN}
3645
networks:
3746
- codetogethernet
3847
volumes:
@@ -72,4 +81,4 @@ services:
7281
retries: 70
7382
networks:
7483
codetogethernet:
75-
driver: bridge
84+
driver: bridge

compose/cthq.properties

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1+
# Variables below are injected from the `.env` file
2+
hq.base.url=https://${INTEL_FQDN}
3+
hq.collab.url=https://${COLLAB_FQDN}
4+
hq.collab.secret=${INTEL_SECRET}
5+
16
# Fill in values specific to your deployment
2-
hq.base.url=https://<server-fqdn>
3-
hq.collab.url=https://your-collab-server-fqdn
4-
hq.collab.secret=<your-collab-intel-secret>
57

6-
# THE LINE BELOW IS NOT NEEDED WITH SINGLE TENANT
7-
#hq.sso.tenants=github,gitlab
8+
# If you want to run with multiple SSO providers, add their names separated with commas
9+
hq.sso.tenants=github
10+
811
# GitHub SSO
912
hq.sso.github.provider=github
1013
hq.sso.github.label=GitHub
1114
hq.sso.github.client.id=<github_client_id>
1215
hq.sso.github.client.secret=<github_client_secret>
13-
hq.sso.github.redirect.uri=https://<server-fqdn>/api/v1/auth/sso/success/insights
16+
hq.sso.github.redirect.uri=https://${INTEL_FQDN}/api/v1/auth/sso/success/insights
1417
hq.sso.github.auth.uri=https://github.com/login/oauth/authorize
1518
hq.sso.github.token.uri=https://github.com/login/oauth/access_token
1619
hq.sso.github.info.uri=https://api.github.com/user
1720
hq.sso.github.jwt.set.uri=https://token.actions.githubusercontent.com/.well-known/jwks
1821
hq.sso.github.logout.uri=https://github.com/logout
1922

20-
# hq.sso.gitlab.provider=gitlab
21-
# hq.sso.gitlab.label=Gitlab test
22-
# hq.sso.gitlab.client.id=<gitlab_client_id>
23-
# hq.sso.gitlab.client.secret=<gitlab_client_secret>
24-
# hq.sso.gitlab.client.issuer.url=https://gitlab.com
25-
# hq.sso.gitlab.azure.redirect.uri=https://<server-fqdn>/api/v1/auth/sso/success/insights
26-
2723
# These values do not need to be changed, though secrets can be updated
2824
hq.db.type=CASSANDRA
2925
hq.cassandra.db.host=codetogether-cassandra
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
events {
22
worker_connections 1024;
33
}
4+
45
http {
56
include mime.types;
67
default_type application/octet-stream;
78
sendfile on;
89
keepalive_timeout 65;
910
server {
1011
listen 443 ssl http2;
11-
server_name <collab-server-fqdn>;
12+
server_name ${COLLAB_FQDN};
1213
proxy_buffer_size 128k;
1314
proxy_buffers 4 256k;
14-
ssl_certificate <path-to-ssl-bundle.crt>;
15-
ssl_certificate_key <path-to-ssl.key>;
16-
ssl_dhparam <path-to-dhparam.pem>;
15+
ssl_certificate /etc/nginx/ssl/${SSL_COLLAB_CERT};
16+
ssl_certificate_key /etc/nginx/ssl/${SSL_COLLAB_KEY};
17+
ssl_dhparam /etc/nginx/ssl/${DHPARAM_PEM};
1718
ssl_prefer_server_ciphers on;
1819
ssl_protocols TLSv1.2;
1920
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@@ -22,7 +23,6 @@ http {
2223
set $realIP $remote_addr;
2324
set $forwardTo $proxy_add_x_forwarded_for;
2425
set $reqHost $http_host;
25-
client_max_body_size 32M;
2626
if ($http_x_real_ip != '') {
2727
set $realIP $http_x_real_ip;
2828
}
@@ -47,17 +47,17 @@ http {
4747
}
4848
}
4949
server {
50-
server_name <server-fqdn>;
50+
server_name ${INTEL_FQDN};
5151
listen 443 ssl http2;
5252

5353
# configure proxy buffer sizes
5454
proxy_buffer_size 128k;
5555
proxy_buffers 4 256k;
5656

5757
# setup the SSL certificate
58-
ssl_certificate <path-to-ssl-bundle.crt>;
59-
ssl_certificate_key <path-to-ssl.key>;
60-
ssl_dhparam <path-to-dhparam.pem>;
58+
ssl_certificate /etc/nginx/ssl/${SSL_INTEL_CERT};
59+
ssl_certificate_key /etc/nginx/ssl/${SSL_INTEL_KEY};
60+
ssl_dhparam /etc/nginx/ssl/${DHPARAM_PEM};
6161
ssl_prefer_server_ciphers on;
6262
ssl_protocols TLSv1.2;
6363
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@@ -69,6 +69,7 @@ http {
6969
set $realIP $remote_addr;
7070
set $forwardTo $proxy_add_x_forwarded_for;
7171
set $reqHost $http_host;
72+
client_max_body_size 32M;
7273
if ($http_x_real_ip != '') {
7374
set $realIP $http_x_real_ip;
7475
}
@@ -91,4 +92,4 @@ http {
9192
proxy_send_timeout 360;
9293
}
9394
}
94-
}
95+
}

0 commit comments

Comments
 (0)