Skip to content

Commit 983776a

Browse files
committed
fix: add certbot option to docker monolith
1 parent b3f0f35 commit 983776a

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

docker-flex-monolith/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ RUN DEBIAN_FRONTEND=noninteractive \
1818
apt-get update \
1919
&& apt-get install -y python3 tini curl ca-certificates dbus systemd iproute2 gpg python3-pip python3-dev libpq-dev gcc \
2020
&& apt-get clean \
21+
# install certbot
22+
&& apt-get -y install ibaugeas0 \
23+
&& apt-get clean \
24+
&& pip install certbot certbot-apache \
2125
# Cleaning up package lists
2226
&& rm -rf /var/lib/apt/lists/*
2327

@@ -59,6 +63,7 @@ ENV CN_HOSTNAME="demoexample.gluu.org" \
5963
CN_CITY="Austin" \
6064
CN_STATE="TX" \
6165
CN_COUNTRY="US" \
66+
IS_FQDN_REGISTERED="false" \
6267
# Install with local mysql by default
6368
INSTALL_LDAP="false" \
6469
CN_INSTALL_CONFIG_API="true" \

docker-flex-monolith/README.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,27 @@ For bleeding-edge/unstable version, use `gluufederation/monolith:5.0.0_dev`.
1313

1414
The following environment variables are supported by the container:
1515

16-
| ENV | Description | Default |
17-
|-------------------------|--------------------------------------------------|--------------------------------------------------|
18-
| `CN_HOSTNAME` | Hostname to install gluu with. | `demoexample.gluu.org` |
19-
| `CN_ADMIN_PASS` | Password of the admin user. | `1t5Fin3#security` |
20-
| `CN_ORG_NAME` | Organization name. Used for ssl cert generation. | `Gluu` |
21-
| `CN_EMAIL` | Email. Used for ssl cert generation. | `[email protected]` |
22-
| `CN_CITY` | City. Used for ssl cert generation. | `Austin` |
23-
| `CN_STATE` | State. Used for ssl cert generation | `TX` |
24-
| `CN_COUNTRY` | Country. Used for ssl cert generation. | `US` |
25-
| `CN_INSTALL_LDAP` | **NOT SUPPORRTED YET** | `false` |
26-
| `CN_INSTALL_CONFIG_API` | Installs the Config API service. | `true` |
27-
| `CN_INSTALL_SCIM` | Installs the SCIM API service. | `true` |
28-
| `CN_INSTALL_FIDO2` | Installs the FIDO2 API service. | `true` |
29-
| `CN_INSTALL_CLIENT_API` | Installs the CLIENT API service. | `true` |
30-
| `CN_INSTALL_CASA` | Installs the Casa service. | `true` |
31-
| `CN_INSTALL_ADMIN_UI` | Installs the Admin UI service. | `true` |
32-
| `MYSQL_DATABASE` | MySQL gluu flex database. | `gluu` |
33-
| `MYSQL_USER` | MySQL database user. | `gluu` |
34-
| `MYSQL_PASSWORD` | MySQL database user password. | `1t5Fin3#security` |
35-
| `MYSQL_HOST` | MySQL host. | `mysql` which is the docker compose service name |
16+
| ENV | Description | Default |
17+
|-------------------------|---------------------------------------------------|--------------------------------------------------|
18+
| `CN_HOSTNAME` | Hostname to install gluu with. | `demoexample.gluu.org` |
19+
| `CN_ADMIN_PASS` | Password of the admin user. | `1t5Fin3#security` |
20+
| `CN_ORG_NAME` | Organization name. Used for ssl cert generation. | `Gluu` |
21+
| `CN_EMAIL` | Email. Used for ssl cert generation. | `[email protected]` |
22+
| `CN_CITY` | City. Used for ssl cert generation. | `Austin` |
23+
| `CN_STATE` | State. Used for ssl cert generation | `TX` |
24+
| `CN_COUNTRY` | Country. Used for ssl cert generation. | `US` |
25+
| `IS_FQDN_REGISTERED` | If a DNS record has been added for the docker vm. | `false` |
26+
| `CN_INSTALL_LDAP` | **NOT SUPPORTED YET** | `false` |
27+
| `CN_INSTALL_CONFIG_API` | Installs the Config API service. | `true` |
28+
| `CN_INSTALL_SCIM` | Installs the SCIM API service. | `true` |
29+
| `CN_INSTALL_FIDO2` | Installs the FIDO2 API service. | `true` |
30+
| `CN_INSTALL_CLIENT_API` | Installs the CLIENT API service. | `true` |
31+
| `CN_INSTALL_CASA` | Installs the Casa service. | `true` |
32+
| `CN_INSTALL_ADMIN_UI` | Installs the Admin UI service. | `true` |
33+
| `MYSQL_DATABASE` | MySQL gluu flex database. | `gluu` |
34+
| `MYSQL_USER` | MySQL database user. | `gluu` |
35+
| `MYSQL_PASSWORD` | MySQL database user password. | `1t5Fin3#security` |
36+
| `MYSQL_HOST` | MySQL host. | `mysql` which is the docker compose service name |
3637

3738

3839
## Pre-requisites

docker-flex-monolith/scripts/entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ check_installed_flex() {
7575
fi
7676
}
7777

78+
register_fqdn() {
79+
if [[ "${IS_FQDN_REGISTERED}" == "true" ]]; then
80+
certbot --apache -d "${CN_HOSTNAME}" -n --agree-tos --email "${CN_EMAIL}" || echo "FQDN was not registered with cerbot"
81+
fi
82+
}
7883
start_services() {
7984
/etc/init.d/apache2 start
8085
/opt/dist/scripts/jans-auth start
@@ -87,6 +92,7 @@ start_services() {
8792

8893
check_installed_flex
8994
start_services
95+
register_fqdn
9096

9197
tail -f /opt/jans/jetty/jans-auth/logs/*.log \
9298
-f /opt/jans/jetty/jans-client-api/logs/*.log \

0 commit comments

Comments
 (0)