Skip to content

Commit

Permalink
update master (#2696)
Browse files Browse the repository at this point in the history
* Add Transmissionic Web UI & New Documentation (#2589)

* Added step to build a .deb file to install and reduce image size (#2590)

* Added step to build a .deb file to install and reduce image size

* Fixed deb install incorrectly done

* 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

* move vpn config download to /config (#2592)

* move vpn config download to /config

* fix git safe dir permissions

* cleanup vpn config clone

* re-add zip dl, set git to default

* use alpine:latest for TransmissionUIs build stage (#2573)

* Update fetch-external-configs.sh

removed duplicate bracket

* Update to transmission 4.0.4

* Update configure-openvpn.sh

* Switched the order of events, to remove the ipv6 before sed-ing the address (#2695)

* Create separate image for transmission build from source (#2691)

* separate transmission build to separate image and workflow

* set transmission-builder version

* use matrix for multi runner builds

* fix context

* parallel docker builds with matrix (#2694)

* consolidate and parallelize image build with matrix multi runner build

* fix image name

* Update Dockerfile

fixed typo

* `TRANSMISSION_RPC_URL` option causes a moved permanently error when using PIA (#2657)

* Respect option `TRANSMISSION_RPC_URL`

remove debug echo

* default `TRANSMISSION_RPC_URL` is now grabbed from `default-settings.json`

* Stricter grep pattern

* Remove redundant grep

* Added comment

* Use `jq` instead of `sed` to determine the default of `TRANSMISSION_RPC_URL`

---------

Co-authored-by: Mark Honkoop <[email protected]>

* Fix for PR #2691 (#2698)

* separate transmission build to separate image and workflow

* set transmission-builder version

* use matrix for multi runner builds

* fix context

* Fix file name

* fix image name

---------

Co-authored-by: Anastasiya Polina Soyka <[email protected]>
Co-authored-by: Geoff <[email protected]>
Co-authored-by: ksurl <[email protected]>
Co-authored-by: HeavyGee <[email protected]>
Co-authored-by: WitchRecipe <[email protected]>
Co-authored-by: Florian Kretschmer <[email protected]>
Co-authored-by: Aemulation <[email protected]>
Co-authored-by: Mark Honkoop <[email protected]>
  • Loading branch information
9 people authored Sep 4, 2023
1 parent 4829920 commit 83dc92c
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 66 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-transmission-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Transmission Version Check

on:
schedule:
- cron: 0 * * * *
workflow_dispatch: {}

jobs:
get-transmission-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: dev

- name: Check for new version of Transmission
run: |
LATEST_VERSION=$(curl -L https://api.github.com/repos/transmission/transmission/releases/latest | grep tag_name | sed -e 's/:\|,\|"//g' | awk '{print $2}')
CURRENT_VERSION=$(cat upstream/transmission-version.txt)
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then
echo "$LATEST_VERSION" > upstream/transmission-version.txt
git add upstream/transmission-version.txt
git commit -m "update transmission build version to ${LATEST_VERSION}"
git push origin dev
fi
78 changes: 60 additions & 18 deletions .github/workflows/docker-image-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,65 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-main-images:
uses: ./.github/workflows/image-build-template-workflow.yml
with:
image-name: haugene/transmission-openvpn
build-context: '.'
secrets: inherit
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image-name: haugene/transmission-openvpn
context: ./
- image-name: haugene/transmission-openvpn-proxy
context: ./proxy
- image-name: haugene/transmission-rss
context: ./plugins/rss
platform:
- linux/amd64
- linux/arm
- linux/arm64
steps:
- name: Checkout code
uses: actions/checkout@v3

build-proxy-images:
uses: ./.github/workflows/image-build-template-workflow.yml
with:
image-name: haugene/transmission-openvpn-proxy
build-context: 'proxy'
secrets: inherit
# QEMU emulator to build for other platforms
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

build-rss-plugin-images:
uses: ./.github/workflows/image-build-template-workflow.yml
with:
image-name: haugene/transmission-rss
build-context: 'plugins/rss'
secrets: inherit
# Buildx automates creating the multi-arch manifest build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Authenticate so that we can push to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Generate image tags and labels
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ matrix.image-name }}
tags: |
type=edge
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# Finally, build and push the images
- name: Build image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
platforms: ${{ matrix.platform }}
build-args: |
REVISION=${{ github.sha }}
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}}
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
name: Reusable workflow for building multi-arch images
name: Transmission Builds

on:
workflow_call:
inputs:
image-name:
required: true
type: string

build-context:
required: true
type: string
push:
branches:
- dev
paths:
- upstream/transmission-version.txt

jobs:
setup-build-push:
build-transmission:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm
- linux/arm64
steps:
- name: Checkout code
uses: actions/checkout@v3

# Get latest version of Transmission
- name: Get Transmission version
run: |
LATEST_VERSION=$(cat upstream/transmission-version.txt)
echo "TBT_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
# QEMU emulator to build for other platforms
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -33,29 +42,24 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Generate image tags and labels
# Generate image tag and labels
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ inputs.image-name }}
tags: |
type=edge
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# Finally, build and push the images
images: haugene/transmission-builder
tags: type=match,pattern=(\d+.\d+.\d+),group=1,value=${{ env.TBT_VERSION }}

# Finally, build and push the image
- name: Build image
uses: docker/build-push-action@v4
with:
context: ${{ inputs.build-context }}
platforms: linux/arm,linux/arm64,linux/amd64
context: upstream
platforms: ${{ matrix.platform }}
build-args: |
REVISION=${{ github.sha }}
push: ${{ github.event_name != 'pull_request' }}
TBT_VERSION=${{ env.TBT_VERSION }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
Expand Down
18 changes: 1 addition & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,7 @@ RUN set -ex; \
libpsl-dev \
libssl-dev


FROM base as TransmissionBuilder

ARG DEBIAN_FRONTEND=noninteractive
ARG TBT_VERSION=4.0.4

RUN apt-get update && apt-get install -y curl \
build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev \
libglib2.0-dev libevent-dev libminiupnpc-dev libgtk-3-dev libappindicator3-dev libssl-dev cmake xz-utils checkinstall


RUN mkdir -p /home/transmission4/ && cd /home/transmission4/ \
&& curl -L -o transmission4.tar.xz "https://github.com/transmission/transmission/releases/download/4.0.4/transmission-4.0.4.tar.xz" \
&& tar -xf transmission4.tar.xz && cd transmission-4.0.4* && mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make && make install \
&& checkinstall -y -D --pkgname transmission --pakdir /var/tmp --pkgversion=${TBT_VERSION}

FROM haugene/transmission-builder:4.0.4 as TransmissionBuilder

FROM base

Expand Down
14 changes: 10 additions & 4 deletions openvpn/pia/update-port.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ transmission_passwd=$(tail -1 ${TRANSMISSION_PASSWD_FILE})
pia_client_id_file=/etc/transmission/pia_client_id
transmission_settings_file=${TRANSMISSION_HOME}/settings.json

if [[ -z "${TRANSMISSION_RPC_URL}" ]]; then
# Fetch the default setting for `rpc-url`.
TRANSMISSION_RPC_URL="$(jq -r '."rpc-url"' /etc/transmission/default-settings.json)"
fi
TRANSMISSION_HOST="$(echo "http://localhost:${TRANSMISSION_RPC_PORT}${TRANSMISSION_RPC_URL}" | sed -E 's/(\/)$//g')"

sleep 5

###### PIA Variables ######
Expand Down Expand Up @@ -96,13 +102,13 @@ fi

# make sure transmission is running and accepting requests
echo "waiting for transmission to become responsive"
until torrent_list="$(transmission-remote $TRANSMISSION_RPC_PORT $myauth -l)"; do sleep 10; done
until torrent_list="$(transmission-remote "${TRANSMISSION_HOST}" $myauth -l)"; do sleep 10; done
echo "transmission became responsive"
output="$(echo "$torrent_list" | tail -n 2)"
echo "$output"

# get current listening port
transmission_peer_port=$(transmission-remote $TRANSMISSION_RPC_PORT $myauth -si | grep Listenport | grep -oE '[0-9]+')
transmission_peer_port=$(transmission-remote "${TRANSMISSION_HOST}" $myauth -si | grep Listenport | grep -oE '[0-9]+')
if [[ "$new_port" != "$transmission_peer_port" ]]; then
if [[ "true" = "$ENABLE_UFW" ]]; then
echo "Update UFW rules before changing port in Transmission"
Expand All @@ -115,11 +121,11 @@ if [[ "$new_port" != "$transmission_peer_port" ]]; then
fi

echo "setting transmission port to $new_port"
transmission-remote ${TRANSMISSION_RPC_PORT} ${myauth} -p "$new_port"
transmission-remote "${TRANSMISSION_HOST}" ${myauth} -p "$new_port"

echo "Checking port..."
sleep 10
transmission-remote ${TRANSMISSION_RPC_PORT} ${myauth} -pt
transmission-remote "${TRANSMISSION_HOST}" ${myauth} -pt
else
echo "No action needed, port hasn't changed"
fi
Expand Down
5 changes: 3 additions & 2 deletions privoxy/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ set_port()

echo "Privoxy: Setting port to $1";

# Remove the listen-address for IPv6 for now. IPv6 compatibility should come later
sed -i -E "s/^listen-address\s+\[\:\:1.*//" "$2"

# 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+.*/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"
}

if [[ "${WEBPROXY_ENABLED}" = "true" ]]; then
Expand Down
41 changes: 41 additions & 0 deletions upstream/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
ARG TBT_VERSION=4.0.4

RUN set -ex; \
apt-get update; \
apt-get dist-upgrade -y; \
apt-get install -y --no-install-recommends \
automake \
autoconf \
build-essential \
ca-certificates \
checkinstall \
cmake \
curl \
intltool \
iproute2 \
libappindicator3-dev \
libcurl4-openssl-dev \
libdeflate-dev \
libevent-dev \
libfmt-dev \
libglib2.0-dev \
libgtk-3-dev \
libminiupnpc-dev \
libnatpmp-dev \
libpsl-dev \
libssl-dev \
libtool \
nano \
net-tools \
pkg-config \
tzdata \
xz-utils

RUN mkdir -p /home/transmission4/ && cd /home/transmission4/ \
&& curl -L -o transmission4.tar.xz "https://github.com/transmission/transmission/releases/download/${TBT_VERSION}/transmission-${TBT_VERSION}.tar.xz" \
&& tar -xf transmission4.tar.xz && cd "transmission-${TBT_VERSION}" && mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make && make install \
&& checkinstall -y -D --pkgname transmission --pakdir /var/tmp --pkgversion=${TBT_VERSION}
1 change: 1 addition & 0 deletions upstream/transmission-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.4

0 comments on commit 83dc92c

Please sign in to comment.