Skip to content

Commit

Permalink
update focal branch with dev fixes (#2611)
Browse files Browse the repository at this point in the history
* Check for update-port script existing instead of being executable (#2593)

#2459

* Fixed TWC paths (#2600)

* add docker build caching to workflow (#2609)

* Privoxy eth0 fixes, healthcheck comparison tweak and start.sh update (#2610)

* by checking for existence of default 127 address,healthcheck will never effectively run, as the non-default eth0 ip will never be matched

* the comparison was not trimming off the port, thus healthcheck was always going to fail or denote a change when there may have been none

* simplified the comparison (thanks @edgd1er )

* Strip double quotes from umask check (#2601)

* Fix problem with enabled UFW with Random Ports (#2603)

Fixing #2255

---------

Co-authored-by: Geoff <geoff@gapple.ca>
Co-authored-by: ksurl <ksurl@users.noreply.github.com>
Co-authored-by: HeavyGee <133152184+heavygee@users.noreply.github.com>
Co-authored-by: WitchRecipe <77073792+WitchRecipe@users.noreply.github.com>
  • Loading branch information
5 people committed May 12, 2023
1 parent a9b39e4 commit f96b555
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/image-build-template-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow}}
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ RUN echo "installing Transmission" && set -x \
&& apt-get update && apt-get install -y \
software-properties-common dumb-init openvpn privoxy \
tzdata dnsutils iputils-ping ufw openssh-client git jq curl wget unrar unzip bc \
&& ln -s /usr/share/transmission/web/style /opt/transmission-ui/transmission-web-control \
&& ln -s /usr/share/transmission/web/images /opt/transmission-ui/transmission-web-control \
&& ln -s /usr/share/transmission/web/javascript /opt/transmission-ui/transmission-web-control \
&& ln -s /usr/share/transmission/web/index.html /opt/transmission-ui/transmission-web-control/index.original.html \
&& ln -s /usr/local/share/transmission/public_html/images /opt/transmission-ui/transmission-web-control \
&& ln -s /usr/local/share/transmission/public_html/transmission-app.js /opt/transmission-ui/transmission-web-control/transmission-app.js \
&& ln -s /usr/local/share/transmission/public_html/index.html /opt/transmission-ui/transmission-web-control/index.original.html \
&& rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* \
&& groupmod -g 1000 users \
&& useradd -u 911 -U -d /config -s /bin/false abc \
Expand Down
8 changes: 7 additions & 1 deletion openvpn/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,13 @@ function ufwAllowPort {
portNum=${1}
if [[ "${ENABLE_UFW,,}" == "true" ]] && [[ -n "${portNum-}" ]]; then
echo "allowing ${portNum} through the firewall"
ufw allow ${portNum}
if [[ $portNum == *":"* ]];
then
ufw allow ${portNum}/tcp
ufw allow ${portNum}/udp
else
ufw allow ${portNum}
fi
fi
}

Expand Down
2 changes: 1 addition & 1 deletion privoxy/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set_port()
# Set the port for the IPv4 interface
adr=$(ip -4 a show eth0| grep -oP "(?<=inet )([^/]+)")
adr=${adr:-"0.0.0.0"}
sed -i -E "s/^listen-address\s+127.*/listen-address ${adr}:$1/" "$2"
sed -i -E "s/^listen-address\s+.*/listen-address ${adr}:$1/" "$2"

# Remove the listen-address for IPv6 for now. IPv6 compatibility should come later
sed -i -E "s/^listen-address\s+\[\:\:1.*//" "$2"
Expand Down
2 changes: 1 addition & 1 deletion scripts/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if [[ ${WEBPROXY_ENABLED} =~ [yY][eE]?[Ss]?|[tT][Rr][Uu][eE] ]]; then
if [[ ${PROXY} -eq 0 ]]; then
echo "Privoxy warning: process was stopped, restarting."
fi
proxy_ip=$(grep -oP "(?<=^listen-address).*$" /etc/privoxy/config | sed 's/ //g')
proxy_ip=$(grep -oP "(?<=^listen-address )[0-9\.]+" /etc/privoxy/config)
cont_ip=$(ip -j a show dev eth0 | jq -r .[].addr_info[].local)
if [[ ${proxy_ip} != ${cont_ip} ]]; then
echo "Privoxy error: container ip (${cont_ip} has changed: privoxy listening to ${proxy_ip}, restarting privoxy."
Expand Down
2 changes: 1 addition & 1 deletion transmission/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ exec su --preserve-environment ${RUN_AS} -s /bin/bash -c "/usr/local/bin/transmi


# Configure port forwarding if applicable
if [[ -x /etc/openvpn/${OPENVPN_PROVIDER,,}/update-port.sh && (-z $DISABLE_PORT_UPDATER || "false" = "$DISABLE_PORT_UPDATER") ]]; then
if [[ -f /etc/openvpn/${OPENVPN_PROVIDER,,}/update-port.sh && (-z $DISABLE_PORT_UPDATER || "false" = "$DISABLE_PORT_UPDATER") ]]; then
echo "Provider ${OPENVPN_PROVIDER^^} has a script for automatic port forwarding. Will run it now."
echo "If you want to disable this, set environment variable DISABLE_PORT_UPDATER=true"
exec /etc/openvpn/${OPENVPN_PROVIDER,,}/update-port.sh &
Expand Down
2 changes: 1 addition & 1 deletion transmission/userSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
if [ -z "$TRANSMISSION_UMASK" ] ; then
# fetch from settings.json if not defined in environment
# because updateSettings.py is called after this script is run
TRANSMISSION_UMASK=$(jq .umask ${TRANSMISSION_HOME}/settings.json)
TRANSMISSION_UMASK=$(jq .umask ${TRANSMISSION_HOME}/settings.json | tr -d \" )
fi

TRANSMISSION_UMASK_OCTAL=$( printf "%o\n" "${TRANSMISSION_UMASK}" )
Expand Down

0 comments on commit f96b555

Please sign in to comment.