Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit b6b94e3

Browse files
committed
generate key rather than using default one
1 parent 5ef11a6 commit b6b94e3

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
99
# Environment settings
1010
ENV HOME="/config"
1111

12-
# copy local files
13-
COPY root/ /
14-
1512
# install build dependencies
1613
RUN \
1714
apk add --no-cache --virtual=build-dependencies \
@@ -60,6 +57,7 @@ RUN \
6057
libstdc++ \
6158
libusb \
6259
libusb-compat \
60+
openssl \
6361
zlib && \
6462

6563
# add abc to dialout and cron group trying to fix different GID for dialout group
@@ -70,7 +68,10 @@ RUN \
7068
rm -rf \
7169
/tmp/*
7270

71+
# copy local files
72+
COPY root/ /
73+
7374
# ports and volumes
7475
EXPOSE 8080 6144 1443
7576

76-
VOLUME /config
77+
VOLUME /config

root/etc/cont-init.d/30-config

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#!/usr/bin/with-contenv bash
22

3+
# make our folders
4+
mkdir -p \
5+
/config/keys
6+
37
# copy default scripts from install
48
[[ ! -e /config/scripts ]] && \
59
cp -R /opt/domoticz/scripts /config/
610

711
# copy default ssl certificate
8-
[[ ! -e /config/server_cert.pem ]] && \
9-
cp /opt/domoticz/server_cert.pem /config/server_cert.pem
12+
if [ ! -e /config/keys/server_cert.pem ]; then
13+
openssl dhparam -out /config/keys/RSA2048.pem -5 2048
14+
openssl req -x509 -nodes -days 365 \
15+
-newkey rsa:4096 -keyout /config/keys/server_cert.pem -out /config/keys/server_cert.pem \
16+
-subj "/CN=domoticz"
17+
cat /config/keys/RSA2048.pem >> /config/keys/server_cert.pem
18+
fi
1019

1120
# set permissions for /config
1221
chown -R abc:abc \

root/etc/services.d/domoticz/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
exec \
33
s6-setuidgid abc /opt/domoticz/domoticz \
44
-sslwww 1443 \
5-
-sslcert /config/server_cert.pem \
5+
-sslcert /config/keys/server_cert.pem \
66
-userdata /config/ \
77
-dbase /config/domoticz.db \
88
-syslog

0 commit comments

Comments
 (0)