diff --git a/joal/Dockerfile b/joal/Dockerfile new file mode 100644 index 000000000..555561e72 --- /dev/null +++ b/joal/Dockerfile @@ -0,0 +1,11 @@ +ARG BUILD_FROM +FROM $BUILD_FROM + +# Copy root filesystem +COPY rootfs / + +# MOFIFY DATA PATH +RUN sed -i "s|config|share/transmission|g" /etc/services.d/transmission/run \ + && sed -i "s|config|share/transmission|g" /etc/cont-init.d/20-config + +VOLUME [ "/data" ] \ No newline at end of file diff --git a/joal/README.md b/joal/README.md new file mode 100644 index 000000000..f4f5eb98a --- /dev/null +++ b/joal/README.md @@ -0,0 +1,39 @@ +# Home assistant add-on: Transmission +![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield] + +## About + +Transmission is a bittorrent client. +This addon is based on the [docker image](https://github.com/linuxserver/transmission) 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 + +Options : +- "download_dir": "/share/downloads" # where the files will be saved after download +- "incomplete_dir": "/share/incomplete" # where the files are saved during download +- "localdisks": ["sda1"] # list of devices to mount, '' if none +- "networkdisks": "" # list of smbv2/3 servers to mount, '' if none +- "cifsusername": "" # smb username +- "cifspassword": "" # smb password + +Complete transmission options are in /share/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 `:9091`. + +[repository]: https://github.com/alexbelgium/hassio-addons +[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg +[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg +[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg +[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg diff --git a/joal/build.json b/joal/build.json new file mode 100644 index 000000000..dacbff4f3 --- /dev/null +++ b/joal/build.json @@ -0,0 +1,11 @@ +{ + "build_from": { + "armv7": "anthonyraymond/joal:2.1.24-arm", + "armhf": "anthonyraymond/joal:2.1.24-arm", + "aarch64": "anthonyraymond/joal:2.1.24-arm64", + "amd64": "anthonyraymond/joal:2.1.24-amd64", + }, + "squash": false, + "args": {} +} + diff --git a/joal/config.json b/joal/config.json new file mode 100644 index 000000000..0d2a83a30 --- /dev/null +++ b/joal/config.json @@ -0,0 +1,50 @@ +{ + "name": "Joal Desktop test", + "version": "2.1.24", + "slug": "joal", + "description": "Joal Desktop docker". + "url": "https://github.com/alexbelgium/hassio-addons/tree/master/joal", + "startup": "services", + "arch": [ + "aarch64", + "amd64", + "armv7", + "armhf" + ], + "ports": { + "1234/tcp": 1234 + }, + "ports_description": { + "1234/tcp": "Web UI port (required), + }, + "map": [ + "share:rw" + ], + "webui": "http://[HOST]:[PORT:1234]", + "boot": "auto", + "environment": { + "PUID": 0, + "PGID": 0 + }, + "options": { + "PUID": 0, + "PGID": 0, + "download_dir": "/share/downloads", + "incomplete_dir": "/share/incomplete", + "localdisks": ["sda1"], + "networkdisks": "//SERVER/SHARE", + "cifsusername": "username", + "cifspassword": "password" + }, + "schema": { + "PUID": "int", + "PGID": "int", + "TZ": "str?", + "download_dir": "str", + "incomplete_dir": "str", + "localdisks": ["str?"], + "networkdisks": "str?", + "cifsusername": "str?", + "cifspassword": "str?" + } +} diff --git a/joal/icon.png b/joal/icon.png new file mode 100644 index 000000000..29a6a3cdc Binary files /dev/null and b/joal/icon.png differ diff --git a/joal/logo.png b/joal/logo.png new file mode 100644 index 000000000..29a6a3cdc Binary files /dev/null and b/joal/logo.png differ diff --git a/joal/rootfs/etc/cont-init.d/20-transmission-configuration.sh b/joal/rootfs/etc/cont-init.d/20-transmission-configuration.sh new file mode 100644 index 000000000..30ced20da --- /dev/null +++ b/joal/rootfs/etc/cont-init.d/20-transmission-configuration.sh @@ -0,0 +1,30 @@ +#!/usr/bin/with-contenv bashio +# ============================================================================== + +declare CONFIG +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 diff --git a/joal/rootfs/etc/cont-init.d/50-mounts.sh b/joal/rootfs/etc/cont-init.d/50-mounts.sh new file mode 100644 index 000000000..0bb2a5c57 --- /dev/null +++ b/joal/rootfs/etc/cont-init.d/50-mounts.sh @@ -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 \ No newline at end of file