This commit is contained in:
Alexandre
2021-02-16 15:05:29 +01:00
parent ea01f21c59
commit d7567bb807
15 changed files with 174 additions and 147 deletions

1
filebrowser/CHANGELOG.md Normal file
View File

@@ -0,0 +1 @@

25
filebrowser/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
ARG BUILD_VERSION
FROM hurlenko/filebrowser:$BUILD_VERSION
# Copy root filesystem
COPY rootfs /
RUN apk add --no-cache \
curl \
jq \
&& curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v0.7.1.tar.gz" \
&& mkdir /tmp/bashio \
&& tar zxvf \
/tmp/bashio.tar.gz \
--strip 1 -C /tmp/bashio \
\
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -fr /tmp/bashio.tar.gz\
\
&& mkdir -p -m 777 /config/filebrowser
VOLUME [ "/data" ]
CMD ["--root=/data", "--address=0.0.0.0", "--database=/config/filebrowser/filebrowser.db"]

48
filebrowser/README.md Normal file
View File

@@ -0,0 +1,48 @@
# Home assistant add-on: qBittorrent
![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/qbittorrent) 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 <http://your-ip:8081>. The default username/password : described in the startup log. Configurations can be done through the app, except for the following options.
Network disk is mounted to /share/storagecifs
```yaml
GUID: user
GPID: user
ssl: true/false
certfile: fullchain.pem #ssl certificate
keyfile: privkey.pem #sslkeyfile
whitelist: "localhost,192.168.0.0/16" # list ip subnets that won't need a password (optional)
Username: "admin" #username to access webui. Please change it as the default is admin for all installations.
customUI: selection from list # alternative webUI can be set here. Latest version set at each addon start.
SavePath: "/share/qbittorrent" # Define the download directory
networkdisks: "<//SERVER/SHARE>" # list of smbv2/3 servers to mount (optional)
cifsusername: "username" # smb username (optional)
cifspassword: "password" # smb password (optional)
```
## Support
Create an issue on github, or ask on the [home assistant thread](https://community.home-assistant.io/t/home-assistant-addon-qbittorrent/279247)
[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

48
filebrowser/apparmor.txt Normal file
View File

@@ -0,0 +1,48 @@
#include <tunables/global>
profile db21ed7f_qbittorrent flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
file,
mount,
umount,
remount,
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,
# 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,
}

39
filebrowser/config.json Normal file
View File

@@ -0,0 +1,39 @@
{
"name": "Filebrowser",
"version": "2.11.0",
"slug": "filebrowser",
"description": "filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files",
"url": "https://github.com/hurlenko/filebrowser-docker",
"startup": "services",
"arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"ports": {
"8080/tcp": 8087
},
"ports_description": {
"8080/tcp": "Web UI port"
},
"apparmor": true,
"privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"],
"map": [
"media:rw",
"config:rw",
"share:rw",
"ssl"
],
"webui": "[PROTO:ssl]://[HOST]:[PORT:8080]",
"environment": {
"FB_BASEURL": "/filebrowser"
},
"options": {
},
"schema": {
"networkdisks": "str?",
"cifsusername": "str?",
"cifspassword": "str?"
}
}

BIN
filebrowser/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
filebrowser/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,46 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
# Mount local Share if configured and if Protection Mode is active
if bashio::config.has_value 'localdisks'; then
bashio::log.info 'Mounting external hdd...'
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
####################
# MOUNT SMB SHARES #
####################
# Mount CIFS Share if configured and if Protection Mode is active
if bashio::config.has_value 'networkdisks'; then
bashio::log.info 'Mounting smb share...'
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
bashio::log.info "Network Disks mounting.. ${MOREDISKS}" && \
for disk in $MOREDISKS
do
bashio::log.info "Mount ${disk}"
echo "Creating /storage/storagecifs"
mkdir -p /storage/storagecifs
chown -R abc:abc /storage/storagecifs
mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /storage/storagecifs && \
bashio::log.info "Success!"
done || \
bashio::log.warning "Protection mode is ON. Unable to mount external drives!"
fi