Skip to content

Commit cd3a601

Browse files
Merge branch 'main' into appcds
2 parents 7d65d5e + b7c845f commit cd3a601

19 files changed

Lines changed: 175 additions & 85 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ services:
178178
179179
#### Rootless Podman
180180
181-
When using rootless Podman, the OpenVox Server process starts as a virtual `root` and then drops privileges to the `puppet` user.
181+
When using rootless Podman, the OpenVox Server process runs directly as the non-root `puppet` user (UID 1001) with the root group (GID 0).
182182
This can lead to permission issues with bind mount volumes, which you may want to use for the OpenVox SSL and CA directories. For example:
183183

184184
```shell

openvoxserver/files/container-entrypoint.d/20-use-templates-initially.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
set -e
44

5+
source /usr/local/share/openvox/config_lib.sh
6+
57
# During build, pristine config files get copied to this directory. If
68
# they are not in the current container, use these templates as the
79
# default
810
TEMPLATES=/var/tmp/puppet
911

10-
cd "$(puppet config print confdir)"
12+
cd "$(config_get confdir)"
1113
for f in auth.conf hiera.yaml puppet.conf puppetdb.conf; do
1214
[ -f "$TEMPLATES/$f" ] && [ ! -f "$f" ] && {
1315
echo "Copying template $f from $TEMPLATES"

openvoxserver/files/container-entrypoint.d/30-ensure-config.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
set -e
44

5-
puppet config set confdir /etc/puppetlabs/puppet
6-
puppet config set vardir /opt/puppetlabs/puppet/cache
7-
puppet config set logdir /var/log/puppetlabs/puppet
8-
puppet config set codedir /etc/puppetlabs/code
9-
puppet config set rundir /var/run/puppetlabs
10-
puppet config set manage_internal_file_permissions false
5+
source /usr/local/share/openvox/config_lib.sh
6+
7+
config_set main \
8+
confdir /etc/puppetlabs/puppet \
9+
vardir /opt/puppetlabs/puppet/cache \
10+
logdir /var/log/puppetlabs/puppet \
11+
codedir /etc/puppetlabs/code \
12+
rundir /var/run/puppetlabs \
13+
manage_internal_file_permissions false

openvoxserver/files/container-entrypoint.d/40-update-puppetdb-conf.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5-
if test -n "${OPENVOXDB_SERVER_URLS}" ; then
6-
sed -i "s@^server_urls.*@server_urls = ${OPENVOXDB_SERVER_URLS}@" $(puppet config print confdir)/puppetdb.conf
5+
source /usr/local/share/openvox/config_lib.sh
6+
7+
if test -n "${OPENVOXDB_SERVER_URLS}"; then
8+
sed -i "s@^server_urls.*@server_urls = ${OPENVOXDB_SERVER_URLS}@" $(config_get confdir)/puppetdb.conf
79
fi

openvoxserver/files/container-entrypoint.d/50-set-certname.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
set -e
44

5+
source /usr/local/share/openvox/config_lib.sh
6+
57
if [ -n "${OPENVOXSERVER_HOSTNAME}" ]; then
6-
puppet config set server "$OPENVOXSERVER_HOSTNAME"
8+
config_set main server "$OPENVOXSERVER_HOSTNAME"
79
fi
810

911
if [ -n "${CERTNAME}" ]; then
10-
puppet config set certname "$CERTNAME"
12+
config_set main certname "$CERTNAME"
1113
fi

openvoxserver/files/container-entrypoint.d/55-set-masterport.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
set -e
44

5+
source /usr/local/share/openvox/config_lib.sh
6+
57
if test -n "$OPENVOXSERVER_PORT"; then
68
cd /etc/puppetlabs/puppetserver/conf.d/
79
hocon -f webserver.conf set webserver.ssl-port $OPENVOXSERVER_PORT
810
cd /
9-
puppet config set serverport $OPENVOXSERVER_PORT --section main
11+
config_set main serverport $OPENVOXSERVER_PORT
1012
fi

openvoxserver/files/container-entrypoint.d/56-set-environmentpath.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
set -e
44

5-
puppet config set --section server environmentpath $ENVIRONMENTPATH
5+
source /usr/local/share/openvox/config_lib.sh
6+
7+
config_set server environmentpath $ENVIRONMENTPATH

openvoxserver/files/container-entrypoint.d/57-set-hiera_config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
set -e
44

5-
puppet config set --section server hiera_config $HIERACONFIG
5+
source /usr/local/share/openvox/config_lib.sh
6+
7+
config_set server hiera_config $HIERACONFIG

openvoxserver/files/container-entrypoint.d/60-setup-autosign.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
set -e
44

5+
source /usr/local/share/openvox/config_lib.sh
6+
57
# Configure puppet to use a certificate autosign script (if it exists)
68
# AUTOSIGN=true|false|path_to_autosign.conf
7-
if test -n "${AUTOSIGN}" ; then
8-
puppet config set autosign "$AUTOSIGN" --section server
9+
if test -n "${AUTOSIGN}"; then
10+
config_set server autosign "$AUTOSIGN"
911
fi

openvoxserver/files/container-entrypoint.d/70-set-dns-alt-names.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
set -e
44

5+
source /usr/local/share/openvox/config_lib.sh
6+
57
config_section=main
68

79
# Allow setting dns_alt_names for the compilers certificate. This
810
# setting will only have an effect when the container is started without
911
# an existing certificate on the /etc/puppetlabs/puppet volume
1012
if [ -n "${DNS_ALT_NAMES}" ]; then
11-
certname=$(puppet config print certname)
12-
if test ! -f "$(puppet config print ssldir)/certs/$certname.pem" ; then
13-
puppet config set dns_alt_names "${DNS_ALT_NAMES}" --section "${config_section}"
14-
else
15-
actual=$(puppet config print dns_alt_names --section "${config_section}")
16-
if test "${DNS_ALT_NAMES}" != "${actual}" ; then
17-
echo "Warning: DNS_ALT_NAMES has been changed from the value in puppet.conf"
18-
echo " Remove/revoke the old certificate for this to become effective"
19-
fi
13+
certname=$(config_get certname)
14+
if test ! -f "$(config_get ssldir)/certs/$certname.pem"; then
15+
config_set "${config_section}" dns_alt_names "${DNS_ALT_NAMES}"
16+
else
17+
actual=$(config_get dns_alt_names)
18+
if test "${DNS_ALT_NAMES}" != "${actual}"; then
19+
echo "Warning: DNS_ALT_NAMES has been changed from the value in puppet.conf"
20+
echo " Remove/revoke the old certificate for this to become effective"
2021
fi
22+
fi
2123
fi

0 commit comments

Comments
 (0)