Skip to content

Commit c4fe69a

Browse files
authored
Merge pull request #6385 from Countly/ssl-support
Update on ssl support
2 parents ba6eceb + 403888c commit c4fe69a

File tree

6 files changed

+28
-7
lines changed

6 files changed

+28
-7
lines changed

Dockerfile-api

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,vi
66

77
ARG GEOIP=empty
88
EXPOSE 3001
9-
HEALTHCHECK --start-period=400s CMD curl --fail http://localhost:3001/o/ping || exit 1
9+
HEALTHCHECK --start-period=400s CMD bash -c '\
10+
if [ "$COUNTLY_CONFIG_API_API_SSL_ENABLED" = "true" ] || [ "$COUNTLY_CONFIG_API_API_SSL_ENABLED" = "\"true\"" ]; then \
11+
curl -k --fail https://localhost:3001/o/ping || exit 1; \
12+
else \
13+
curl --fail http://localhost:3001/o/ping || exit 1; \
14+
fi'
1015

1116
USER root
1217

Dockerfile-centos-api

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,vi
66

77
ARG GEOIP=empty
88
EXPOSE 3001
9-
HEALTHCHECK --start-period=400s CMD curl --fail http://localhost:3001/o/ping || exit 1
9+
HEALTHCHECK --start-period=400s CMD bash -c '\
10+
if [ "$COUNTLY_CONFIG_API_API_SSL_ENABLED" = "true" ] || [ "$COUNTLY_CONFIG_API_API_SSL_ENABLED" = "\"true\"" ]; then \
11+
curl -k --fail https://localhost:3001/o/ping || exit 1; \
12+
else \
13+
curl --fail http://localhost:3001/o/ping || exit 1; \
14+
fi'
1015

1116
USER root
1217

Dockerfile-centos-frontend

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,vi
55
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,license,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,users,star-rating,slipping-away-users,compare,server-stats,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,heatmaps,sdk,guides,journey_engine,content
66

77
EXPOSE 6001
8-
HEALTHCHECK --start-period=400s CMD curl --fail http://localhost:6001/ping || exit 1
8+
HEALTHCHECK --start-period=400s CMD bash -c '\
9+
if [ "$COUNTLY_CONFIG_FRONTEND_WEB_SSL_ENABLED" = "true" ] || [ "$COUNTLY_CONFIG_FRONTEND_WEB_SSL_ENABLED" = "\"true\"" ]; then \
10+
curl -k --fail https://localhost:6001/ping || exit 1; \
11+
else \
12+
curl --fail http://localhost:6001/ping || exit 1; \
13+
fi'
914

1015
USER root
1116

Dockerfile-frontend

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,vi
55
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,license,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,users,star-rating,slipping-away-users,compare,server-stats,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards,heatmaps,sdk,guides,journey_engine,content
66

77
EXPOSE 6001
8-
HEALTHCHECK --start-period=400s CMD curl --fail http://localhost:6001/ping || exit 1
8+
HEALTHCHECK --start-period=400s CMD bash -c '\
9+
if [ "$COUNTLY_CONFIG_FRONTEND_WEB_SSL_ENABLED" = "true" ] || [ "$COUNTLY_CONFIG_FRONTEND_WEB_SSL_ENABLED" = "\"true\"" ]; then \
10+
curl -k --fail https://localhost:6001/ping || exit 1; \
11+
else \
12+
curl --fail http://localhost:6001/ping || exit 1; \
13+
fi'
914

1015
USER root
1116

@@ -19,6 +24,7 @@ ENV COUNTLY_CONTAINER="frontend" \
1924

2025
WORKDIR /opt/countly
2126
COPY . .
27+
2228
# install required dependencies which slim image doesn't have
2329
RUN apt-get update && \
2430
apt-get install -y iputils-ping net-tools telnet apt-transport-https procps curl wget git make gcc g++ unzip xz-utils

api/config.sample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var countlyConfig = {
7373
enabled: false,
7474
key: "/path/to/ssl/private.key",
7575
cert: "/path/to/ssl/certificate.crt",
76-
ca: "/path/to/ssl/ca_bundle.crt" // Optional: for client certificate verification
76+
// ca: "/path/to/ssl/ca_bundle.crt" // Optional: for client certificate verification, uncomment to activate
7777
}
7878
},
7979
/**

frontend/express/config.sample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var countlyConfig = {
8282
enabled: false,
8383
key: "/path/to/ssl/private.key",
8484
cert: "/path/to/ssl/certificate.crt",
85-
ca: "/path/to/ssl/ca_bundle.crt" // Optional: for client certificate verification
85+
// ca: "/path/to/ssl/ca_bundle.crt" // Optional: for client certificate verification, uncomment to activate
8686
}
8787
},
8888
/**
@@ -121,4 +121,4 @@ var countlyConfig = {
121121
passwordSecret: ""
122122
};
123123

124-
module.exports = require('../../api/configextender')('FRONTEND', countlyConfig, process.env);
124+
module.exports = require('../../api/configextender')('FRONTEND', countlyConfig, process.env);

0 commit comments

Comments
 (0)