mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Creation of transmission openvpn
This commit is contained in:
1
transmission_openvpn/CHANGELOG.md
Normal file
1
transmission_openvpn/CHANGELOG.md
Normal file
@@ -0,0 +1 @@
|
||||
- Initial build
|
||||
94
transmission_openvpn/Dockerfile
Normal file
94
transmission_openvpn/Dockerfile
Normal file
@@ -0,0 +1,94 @@
|
||||
#============================#
|
||||
# ALEXBELGIUM'S DOCKERFILE #
|
||||
#============================#
|
||||
# _.------.
|
||||
# _.-` ('>.-`"""-.
|
||||
# '.--'` _'` _ .--.)
|
||||
# -' '-.-';` `
|
||||
# ' - _.' ``'--.
|
||||
# '---` .-'""`
|
||||
# /`
|
||||
#=== Home Assistant Addon ===#
|
||||
|
||||
#################
|
||||
# 1 Build Image #
|
||||
#################
|
||||
|
||||
ARG BUILD_FROM
|
||||
ARG BUILD_VERSION
|
||||
ARG BUILD_UPSTREAM=4.0
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
##################
|
||||
# 2 Modify Image #
|
||||
##################
|
||||
|
||||
# MOFIFY DATA PATH
|
||||
ENV TRANSMISSION_HOME="/addons_config/transmission" \
|
||||
CREATE_TUN_DEVICE=false
|
||||
|
||||
##################
|
||||
# 3 Install apps #
|
||||
##################
|
||||
|
||||
# Add rootfs
|
||||
COPY rootfs/ /
|
||||
|
||||
# Modules
|
||||
ARG MODULES="00-banner.sh 90-dns_set.sh 92-local_mounts.sh 92-smb_mounts.sh "
|
||||
|
||||
# Automatic modules download
|
||||
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& mkdir -p /etc/cont-init.d \
|
||||
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
|
||||
&& chmod -R 755 /etc/cont-init.d || printf '%s\n' "${MODULES}" >/MODULESFILE
|
||||
|
||||
# Manual apps
|
||||
ENV PACKAGES=""
|
||||
|
||||
# Automatic apps & bashio
|
||||
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
|
||||
&& chmod 777 /automatic_packages.sh \
|
||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||
&& rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
|
||||
|
||||
################
|
||||
# 4 Entrypoint #
|
||||
################
|
||||
|
||||
RUN chmod 777 /entrypoint.sh
|
||||
CMD [ "/entrypoint.sh" ]
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
############
|
||||
# 5 Labels #
|
||||
############
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
ARG BUILD_NAME
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_REPOSITORY
|
||||
ARG BUILD_VERSION
|
||||
LABEL \
|
||||
io.hass.name="${BUILD_NAME}" \
|
||||
io.hass.description="${BUILD_DESCRIPTION}" \
|
||||
io.hass.arch="${BUILD_ARCH}" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.version=${BUILD_VERSION} \
|
||||
maintainer="alexbelgium (https://github.com/alexbelgium)" \
|
||||
org.opencontainers.image.title="${BUILD_NAME}" \
|
||||
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
||||
org.opencontainers.image.vendor="Home Assistant Add-ons" \
|
||||
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
|
||||
org.opencontainers.image.licenses="MIT" \
|
||||
org.opencontainers.image.url="https://github.com/alexbelgium" \
|
||||
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
|
||||
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
|
||||
org.opencontainers.image.created=${BUILD_DATE} \
|
||||
org.opencontainers.image.revision=${BUILD_REF} \
|
||||
org.opencontainers.image.version=${BUILD_VERSION}
|
||||
44
transmission_openvpn/README.md
Normal file
44
transmission_openvpn/README.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Home assistant add-on: Transmission Openvpn
|
||||
|
||||
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
[](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
|
||||
[](https://github.com/marketplace/actions/super-linter)
|
||||
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/builder.yaml)
|
||||
|
||||
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
||||
|
||||
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
|
||||
|
||||
[](https://github.com/alexbelgium/hassio-addons/stargazers)
|
||||
|
||||
## About
|
||||
|
||||
Transmission is a bittorrent client.
|
||||
This addon is based on the [Haugene docker image](https://github.com/haugene/docker-transmission-openvpn).
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Hass.io add-on.
|
||||
|
||||
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance.
|
||||
1. Install this add-on.
|
||||
1. Click the `Save` button to store your configuration.
|
||||
1. Start the add-on.
|
||||
1. Check the logs of the add-on to see if everything went well.
|
||||
1. Carefully configure the add-on to your preferences, see the official documentation for for that.
|
||||
|
||||
## Configuration
|
||||
|
||||
Options : see https://github.com/haugene/docker-transmission-openvpn for documentation
|
||||
|
||||
Complete transmission options are in /config/addons_config/transmission (make sure addon is stopped before modifying it as Transmission writes its ongoing values when stopping and could erase your changes)
|
||||
|
||||
Webui can be found at `<your-ip>:9091`.
|
||||
|
||||
[repository]: https://github.com/alexbelgium/hassio-addons
|
||||
57
transmission_openvpn/apparmor.txt
Normal file
57
transmission_openvpn/apparmor.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
#include <tunables/global>
|
||||
|
||||
profile db21ed7f_transmission_openvpn flags=(attach_disconnected,mediate_deleted) {
|
||||
#include <abstractions/base>
|
||||
|
||||
capability,
|
||||
file,
|
||||
signal,
|
||||
mount,
|
||||
umount,
|
||||
remount,
|
||||
network udp,
|
||||
network tcp,
|
||||
network dgram,
|
||||
network stream,
|
||||
network inet,
|
||||
network inet6,
|
||||
network netlink raw,
|
||||
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
capability sys_admin,
|
||||
capability dac_read_search,
|
||||
# capability dac_override,
|
||||
# capability sys_rawio,
|
||||
|
||||
# S6-Overlay
|
||||
/bin/** ix,
|
||||
/usr/bin/** ix,
|
||||
/usr/lib/bashio/** ix,
|
||||
/etc/s6/** rix,
|
||||
/run/s6/** rix,
|
||||
/etc/services.d/** rwix,
|
||||
/etc/cont-init.d/** rwix,
|
||||
/etc/cont-finish.d/** rwix,
|
||||
/init rix,
|
||||
/var/run/** mrwkl,
|
||||
/var/run/ mrwkl,
|
||||
/dev/i2c-1 mrwkl,
|
||||
# Files required
|
||||
/dev/sda1 mrwkl,
|
||||
/dev/sdb1 mrwkl,
|
||||
/dev/mmcblk0p1 mrwkl,
|
||||
/dev/* mrwkl,
|
||||
/tmp/** mrkwl,
|
||||
/dev/net/tun mrkwl,
|
||||
|
||||
# Data access
|
||||
/data/** rw,
|
||||
|
||||
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
||||
ptrace (trace,read) peer=docker-default,
|
||||
|
||||
# docker daemon confinement requires explict allow rule for signal
|
||||
signal (receive) set=(kill,term) peer=/usr/bin/docker,
|
||||
|
||||
}
|
||||
10
transmission_openvpn/build.json
Normal file
10
transmission_openvpn/build.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"build_from": {
|
||||
"aarch64": "haugene/transmission-openvpn:latest",
|
||||
"amd64": "haugene/transmission-openvpn:latest",
|
||||
"armv7": "haugene/transmission-openvpn:latest"
|
||||
},
|
||||
"codenotary": {
|
||||
"signer": "alexandrep.github@gmail.com"
|
||||
}
|
||||
}
|
||||
108
transmission_openvpn/config.json
Normal file
108
transmission_openvpn/config.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"arch": [
|
||||
"aarch64",
|
||||
"amd64",
|
||||
"armv7"
|
||||
],
|
||||
"codenotary": "alexandrep.github@gmail.com",
|
||||
"description": "Bittorrent client based on linuxserver image",
|
||||
"devices": [
|
||||
"/dev/net/tun",
|
||||
"/dev/sda",
|
||||
"/dev/sdb",
|
||||
"/dev/sdc",
|
||||
"/dev/sdd",
|
||||
"/dev/sde",
|
||||
"/dev/sdf",
|
||||
"/dev/sdg",
|
||||
"/dev/nvme",
|
||||
"/dev/mmcblk",
|
||||
"/dev/sda1",
|
||||
"/dev/sdb1",
|
||||
"/dev/sdc1",
|
||||
"/dev/sdd1",
|
||||
"/dev/sde1",
|
||||
"/dev/sdf1",
|
||||
"/dev/sdg1",
|
||||
"/dev/sda2",
|
||||
"/dev/sdb2",
|
||||
"/dev/sdc2",
|
||||
"/dev/sdd2",
|
||||
"/dev/sde2",
|
||||
"/dev/sdf2",
|
||||
"/dev/sdg2",
|
||||
"/dev/sda3",
|
||||
"/dev/sdb3",
|
||||
"/dev/sda4",
|
||||
"/dev/sdb4",
|
||||
"/dev/nvme0",
|
||||
"/dev/nvme1",
|
||||
"/dev/nvme2"
|
||||
],
|
||||
"image": "ghcr.io/alexbelgium/transmission_openvpn-{arch}",
|
||||
"map": [
|
||||
"config:rw",
|
||||
"share:rw",
|
||||
"media:rw",
|
||||
"ssl"
|
||||
],
|
||||
"name": "Transmission Openvpn",
|
||||
"options": {
|
||||
"PGID": "1000",
|
||||
"PUID": "1000",
|
||||
"DNS_server": "8.8.8.8,1.1.1.1",
|
||||
"TRANSMISSION_WEB_UI": "transmission-web-control",
|
||||
"TRANSMISSION_DOWNLOAD_DIR": "/share/downloads",
|
||||
"TRANSMISSION_INCOMPLETE_DIR": "/share/incomplete",
|
||||
"OPENVPN_PROVIDER": "PIA",
|
||||
"OPENVPN_CONFIG": "france",
|
||||
"OPENVPN_USERNAME": "user",
|
||||
"OPENVPN_PASSWORD": "pass",
|
||||
"LOCAL_NETWORK": "192.168.178.0/16",
|
||||
"TRANSMISSION_DOWNLOAD_DIR": "/addons_config/transmission/downloads",
|
||||
"TRANSMISSION_INCOMPLETE_DIR": "/addons_config/transmission/incomplete",
|
||||
"TRANSMISSION_WATCH_DIR": "/addons_config/transmission/watch_dir",
|
||||
"DEBUG": false
|
||||
},
|
||||
"ports": {
|
||||
"51413/tcp": 51413,
|
||||
"51413/udp": 51413,
|
||||
"9091/tcp": 9091
|
||||
},
|
||||
"ports_description": {
|
||||
"51413/tcp": "Peer port (setup router port forwarding to this port)",
|
||||
"51413/udp": "Peer port (setup router port forwarding to this port)",
|
||||
"9091/tcp": "Web UI port (required)"
|
||||
},
|
||||
"privileged": [
|
||||
"SYS_ADMIN",
|
||||
"DAC_READ_SEARCH",
|
||||
"NET_ADMIN"
|
||||
],
|
||||
"schema": {
|
||||
"PGID": "int",
|
||||
"PUID": "int",
|
||||
"DNS_server": "str?",
|
||||
"cifspassword": "str?",
|
||||
"cifsusername": "str?",
|
||||
"TRANSMISSION_WEB_UI": "list(standard|combustion|kettu|transmission-web-control|flood-for-transmission|shift)",
|
||||
"localdisks": "str?",
|
||||
"networkdisks": "str?",
|
||||
"pass": "str?",
|
||||
"user": "str?",
|
||||
"OPENVPN_PROVIDER": "str",
|
||||
"OPENVPN_CONFIG": "str?",
|
||||
"OPENVPN_USERNAME": "str",
|
||||
"OPENVPN_PASSWORD": "str",
|
||||
"LOCAL_NETWORK": "str",
|
||||
"TRANSMISSION_DOWNLOAD_DIR": "str",
|
||||
"TRANSMISSION_INCOMPLETE_DIR": "str",
|
||||
"TRANSMISSION_WATCH_DIR": "str",
|
||||
"DEBUG": "bool"
|
||||
},
|
||||
"slug": "transmission_openvpn",
|
||||
"startup": "services",
|
||||
"url": "https://github.com/alexbelgium/hassio-addons",
|
||||
"version": "4.0",
|
||||
"webui": "http://[HOST]:[PORT:9091]"
|
||||
}
|
||||
BIN
transmission_openvpn/icon.png
Normal file
BIN
transmission_openvpn/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
transmission_openvpn/logo.png
Normal file
BIN
transmission_openvpn/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
27
transmission_openvpn/rootfs/entrypoint.sh
Normal file
27
transmission_openvpn/rootfs/entrypoint.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
echo "Starting..."
|
||||
|
||||
############################
|
||||
# Backup Dockerfile Script #
|
||||
############################
|
||||
|
||||
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
|
||||
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
fi
|
||||
|
||||
####################
|
||||
# Starting scripts #
|
||||
####################
|
||||
|
||||
for SCRIPTS in /etc/cont-init.d/*; do
|
||||
[ -e "$SCRIPTS" ] || continue
|
||||
echo "$SCRIPTS: executing"
|
||||
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
|
||||
chmod a+x "$SCRIPTS"
|
||||
# Change shebang if no s6 supervision
|
||||
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
|
||||
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
|
||||
done
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# If dockerfile failed install manually
|
||||
|
||||
##############################
|
||||
# Automatic modules download #
|
||||
##############################
|
||||
if [ -e "/MODULESFILE" ]; then
|
||||
MODULES=$(</MODULESFILE)
|
||||
MODULES="${MODULES:-00-banner.sh}"
|
||||
echo "Executing modules script : $MODULES"
|
||||
|
||||
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& mkdir -p /etc/cont-init.d \
|
||||
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
|
||||
&& chmod -R 755 /etc/cont-init.d
|
||||
fi
|
||||
|
||||
#######################
|
||||
# Automatic installer #
|
||||
#######################
|
||||
if [ -e "/ENVFILE" ]; then
|
||||
PACKAGES=$(</ENVFILE)
|
||||
echo "Executing dependency script with custom elements : $PACKAGES"
|
||||
|
||||
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
|
||||
&& chmod 777 /automatic_packages.sh \
|
||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||
&& rm /automatic_packages.sh
|
||||
fi
|
||||
|
||||
if [ -e "/MODULESFILE" ] && [ ! -f /entrypoint.sh ]; then
|
||||
for scripts in $MODULES; do
|
||||
echo "$scripts : executing"
|
||||
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/"$scripts"
|
||||
chmod a+x /etc/cont-init.d/"$scripts"
|
||||
/./etc/cont-init.d/"$scripts" || echo "/etc/cont-init.d/$scripts: exiting $?"
|
||||
rm /etc/cont-init.d/"$scripts"
|
||||
done | tac
|
||||
fi
|
||||
15
transmission_openvpn/rootfs/etc/cont-init.d/99-run.sh
Normal file
15
transmission_openvpn/rootfs/etc/cont-init.d/99-run.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/bashio
|
||||
|
||||
####################
|
||||
# Export variables #
|
||||
####################
|
||||
|
||||
echo "Exporting variables"
|
||||
for k in $(bashio::jq "/data/options.json" 'keys | .[]'); do
|
||||
bashio::log.blue $k=$(bashio::config $k)
|
||||
export $k=$(bashio::config $k)
|
||||
done
|
||||
|
||||
echo ""
|
||||
bashio::log.info "Starting app"
|
||||
/./etc/openvpn/start.sh
|
||||
9
transmission_openvpn/updater.json
Normal file
9
transmission_openvpn/updater.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"github_fulltag": "true",
|
||||
"last_update": "21-05-2022",
|
||||
"repository": "alexbelgium/hassio-addons",
|
||||
"slug": "transmission_openvpn",
|
||||
"source": "github",
|
||||
"upstream_repo": "haugene/docker-transmission-openvpn",
|
||||
"upstream_version": "3.00-r5-ls125"
|
||||
}
|
||||
Reference in New Issue
Block a user