diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 531a3ba9fa..900b4ca815 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -28,7 +28,7 @@ body: - type: checkboxes attributes: label: Is this related to a provider? - description: Please check the provider issues repo for this. If this issue is related to a provider, please post it there. + description: Please check the provider issues repo for this. If this issue is related to a provider, please post it there. If your error is after this log output it has to do with provider script 'Transmission startup script complete. Initialization Sequence Completed' options: - label: I have checked the provider repo for issues required: true diff --git a/.github/workflows/check-transmission-releases.yml b/.github/workflows/check-transmission-releases.yml index 330acf21d4..35053f46f5 100644 --- a/.github/workflows/check-transmission-releases.yml +++ b/.github/workflows/check-transmission-releases.yml @@ -10,17 +10,25 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: + token: ${{ secrets.PAT }} 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 | awk '{print $2}' | sed -e 's/"//g' -e 's/,//') - CURRENT_VERSION=$(cat upstream/transmission-version.txt) - if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then + LATEST_SHA=$(curl -L https://api.github.com/repos/transmission/transmission/tags | tac | tac | awk '/sha/ {print $2; exit}' | sed -e 's/[",]//g') + LATEST_VERSION=$(curl -L https://api.github.com/repos/transmission/transmission/releases/latest | awk '/tag_name/ {print $2}' | sed -e 's/[",]//g') + CURRENT_SHA=$(cat upstream/transmission-sha.txt) + if [ "$LATEST_SHA" != "$CURRENT_SHA" -a -n "$LATEST_SHA" -a -n "$LATEST_VERSION" ]; then + echo "$LATEST_SHA" > upstream/transmission-sha.txt echo "$LATEST_VERSION" > upstream/transmission-version.txt + git config --global user.email "workflow@github.com" + git config --global user.name "workflow runner" + git add upstream/transmission-sha.txt git add upstream/transmission-version.txt + git config user.email "transmission-bot@users.noreply.github.com" + git config user.name "Transmission-Bot" git commit -m "update transmission build version to ${LATEST_VERSION}" git push origin dev fi diff --git a/.github/workflows/docker-image-builds.yml b/.github/workflows/docker-image-builds.yml index 959d7d0575..a231edce8e 100644 --- a/.github/workflows/docker-image-builds.yml +++ b/.github/workflows/docker-image-builds.yml @@ -24,25 +24,21 @@ jobs: 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 + uses: actions/checkout@v4 # QEMU emulator to build for other platforms - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # Buildx automates creating the multi-arch manifest build - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 # Authenticate so that we can push to Docker Hub - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -50,7 +46,7 @@ jobs: # Generate image tags and labels - name: Generate Docker metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ matrix.image-name }} @@ -63,10 +59,10 @@ jobs: # Finally, build and push the images - name: Build image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ matrix.context }} - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm,linux/arm64 build-args: | REVISION=${{ github.sha }} push: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/docker-transmission-builds.yml b/.github/workflows/docker-transmission-builds.yml index ef5683df91..c8f67fa878 100644 --- a/.github/workflows/docker-transmission-builds.yml +++ b/.github/workflows/docker-transmission-builds.yml @@ -11,16 +11,9 @@ on: jobs: 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 + uses: actions/checkout@v4 # Get latest version of Transmission - name: Get Transmission version @@ -30,15 +23,15 @@ jobs: # QEMU emulator to build for other platforms - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # Buildx automates creating the multi-arch manifest build - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 # Authenticate so that we can push to Docker Hub - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -46,17 +39,17 @@ jobs: # Generate image tag and labels - name: Generate Docker metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: 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 + uses: docker/build-push-action@v6 with: context: upstream - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm,linux/arm64 build-args: | REVISION=${{ github.sha }} TBT_VERSION=${{ env.TBT_VERSION }} diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 2351e43634..5e995bf6fb 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -3,16 +3,18 @@ on: push: branches: - master + paths: + - docs/* jobs: build-and-deploy-gh-pages: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7 diff --git a/Dockerfile b/Dockerfile index dc329d652f..77f427bb75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,9 +39,10 @@ RUN set -ex; \ libminiupnpc-dev \ libnatpmp-dev \ libpsl-dev \ - libssl-dev + libssl-dev \ + natpmpc -FROM haugene/transmission-builder:4.0.4 as TransmissionBuilder +FROM haugene/transmission-builder:4.0.5 as TransmissionBuilder FROM base @@ -51,7 +52,7 @@ VOLUME /config COPY --from=TransmissionUIs /opt/transmission-ui /opt/transmission-ui COPY --from=TransmissionBuilder /var/tmp/*.deb /var/tmp/ -ARG TBT_VERSION=4.0.4 +ARG TBT_VERSION=4.0.5 ARG DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -126,7 +127,7 @@ ARG REVISION ENV REVISION=${REVISION:-""} # Compatability with https://hub.docker.com/r/willfarrell/autoheal/ -LABEL autoheal=true +LABEL autoheal="true" # Expose ports and run diff --git a/README.md b/README.md index b44c1dcd6a..a8306c7db1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # OpenVPN and Transmission with WebUI +[![Docker Build](https://img.shields.io/github/actions/workflow/status/haugene/docker-transmission-openvpn/docker-image-builds.yml +)](https://hub.docker.com/r/haugene/transmission-openvpn/) [![Docker Pulls](https://img.shields.io/docker/pulls/haugene/transmission-openvpn.svg)](https://hub.docker.com/r/haugene/transmission-openvpn/) This container contains OpenVPN and Transmission with a configuration @@ -43,7 +45,26 @@ $ docker run --cap-add=NET_ADMIN -d \ haugene/transmission-openvpn ``` -### Docker Compose +### Podman run + +Beware: container is run as privileged, meaning it has full access to host OS. + +``` +$ podman run --privileged -d \ + -v /your/storage/path/:/data \ + -v /your/config/path/:/config \ + -e OPENVPN_PROVIDER=PIA \ + -e OPENVPN_CONFIG=france \ + -e OPENVPN_USERNAME=user \ + -e OPENVPN_PASSWORD=pass \ + -e LOCAL_NETWORK=192.168.0.0/16 \ + --log-driver k8s-file \ + --log-opt max-size=10m \ + -p 9091:9091 \ + haugene/transmission-openvpn +``` + +### Docker version 3.x Compose ``` version: '3.3' services: @@ -68,6 +89,32 @@ services: image: haugene/transmission-openvpn ``` +### Docker version 2.x Compose +``` +version: "2.0" +services: + transmission-openvpn: + container_name: transmission + cap_add: + - NET_ADMIN + volumes: + - '/your/storage/path/:/data' + - '/your/config/path/:/config' + environment: + - OPENVPN_PROVIDER=PIA + - OPENVPN_CONFIG=france + - OPENVPN_USERNAME=user + - OPENVPN_PASSWORD=pass + - LOCAL_NETWORK=192.168.0.0/16 + logging: + driver: "json-file" + options: + max-size: 10m + ports: + - 9091:9091 + image: haugene/transmission-openvpn +``` + ## Known issues If you've been running a stable setup that has recently started to fail, please check your logs. diff --git a/docs/provider-specific.md b/docs/provider-specific.md index 346d0138c3..6de4984ba6 100644 --- a/docs/provider-specific.md +++ b/docs/provider-specific.md @@ -118,3 +118,74 @@ services: max-size: 10m image: haugene/transmission-openvpn:latest ``` + +### PROTONVPN + +[PROTONVPN](https://protonvpn.com/support/linux-openvpn/#preparation) provides `.ovpn` configuration files. Just download the one you want to connect with and which allows P2P. + +### Prerequisites: +User needs to have a paid account. + +1. download your ProtonVPN ovpn file from a destination which allows P2P. +2. in the directory with your docker-compose file, create a directory: `mkdir protonvpn` +3. copy your ovpn file (node-.protonvpn.udp.ovpn) from step 1 to the protonvpn directory +4. add the environment vars below and add +pmp to your username if you want to use port forwarding. +5. add the [update-port.sh](https://github.com/haugene/vpn-configs-contrib/blob/main/openvpn/protonvpn/update-port.sh) script for ProtonVPN from vpn-configs-contrib to the protonvpn directory of step 2. + +Here is a full example of `docker-compose.yml` file, assuming configuration file named `node-.protonvpn.udp` +is under local `protonvpn` subdirectory. + +```yaml +version: 3.7.1 +services: + transmission-openvpn: + container_name: TransmissionVPN + restart: on-failure:2 + cap_add: + - NET_ADMIN + volumes: + - ./protonvpn/:/etc/openvpn/custom/ + - /your/config/path/:/config # where transmission-home is stored + - /your/storage/path/:/data # where transmission will store the data + environment: + - OPENVPN_PROVIDER=custom + - OPENVPN_CONFIG=node-.protonvpn.udp + - OPENVPN_USERNAME=+pmp + - OPENVPN_PASSWORD= + - LOCAL_NETWORK=192.168.0.0/16 + logging: + driver: json-file + options: + max-size: 10m + ports: + - 9091:9091 + image: haugene/transmission-openvpn + +``` + + +After starting your container, the `peer listening port` in Transmission should be open after a minute or so. + +If not you can jump in the container and run the script manually and see which error you get, or set the debug env variable: `- DEBUG=true` and look in the logging of your container for the output of the script `update-port.sh` + + +To check which IP address your VPN is currently connected to, run this script: +```bash +#!/bin/bash + +f_container_name() +{ +docker ps --format "{{.Names}}"| grep -i transmission +} + +f_find_all() +{ +curl --silent ipinfo.io/$ext_ip +} + +var_cont_name=$(f_container_name) +ext_ip=$(docker exec $var_cont_name curl --silent "http://ipinfo.io/ip") +echo "Transmission VPN currently connected to IP address: $ext_ip" +echo "This IP address is in the following country: " +f_find_all +``` diff --git a/docs/tips-tricks.md b/docs/tips-tricks.md index 6d1b40a3df..e29df36c50 100755 --- a/docs/tips-tricks.md +++ b/docs/tips-tricks.md @@ -213,7 +213,7 @@ $ sudo systemctl start transmission-openvpn.service A working example of running this container behind a traefik reverse proxy can be found here: [Config](https://github.com/haugene/docker-transmission-openvpn/issues/1763#issuecomment-844404143) -#### Running this container with Podman +# Running this container with Podman The `podman run` command is almost identical to [the one mentioned in README.md](../README.md#docker-run) but with the following exception: diff --git a/openvpn/fetch-external-configs.sh b/openvpn/fetch-external-configs.sh index 82192f6ff2..486d597b87 100755 --- a/openvpn/fetch-external-configs.sh +++ b/openvpn/fetch-external-configs.sh @@ -64,7 +64,7 @@ elif [[ "${VPN_CONFIG_SOURCE_TYPE}" == "github_clone" ]]; then git -C "${config_repo}" checkout "${GITHUB_CONFIG_SOURCE_REVISION}" else echo "Cloning ${GITHUB_CONFIG_REPO_URL} into ${config_repo}" - config_repo_old="${config_repo}" + "_old" + config_repo_old="${config_repo}_old" mv "${config_repo}" "${config_repo_old}" git clone -b "${GITHUB_CONFIG_SOURCE_REVISION}" "${GITHUB_CONFIG_REPO_URL}" "${config_repo}" fi diff --git a/openvpn/nordvpn/configure-openvpn.sh b/openvpn/nordvpn/configure-openvpn.sh index 5d785f4ab9..8e547d8e7e 100755 --- a/openvpn/nordvpn/configure-openvpn.sh +++ b/openvpn/nordvpn/configure-openvpn.sh @@ -7,7 +7,7 @@ # # NORDVPN_COUNTRY: code or name # curl -s "https://api.nordvpn.com/v1/servers/countries" | jq --raw-output '.[] | [.code, .name] | @tsv' -# NORDVPN_PROTOCOL: tcp or upd, tcp if none or unknown. Many technologies are not used as only openvpn_udp and openvpn_tcp are tested. +# NORDVPN_PROTOCOL: tcp or udp, tcp if none or unknown. Many technologies are not used as only openvpn_udp and openvpn_tcp are tested. # Will request api with openvpn_. # curl -s "https://api.nordvpn.com/v1/technologies" | jq --raw-output '.[] | [.identifier, .name ] | @tsv' | grep openvpn # NORDVPN_CATEGORY: default p2p. not all countries have all combination of NORDVPN_PROTOCOL(technologies) and NORDVPN_CATEGORY(groups), @@ -390,4 +390,4 @@ fi export OPENVPN_CONFIG=${selected} -cd "${0%/*}" \ No newline at end of file +cd "${0%/*}" diff --git a/privoxy/scripts/start.sh b/privoxy/scripts/start.sh index 54c196d664..6ed884d99f 100755 --- a/privoxy/scripts/start.sh +++ b/privoxy/scripts/start.sh @@ -30,8 +30,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+.*/listen-address ${adr}:$1/" "$2" - + sed -i -E "s/^listen-address.*/listen-address ${adr}:$1/" "$2" } if [[ "${WEBPROXY_ENABLED}" = "true" ]]; then diff --git a/scripts/healthcheck.sh b/scripts/healthcheck.sh index bb431e8645..e7c130ab13 100755 --- a/scripts/healthcheck.sh +++ b/scripts/healthcheck.sh @@ -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 )[0-9\.]+" /etc/privoxy/config) + proxy_ip=$(grep -i "^listen-address" /etc/privoxy/config | awk -F ' ' '{print $2}' | awk -F ':' '{print $1}') 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." diff --git a/upstream/Dockerfile b/upstream/Dockerfile index 0908685ad2..50bdfbcfcb 100644 --- a/upstream/Dockerfile +++ b/upstream/Dockerfile @@ -33,7 +33,7 @@ RUN set -ex; \ pkg-config \ tzdata \ xz-utils - +#This will build the transmission image to re-use in our container 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 \ diff --git a/upstream/transmission-version.txt b/upstream/transmission-version.txt index 7d666cb219..7636e75650 100644 --- a/upstream/transmission-version.txt +++ b/upstream/transmission-version.txt @@ -1 +1 @@ -4.0.4 \ No newline at end of file +4.0.5