mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-08-16 19:27:07 +02:00
Flood UI (#1663)
* Bundle Flood WebUI Add the Flood WebUI to the default installation of the container. The Flood UI offers no pre-built tarball for installation, so the source is cloned and compiled in a separate stage container. Then the resulting build files are copied to the final image. Build size only increases by ~1MB, but build times are slightly longer due to the added complexity. Resolves #1661 * Update docs to include new supported WebUI
This commit is contained in:
parent
75d0b53642
commit
ab91d6735a
13
Dockerfile
13
Dockerfile
@ -1,3 +1,13 @@
|
|||||||
|
# Build Flood UI seperately to keep image size small
|
||||||
|
FROM node:15.5.1-alpine3.10 AS FloodUIBuilder
|
||||||
|
WORKDIR /tmp/flood
|
||||||
|
|
||||||
|
RUN echo "Build Flood UI" \
|
||||||
|
&& apk add --no-cache git \
|
||||||
|
&& git clone --depth=1 https://github.com/johman10/flood-for-transmission.git . \
|
||||||
|
&& npm install \
|
||||||
|
&& npm run build
|
||||||
|
|
||||||
FROM alpine:3.12
|
FROM alpine:3.12
|
||||||
|
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
@ -24,6 +34,9 @@ RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /et
|
|||||||
&& useradd -u 911 -U -d /config -s /bin/false abc \
|
&& useradd -u 911 -U -d /config -s /bin/false abc \
|
||||||
&& usermod -G users abc
|
&& usermod -G users abc
|
||||||
|
|
||||||
|
# Bring over flood UI from previous build stage
|
||||||
|
COPY --from=FloodUIBuilder /tmp/flood/public /opt/transmission-ui/flood
|
||||||
|
|
||||||
# Add configuration and scripts
|
# Add configuration and scripts
|
||||||
ADD openvpn/ /etc/openvpn/
|
ADD openvpn/ /etc/openvpn/
|
||||||
ADD transmission/ /etc/transmission/
|
ADD transmission/ /etc/transmission/
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
### Required environment options
|
### Required environment options
|
||||||
|
|
||||||
| Variable | Function | Example |
|
| Variable | Function | Example |
|
||||||
| ------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
| ------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||||
| `OPENVPN_PROVIDER` | Sets the OpenVPN provider to use. | `OPENVPN_PROVIDER=provider`. Supported providers and their config values are listed in the table above. |
|
| `OPENVPN_PROVIDER` | Sets the OpenVPN provider to use. | `OPENVPN_PROVIDER=provider`. Supported providers and their config values are listed in the table above. |
|
||||||
@ -6,6 +7,7 @@
|
|||||||
| `OPENVPN_PASSWORD` | Your OpenVPN password | `OPENVPN_PASSWORD=asdf` |
|
| `OPENVPN_PASSWORD` | Your OpenVPN password | `OPENVPN_PASSWORD=asdf` |
|
||||||
|
|
||||||
### Network configuration options
|
### Network configuration options
|
||||||
|
|
||||||
| Variable | Function | Example |
|
| Variable | Function | Example |
|
||||||
| ------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
| ------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||||
| `OPENVPN_CONFIG` | Sets the OpenVPN endpoint to connect to. | `OPENVPN_CONFIG=UK Southampton` |
|
| `OPENVPN_CONFIG` | Sets the OpenVPN endpoint to connect to. | `OPENVPN_CONFIG=UK Southampton` |
|
||||||
@ -18,11 +20,11 @@
|
|||||||
Set a custom timezone in tz database format. Look [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of valid timezones. Defaults to UTC.
|
Set a custom timezone in tz database format. Look [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of valid timezones. Defaults to UTC.
|
||||||
|
|
||||||
| Variable | Function | Example |
|
| Variable | Function | Example |
|
||||||
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
|
| -------- | ------------ | -------- |
|
||||||
| `TZ` | Set Timezone | `TZ=UTC` |
|
| `TZ` | Set Timezone | `TZ=UTC` |
|
||||||
|
|
||||||
|
|
||||||
### Firewall configuration options
|
### Firewall configuration options
|
||||||
|
|
||||||
When enabled, the firewall blocks everything except traffic to the peer port and traffic to the rpc port from the LOCAL_NETWORK and the internal docker gateway.
|
When enabled, the firewall blocks everything except traffic to the peer port and traffic to the rpc port from the LOCAL_NETWORK and the internal docker gateway.
|
||||||
|
|
||||||
If TRANSMISSION_PEER_PORT_RANDOM_ON_START is enabled then it allows traffic to the range of peer ports defined by TRANSMISSION_PEER_PORT_RANDOM_HIGH and TRANSMISSION_PEER_PORT_RANDOM_LOW.
|
If TRANSMISSION_PEER_PORT_RANDOM_ON_START is enabled then it allows traffic to the range of peer ports defined by TRANSMISSION_PEER_PORT_RANDOM_HIGH and TRANSMISSION_PEER_PORT_RANDOM_LOW.
|
||||||
@ -43,6 +45,7 @@ Because your VPN connection can sometimes fail, Docker will run a health check o
|
|||||||
| `HEALTH_CHECK_HOST` | this host is pinged to check if the network connection still works | `google.com` |
|
| `HEALTH_CHECK_HOST` | this host is pinged to check if the network connection still works | `google.com` |
|
||||||
|
|
||||||
### Permission configuration options
|
### Permission configuration options
|
||||||
|
|
||||||
By default the startup script applies a default set of permissions and ownership on the transmission download, watch and incomplete directories. The GLOBAL_APPLY_PERMISSIONS directive can be used to disable this functionality.
|
By default the startup script applies a default set of permissions and ownership on the transmission download, watch and incomplete directories. The GLOBAL_APPLY_PERMISSIONS directive can be used to disable this functionality.
|
||||||
|
|
||||||
| Variable | Function | Example |
|
| Variable | Function | Example |
|
||||||
@ -50,14 +53,15 @@ By default the startup script applies a default set of permissions and ownership
|
|||||||
| `GLOBAL_APPLY_PERMISSIONS` | Disable setting of default permissions | `GLOBAL_APPLY_PERMISSIONS=false` |
|
| `GLOBAL_APPLY_PERMISSIONS` | Disable setting of default permissions | `GLOBAL_APPLY_PERMISSIONS=false` |
|
||||||
|
|
||||||
### Alternative web UIs
|
### Alternative web UIs
|
||||||
You can override the default web UI by setting the ```TRANSMISSION_WEB_HOME``` environment variable. If set, Transmission will look there for the Web Interface files, such as the javascript, html, and graphics files.
|
|
||||||
|
|
||||||
[Combustion UI](https://github.com/Secretmapper/combustion), [Kettu](https://github.com/endor/kettu) and [Transmission-Web-Control](https://github.com/ronggang/transmission-web-control/) come bundled with the container. You can enable either of them by setting```TRANSMISSION_WEB_UI=combustion```, ```TRANSMISSION_WEB_UI=kettu``` or ```TRANSMISSION_WEB_UI=transmission-web-control```, respectively. Note that this will override the ```TRANSMISSION_WEB_HOME``` variable if set.
|
You can override the default web UI by setting the `TRANSMISSION_WEB_HOME` environment variable. If set, Transmission will look there for the Web Interface files, such as the javascript, html, and graphics files.
|
||||||
|
|
||||||
|
[Combustion UI](https://github.com/Secretmapper/combustion), [Kettu](https://github.com/endor/kettu), [Transmission-Web-Control](https://github.com/ronggang/transmission-web-control/), and [Flood](https://github.comjesec/flood) come bundled with the container. You can enable either of them by setting`TRANSMISSION_WEB_UI=combustion`, `TRANSMISSION_WEB_UI=kettu` or `TRANSMISSION_WEB_UI=transmission-web-control`, respectively. Note that this will override the `TRANSMISSION_WEB_HOME` variable if set.
|
||||||
|
|
||||||
| Variable | Function | Example |
|
| Variable | Function | Example |
|
||||||
| ----------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
| ----------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `TRANSMISSION_WEB_HOME` | Set Transmission web home | `TRANSMISSION_WEB_HOME=/path/to/web/ui` |
|
| `TRANSMISSION_WEB_HOME` | Set Transmission web home | `TRANSMISSION_WEB_HOME=/path/to/web/ui` |
|
||||||
| `TRANSMISSION_WEB_UI` | Use the specified bundled web UI | `TRANSMISSION_WEB_UI=combustion`, `TRANSMISSION_WEB_UI=kettu` or `TRANSMISSION_WEB_UI=transmission-web-control` |
|
| `TRANSMISSION_WEB_UI` | Use the specified bundled web UI | `TRANSMISSION_WEB_UI=combustion`, `TRANSMISSION_WEB_UI=kettu`, `TRANSMISSION_WEB_UI=transmission-web-control`, or `TRANSMISSION_WEB_UI=flood` |
|
||||||
|
|
||||||
### Transmission configuration options
|
### Transmission configuration options
|
||||||
|
|
||||||
@ -96,7 +100,7 @@ This might lead to the default route (your untunneled connection) to be used.
|
|||||||
|
|
||||||
To drop the default route set the environment variable `DROP_DEFAULT_ROUTE` to `true`.
|
To drop the default route set the environment variable `DROP_DEFAULT_ROUTE` to `true`.
|
||||||
|
|
||||||
*Note*: This is not compatible with all VPNs. You can check your iptables routing with the `ip r` command in a running container.
|
_Note_: This is not compatible with all VPNs. You can check your iptables routing with the `ip r` command in a running container.
|
||||||
|
|
||||||
### Changing logging locations
|
### Changing logging locations
|
||||||
|
|
||||||
@ -104,7 +108,7 @@ By default Transmission will log to a file in `TRANSMISSION_HOME/transmission.lo
|
|||||||
|
|
||||||
To log to stdout instead set the environment variable `LOG_TO_STDOUT` to `true`.
|
To log to stdout instead set the environment variable `LOG_TO_STDOUT` to `true`.
|
||||||
|
|
||||||
*Note*: By default stdout is what container engines read logs from. Set this to true to have Tranmission logs in commands like `docker logs` and `kubectl logs`. OpenVPN currently only logs to stdout.
|
_Note_: By default stdout is what container engines read logs from. Set this to true to have Tranmission logs in commands like `docker logs` and `kubectl logs`. OpenVPN currently only logs to stdout.
|
||||||
|
|
||||||
### Custom scripts
|
### Custom scripts
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@ if [[ "$4" = "" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If transmission-pre-start.sh exists, run it
|
# If transmission-pre-start.sh exists, run it
|
||||||
if [[ -x /scripts/transmission-pre-start.sh ]]
|
if [[ -x /scripts/transmission-pre-start.sh ]]; then
|
||||||
then
|
|
||||||
echo "Executing /scripts/transmission-pre-start.sh"
|
echo "Executing /scripts/transmission-pre-start.sh"
|
||||||
/scripts/transmission-pre-start.sh "$@"
|
/scripts/transmission-pre-start.sh "$@"
|
||||||
echo "/scripts/transmission-pre-start.sh returned $?"
|
echo "/scripts/transmission-pre-start.sh returned $?"
|
||||||
@ -25,7 +24,7 @@ echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of $1 : $4"
|
|||||||
export TRANSMISSION_BIND_ADDRESS_IPV4=$4
|
export TRANSMISSION_BIND_ADDRESS_IPV4=$4
|
||||||
# Also update the persisted settings in case it is already set. First remove any old value, then add new.
|
# Also update the persisted settings in case it is already set. First remove any old value, then add new.
|
||||||
sed -i '/TRANSMISSION_BIND_ADDRESS_IPV4/d' /etc/transmission/environment-variables.sh
|
sed -i '/TRANSMISSION_BIND_ADDRESS_IPV4/d' /etc/transmission/environment-variables.sh
|
||||||
echo "export TRANSMISSION_BIND_ADDRESS_IPV4=$4" >> /etc/transmission/environment-variables.sh
|
echo "export TRANSMISSION_BIND_ADDRESS_IPV4=$4" >>/etc/transmission/environment-variables.sh
|
||||||
|
|
||||||
if [[ "combustion" = "$TRANSMISSION_WEB_UI" ]]; then
|
if [[ "combustion" = "$TRANSMISSION_WEB_UI" ]]; then
|
||||||
echo "Using Combustion UI, overriding TRANSMISSION_WEB_HOME"
|
echo "Using Combustion UI, overriding TRANSMISSION_WEB_HOME"
|
||||||
@ -42,6 +41,11 @@ if [[ "transmission-web-control" = "$TRANSMISSION_WEB_UI" ]]; then
|
|||||||
export TRANSMISSION_WEB_HOME=/opt/transmission-ui/transmission-web-control
|
export TRANSMISSION_WEB_HOME=/opt/transmission-ui/transmission-web-control
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "flood" = "$TRANSMISSION_WEB_UI" ]]; then
|
||||||
|
echo "Using Transmission Web Control UI, overriding TRANSMISSION_WEB_HOME"
|
||||||
|
export TRANSMISSION_WEB_HOME=/opt/transmission-ui/flood
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Updating Transmission settings.json with values from env variables"
|
echo "Updating Transmission settings.json with values from env variables"
|
||||||
# Ensure TRANSMISSION_HOME is created
|
# Ensure TRANSMISSION_HOME is created
|
||||||
mkdir -p ${TRANSMISSION_HOME}
|
mkdir -p ${TRANSMISSION_HOME}
|
||||||
@ -80,8 +84,7 @@ if [[ -x /etc/openvpn/${OPENVPN_PROVIDER,,}/update-port.sh && -z $DISABLE_PORT_U
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If transmission-post-start.sh exists, run it
|
# If transmission-post-start.sh exists, run it
|
||||||
if [[ -x /scripts/transmission-post-start.sh ]]
|
if [[ -x /scripts/transmission-post-start.sh ]]; then
|
||||||
then
|
|
||||||
echo "Executing /scripts/transmission-post-start.sh"
|
echo "Executing /scripts/transmission-post-start.sh"
|
||||||
/scripts/transmission-post-start.sh "$@"
|
/scripts/transmission-post-start.sh "$@"
|
||||||
echo "/scripts/transmission-post-start.sh returned $?"
|
echo "/scripts/transmission-post-start.sh returned $?"
|
||||||
|
Loading…
Reference in New Issue
Block a user