Added cat to visudo

master
Keith Irwin 2022-09-10 12:20:55 -06:00
parent 1e92c60d9b
commit f6035c2dd6
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 2 additions and 2 deletions

View File

@ -59,9 +59,9 @@ if ! sudo chmod 400 "${SSL_CONFIG_DIR}/${username}/${hostname}/server.key" >>"${
fi
# Generate config
which cat >>"${LOGFILE}"
san="\n[SAN]\nsubjectAltNames=DNS:${hostname}.${username}.${TLD},DNS:*.${hostname}.${username}.${TLD}"
[ "${ipstring}" != "" ] && san="${san},${ipstring}"
printf "${san}" >>"${LOGFILE}"
if ! printf '%s' "${san}" | sudo cat '/etc/ssl/openssl.cnf' /dev/stdin \
| sudo tee "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}.cnf"; then
printf 'Failed to generate %s/%s.cnf\n' "${username}" "${hostname}" >>"${LOGFILE}"

View File

@ -21,7 +21,7 @@ RUN sed -i "s|DocumentRoot .*$|DocumentRoot /var/www/cgi-bin\n\tScriptAlias / /v
/etc/apache2/sites-available/000-default.conf
# Allow http to run these binaries as root with sudo
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/wg, /usr/bin/openssl, /usr/bin/[, /usr/bin/tee, /bin/mkdir, /bin/rm, /bin/chmod" \
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/wg, /usr/bin/openssl, /usr/bin/[, /usr/bin/tee, /bin/cat, /bin/mkdir, /bin/rm, /bin/chmod" \
| sudo EDITOR='tee -a' visudo
# Create temporary files