mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-21 12:08:12 +01:00
test transmission linuxserver
This commit is contained in:
@@ -21,12 +21,12 @@ CONFIG=$(</share/transmission/settings.json)
|
||||
|
||||
download_dir=$(bashio::config 'download_dir')
|
||||
incomplete_dir=$(bashio::config 'incomplete_dir')
|
||||
|
||||
# Defaults
|
||||
if ! bashio::config.has_value 'incomplete_dir'; then
|
||||
if ! bashio::config.has('incomplete_dir'); then
|
||||
incomplete_bool=true ; else
|
||||
incomplete_bool=false
|
||||
fi
|
||||
|
||||
# Defaults
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir\"=\"${incomplete_dir}\"")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"download-dir\"=\"${download_dir}\"")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=${incomplete_bool}")
|
||||
|
||||
10
transmission_ls/Dockerfile
Normal file
10
transmission_ls/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
|
||||
# MOFIFY DATA PATH
|
||||
RUN sed -i "s|config|data|g" /etc/services.d/transmission/run
|
||||
|
||||
VOLUME [ "/data" ]
|
||||
27
transmission_ls/README.md
Normal file
27
transmission_ls/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Hassio Add-ons by alexbelgium: code-server
|
||||
|
||||
## About
|
||||
|
||||
Code-server is VS Code running on a remote server, accessible through the browser.
|
||||
|
||||
This addon is based on the [docker image](https://github.com/linuxserver/code-server) from linuxserver.io.
|
||||
|
||||
## 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
|
||||
|
||||
Webui can be found at `<your-ip>:8443`.
|
||||
|
||||
|
||||
[repository]: https://github.com/alexbelgium/hassio-addons
|
||||
11
transmission_ls/build.json
Normal file
11
transmission_ls/build.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"build_from": {
|
||||
"armv7": "linuxserver/code-server:arm32v7-3.00-r0-ls69",
|
||||
"armhf": "linuxserver/code-server:arm32v7-3.00-r0-ls69",
|
||||
"aarch64": "linuxserver/code-server:arm64v8-3.00-r0-ls69",
|
||||
"amd64": "linuxserver/code-server:amd64-3.00-r0-ls69"
|
||||
},
|
||||
"squash": false,
|
||||
"args": {}
|
||||
}
|
||||
|
||||
51
transmission_ls/config.json
Normal file
51
transmission_ls/config.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "Transmission",
|
||||
"version": "1.0",
|
||||
"slug": "transmission_ls",
|
||||
"description": "Bittorrent client.",
|
||||
"url": "https://github.com/alexbelgium/transmission_ls",
|
||||
"startup": "services",
|
||||
"arch": [
|
||||
"aarch64",
|
||||
"amd64",
|
||||
"armv7",
|
||||
"armhf"
|
||||
],
|
||||
"ports": {
|
||||
"9091/tcp": null,
|
||||
"51413/tcp": 51413,
|
||||
"51413/udp": 51413
|
||||
},
|
||||
"ports_description": {
|
||||
"9091/tcp": "Web UI port (Not required for Hass.io Ingress)",
|
||||
"51413/tcp": "Peer port (setup port forwarding to this port)",
|
||||
"51413/udp": "Peer port (setup port forwarding to this port)"
|
||||
},
|
||||
"map": [
|
||||
"config:rw",
|
||||
"share:rw",
|
||||
"media:rw",
|
||||
"ssl"
|
||||
],
|
||||
"privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"],
|
||||
"full_access": true,
|
||||
"webui": "http://[HOST]:[PORT:8443]",
|
||||
"boot": "auto",
|
||||
"environment": {
|
||||
"PUID": 0,
|
||||
"PGID": 0
|
||||
},
|
||||
"options": {
|
||||
"PUID": 0,
|
||||
"PGID": 0,
|
||||
"download_dir": "/share/downloads",
|
||||
"incomplete_dir": "/share/incomplete"
|
||||
},
|
||||
"schema": {
|
||||
"PUID": "int",
|
||||
"PGID": "int",
|
||||
"TZ": "str?",
|
||||
"download_dir": "str",
|
||||
"incomplete_dir": "str"
|
||||
}
|
||||
}
|
||||
BIN
transmission_ls/icon.png
Normal file
BIN
transmission_ls/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
transmission_ls/logo.png
Normal file
BIN
transmission_ls/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
15
transmission_ls/rootfs/etc/cont-init.d/10-requirements.sh
Normal file
15
transmission_ls/rootfs/etc/cont-init.d/10-requirements.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# This files check if all user configuration requirements are met
|
||||
# ==============================================================================
|
||||
|
||||
# Check authentication requirements, if enabled
|
||||
if bashio::config.true 'authentication_required'; then
|
||||
if ! bashio::config.has_value 'username'; then
|
||||
bashio::exit.nok 'Transmission authentication is enabled, but no username was specified'
|
||||
fi
|
||||
|
||||
if ! bashio::config.has_value 'password'; then
|
||||
bashio::exit.nok 'Transmission authentication is enabled, but no password was specified'
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
|
||||
declare CONFIG
|
||||
declare authentication_required
|
||||
declare username
|
||||
declare password
|
||||
declare incomplete_bool
|
||||
declare download_dir
|
||||
declare incomplete_dir
|
||||
|
||||
if ! bashio::fs.directory_exists '/share/transmission'; then
|
||||
mkdir '/share/transmission'
|
||||
fi
|
||||
|
||||
if ! bashio::fs.file_exists '/share/transmission/settings.json'; then
|
||||
echo "{}" > /share/transmission/settings.json
|
||||
fi
|
||||
|
||||
CONFIG=$(</share/transmission/settings.json)
|
||||
|
||||
download_dir=$(bashio::config 'download_dir')
|
||||
incomplete_dir=$(bashio::config 'incomplete_dir')
|
||||
if ! bashio::config.has('incomplete_dir'); then
|
||||
incomplete_bool=true ; else
|
||||
incomplete_bool=false
|
||||
fi
|
||||
|
||||
# Defaults
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir\"=\"${incomplete_dir}\"")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"download-dir\"=\"${download_dir}\"")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=${incomplete_bool}")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-whitelist-enabled\"=false")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-host-whitelist-enabled\"=false")
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"bind-address-ipv4\"=\"0.0.0.0\"")
|
||||
|
||||
authentication_required=$(bashio::config 'authentication_required')
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-authentication-required\"=${authentication_required}")
|
||||
|
||||
|
||||
username=$(bashio::config 'username')
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-username\"=\"${username}\"")
|
||||
|
||||
|
||||
password=$(bashio::config 'password')
|
||||
CONFIG=$(bashio::jq "${CONFIG}" ".\"rpc-password\"=\"${password}\"")
|
||||
|
||||
echo "${CONFIG}" > /share/transmission/settings.json
|
||||
21
transmission_ls/rootfs/etc/cont-init.d/50-mounts.sh
Normal file
21
transmission_ls/rootfs/etc/cont-init.d/50-mounts.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
bashio::log.info 'Mounting external hdd...'
|
||||
|
||||
# Mount local Share if configured and if Protection Mode is active
|
||||
if bashio::config.has_value 'localdisks'; then
|
||||
MOREDISKS=$(bashio::config 'localdisks')
|
||||
bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \
|
||||
for disk in $MOREDISKS
|
||||
do
|
||||
bashio::log.info "Mount ${disk}"
|
||||
mkdir -p /share/$disk && \
|
||||
if [ ! -d /share/$disk ]; then
|
||||
echo "Creating /share/$disk"
|
||||
mkdir -p /share/$disk
|
||||
chown -R abc:abc /share/$disk
|
||||
fi
|
||||
mount /dev/$disk /share/$disk && \
|
||||
bashio::log.info "Success!"
|
||||
done || \
|
||||
bashio::log.warning "Protection mode is ON. Unable to mount local drives!"
|
||||
fi
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when the server fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
7
transmission_ls/rootfs/etc/services.d/transmission/run
Normal file
7
transmission_ls/rootfs/etc/services.d/transmission/run
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Runs Transmission
|
||||
# ==============================================================================
|
||||
bashio::log.info "Starting Transmission..."
|
||||
|
||||
exec /usr/bin/transmission-daemon --foreground --config-dir /share/transmission
|
||||
Reference in New Issue
Block a user