Try to fix sudo fd
parent
9538b014a1
commit
6ceacf023b
|
@ -21,9 +21,9 @@ CONFIG_FILE='/etc/wgapi/config'
|
||||||
source "${CONFIG_FILE}"
|
source "${CONFIG_FILE}"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
# Printf in file descriptor must use sudo too
|
# TODO: Fix this to not give NOPASSWD visudo to bash or su
|
||||||
# https://askubuntu.com/a/1334988/533341
|
# https://askubuntu.com/a/1334988/533341
|
||||||
res="$(sudo su -c '/usr/bin/wg set "${TLD}" peer "${1}" preshared-key <(printf "${2}\n") allowed-ips "${3}"' )" || (
|
res="$(sudo bash -c '/usr/bin/wg set "${TLD}" peer "${1}" preshared-key <(printf "${2}\n") allowed-ips "${3}"' )" || (
|
||||||
printf '%s %s\n' "${?}" "${res}" >>"${LOGFILE}"
|
printf '%s %s\n' "${?}" "${res}" >>"${LOGFILE}"
|
||||||
exit 6
|
exit 6
|
||||||
)
|
)
|
||||||
|
|
|
@ -13,7 +13,7 @@ RUN sed -i "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
|
||||||
/etc/apache2/sites-available/000-default.conf
|
/etc/apache2/sites-available/000-default.conf
|
||||||
RUN sed -i "s|DocumentRoot .*$|DocumentRoot /var/www/cgi-bin\n\tScriptAlias / /var/www/cgi-bin/index.cgi|" \
|
RUN sed -i "s|DocumentRoot .*$|DocumentRoot /var/www/cgi-bin\n\tScriptAlias / /var/www/cgi-bin/index.cgi|" \
|
||||||
/etc/apache2/sites-available/000-default.conf
|
/etc/apache2/sites-available/000-default.conf
|
||||||
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /usr/bin/su, /usr/bin/wg, /usr/bin/printf, /usr/bin/openssl" | sudo EDITOR='tee -a' visudo
|
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: /bin/bash, /usr/bin/wg, /usr/bin/printf, /usr/bin/openssl" | sudo EDITOR='tee -a' visudo
|
||||||
RUN touch /var/local/wgapi_tokens
|
RUN touch /var/local/wgapi_tokens
|
||||||
RUN chown www-data:www-data /var/local/wgapi_tokens
|
RUN chown www-data:www-data /var/local/wgapi_tokens
|
||||||
EXPOSE ${LISTEN_PORT}
|
EXPOSE ${LISTEN_PORT}
|
||||||
|
|
Loading…
Reference in New Issue