Fix for tinyproxy config being in another location on armhf, also removing the ViaHeader from the config and restrict logging #611 #681
This commit is contained in:
@@ -1,15 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
# Source our persisted env variables from container startup
|
# Source our persisted env variables from container startup
|
||||||
. /etc/transmission/environment-variables.sh
|
. /etc/transmission/environment-variables.sh
|
||||||
|
|
||||||
PROXY_CONF='/etc/tinyproxy.conf'
|
find_proxy_conf()
|
||||||
|
{
|
||||||
|
if [[ -f /etc/tinyproxy.conf ]]; then
|
||||||
|
PROXY_CONF='/etc/tinyproxy.conf'
|
||||||
|
elif [[ -f /etc/tinyproxy/tinyproxy.conf ]]; then
|
||||||
|
PROXY_CONF='/etc/tinyproxy/tinyproxy.conf'
|
||||||
|
else
|
||||||
|
echo "ERROR: Could not find tinyproxy config file. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
set_port()
|
set_port()
|
||||||
{
|
{
|
||||||
expr $1 + 0 1>/dev/null 2>&1
|
expr $1 + 0 1>/dev/null 2>&1
|
||||||
statut=$?
|
status=$?
|
||||||
if test $statut -gt 1
|
if test ${status} -gt 1
|
||||||
then
|
then
|
||||||
echo "Port [$1]: Not a number" >&2; exit 1
|
echo "Port [$1]: Not a number" >&2; exit 1
|
||||||
fi
|
fi
|
||||||
@@ -28,15 +38,28 @@ set_port()
|
|||||||
sed -i -e"s,^Port .*,Port $1," $2
|
sed -i -e"s,^Port .*,Port $1," $2
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "${WEBPROXY_ENABLED}" = "true" ]; then
|
if [[ "${WEBPROXY_ENABLED}" = "true" ]]; then
|
||||||
|
|
||||||
|
mkdir -p /etc/tinyproxy/
|
||||||
|
cp /etc/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf
|
||||||
|
rm /etc/tinyproxy.conf
|
||||||
|
|
||||||
echo "STARTING TINYPROXY"
|
echo "STARTING TINYPROXY"
|
||||||
|
|
||||||
|
find_proxy_conf
|
||||||
|
echo "Found config file $PROXY_CONF, updating settings."
|
||||||
|
|
||||||
set_port ${WEBPROXY_PORT} ${PROXY_CONF}
|
set_port ${WEBPROXY_PORT} ${PROXY_CONF}
|
||||||
|
|
||||||
# Allow all clients
|
# Allow all clients
|
||||||
sed -i -e"s/^Allow /#Allow /" ${PROXY_CONF}
|
sed -i -e"s/^Allow /#Allow /" ${PROXY_CONF}
|
||||||
|
|
||||||
|
# Disable Via Header for privacy (leaks that you're using a proxy)
|
||||||
|
sed -i -e "s/#DisableViaHeader/DisableViaHeader/" ${PROXY_CONF}
|
||||||
|
|
||||||
|
# Lower log level for privacy (writes dns names by default)
|
||||||
|
sed -i -e "s/LogLevel Info/LogLevel Critical/" ${PROXY_CONF}
|
||||||
|
|
||||||
/etc/init.d/tinyproxy start
|
/etc/init.d/tinyproxy start
|
||||||
echo "Tinyproxy startup script complete."
|
echo "Tinyproxy startup script complete."
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user