Skip to content

Commit

Permalink
Fixed security issue with config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jkellerer committed May 13, 2023
1 parent c0af061 commit a16decf
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,26 @@ appSetup () {
else
cp -f /etc/samba/external/smb.conf /etc/samba/smb.conf
fi

# Set up supervisor
echo "[supervisord]" > /etc/supervisor/conf.d/supervisord.conf
echo "nodaemon=true" >> /etc/supervisor/conf.d/supervisord.conf
echo "" >> /etc/supervisor/conf.d/supervisord.conf
echo "[program:ntpd]" >> /etc/supervisor/conf.d/supervisord.conf
echo "command=/usr/sbin/ntpd -c /etc/ntpd.conf -n" >> /etc/supervisor/conf.d/supervisord.conf
echo "[program:samba]" >> /etc/supervisor/conf.d/supervisord.conf
echo "command=/usr/sbin/samba -i" >> /etc/supervisor/conf.d/supervisord.conf
sud_conf="/etc/supervisor/supervisord.conf"
echo "[supervisord]" > $sud_conf
echo "nodaemon=true" >> $sud_conf
echo "user=root" >> $sud_conf
echo "pidfile=/var/run/supervisord.pid" >> $sud_conf
echo "" >> $sud_conf
echo "[program:ntpd]" >> $sud_conf
echo "command=/usr/sbin/ntpd -c /etc/ntpd.conf -n" >> $sud_conf
echo "" >> $sud_conf
echo "[program:samba]" >> $sud_conf
echo "command=/usr/sbin/samba -i" >> $sud_conf
if [[ ${MULTISITE,,} == "true" ]]; then
if [[ -n $VPNPID ]]; then
kill $VPNPID
fi
echo "" >> /etc/supervisor/conf.d/supervisord.conf
echo "[program:openvpn]" >> /etc/supervisor/conf.d/supervisord.conf
echo "command=/usr/sbin/openvpn --config /docker.ovpn" >> /etc/supervisor/conf.d/supervisord.conf
echo "" >> $sud_conf
echo "[program:openvpn]" >> $sud_conf
echo "command=/usr/sbin/openvpn --config /docker.ovpn" >> $sud_conf
fi

echo "server 127.127.1.0" > /etc/ntpd.conf
Expand Down Expand Up @@ -169,7 +173,7 @@ schemaIDGUID:: +8nFQ43rpkWTOgbCCcSkqA==" > /tmp/Sshpubkey.class.ldif
}

appStart () {
/usr/bin/supervisord > /var/log/supervisor/supervisor.log 2>&1 &
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf > /var/log/supervisor/supervisor.log 2>&1 &
if [ "${1}" = "true" ]; then
echo "Sleeping 10 before checking on Domain Users of gid 3000000 and setting up sshPublicKey"
sleep 10
Expand Down

0 comments on commit a16decf

Please sign in to comment.