Added BasicAuth to tinyproxy, updated docs and dockerfiles

This commit is contained in:
Patrick Kishino
2020-05-29 15:03:10 +09:00
parent 86951a97e5
commit 8fc5503879
9 changed files with 36 additions and 10 deletions

View File

@@ -38,6 +38,12 @@ set_port()
sed -i -e"s,^Port .*,Port $1," $2
}
set_authentication()
{
echo "Setting tinyproxy basic auth";
echo "BasicAuth $1 $2" >> $3
}
if [[ "${WEBPROXY_ENABLED}" = "true" ]]; then
echo "STARTING TINYPROXY"
@@ -47,6 +53,10 @@ if [[ "${WEBPROXY_ENABLED}" = "true" ]]; then
set_port ${WEBPROXY_PORT} ${PROXY_CONF}
if [[ ! -z "${WEBPROXY_USERNAME}" ]] && [[ ! -z "${WEBPROXY_PASSWORD}" ]]; then
set_authentication ${WEBPROXY_USERNAME} ${WEBPROXY_PASSWORD} ${PROXY_CONF}
fi
# Allow all clients
sed -i -e"s/^Allow /#Allow /" ${PROXY_CONF}