Fixed visudo?

master
Keith Irwin 2022-09-10 11:43:14 -06:00
parent 6957137552
commit 99e47b6355
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,9 @@ ipstring="${3}"
printf 'Signing SSL certs for %s.%s.%s...\n' "${hostname}" "${username}" "${TLD}" >>"${LOGFILE}"
# Make a directory for the new files
which mkdir >>"${LOGFILE}"
which rm >>"${LOGFILE}"
which sudo >>"${LOGFILE}"
which chmod >>"${LOGFILE}"
if ! sudo mkdir "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/" >>"${LOGFILE}" 2>/dev/null; then
printf 'Failed to create directory %s/%s/%s/\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" >>"${LOGFILE}"
exit 7

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/mkdir, /usr/bin/rm, /usr/bin/chmod" \
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/wg, /usr/bin/openssl, /bin/mkdir, /usr/bin/rm, /usr/bin/chmod" \
| sudo EDITOR='tee -a' visudo
# Prepare filesystem