New logic

This commit is contained in:
Alexandre
2021-12-14 13:39:15 +01:00
parent 6df150b341
commit 90f333c40d
269 changed files with 6071 additions and 2163 deletions

View File

@@ -1,18 +1,18 @@
############### #################
# Build Image # # 1 Build Image #
############### #################
ARG BUILD_FROM ARG BUILD_FROM
FROM $BUILD_FROM FROM $BUILD_FROM
VOLUME [ "/data" ] VOLUME [ "/data" ]
################ ##################
# Modify Image # # 2 Modify Image #
################ ##################
################ ##################
# Install apps # # 3 Install apps #
################ ##################
# Add rootfs # Add rootfs
COPY rootfs/ / COPY rootfs/ /
@@ -21,17 +21,17 @@ COPY rootfs/ /
ENV PACKAGES="" ENV PACKAGES=""
# Automatic apps & bashio # Automatic apps & bashio
RUN $(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi && \
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl || apk add --no-cache curl) && \ 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \ /automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
############## ################
# Entrypoint # # 4 Entrypoint #
############## ################
# Entrypoint logic # Entrypoint logic
RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
#WORKDIR / #WORKDIR /
@@ -40,9 +40,9 @@ CMD [ "/entrypoint.sh" ]
# Set shell # Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
########## ############
# Labels # # 5 Labels #
########## ############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE

View File

@@ -2,34 +2,6 @@
echo "Starting..." echo "Starting..."
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
else
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
fi
fi
#################### ####################
# Starting scripts # # Starting scripts #
#################### ####################

View File

@@ -2,18 +2,17 @@
# If dockerfile failed install manually # If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then if [ -e "/ENVFILE" ]; then
echo "Executing script" echo "Executing script"
PACKAGES=$(< /ENVFILE) PACKAGES=$(</ENVFILE)
( (
####################### #######################
# Automatic installer # # Automatic installer #
####################### #######################
$(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi &&
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl &>/dev/null || apk add --no-cache curl) && \ 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" && \ eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh rm /automatic_packages.sh
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 1.0.0 (07-12-2021) ## 1.0.0 (07-12-2021)
- Update to latest version from t0mer/Arpspoof-Docker - Update to latest version from t0mer/Arpspoof-Docker

View File

@@ -1,18 +1,18 @@
############### #################
# Build Image # # 1 Build Image #
############### #################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM techblog/arpspoof-docker:latest FROM techblog/arpspoof-docker:latest
################ ##################
# Modify Image # # 2 Modify Image #
################ ##################
################ ##################
# Install apps # # 3 Install apps #
################ ##################
# Add rootfs # Add rootfs
COPY rootfs/ / COPY rootfs/ /
@@ -21,24 +21,24 @@ COPY rootfs/ /
ENV PACKAGES="jq curl iproute2" ENV PACKAGES="jq curl iproute2"
# Automatic apps & bashio # Automatic apps & bashio
RUN $(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi && \
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl || apk add --no-cache curl) && \ 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \ /automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
############## ################
# Entrypoint # # 4 Entrypoint #
############## ################
RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/entrypoint.sh" ] CMD [ "/entrypoint.sh" ]
########## ############
# Labels # # 5 Labels #
########## ############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE

View File

@@ -2,34 +2,6 @@
echo "Starting..." echo "Starting..."
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
else
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
fi
fi
#################### ####################
# Starting scripts # # Starting scripts #
#################### ####################

View File

@@ -2,18 +2,17 @@
# If dockerfile failed install manually # If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then if [ -e "/ENVFILE" ]; then
echo "Executing script" echo "Executing script"
PACKAGES=$(< /ENVFILE) PACKAGES=$(</ENVFILE)
( (
####################### #######################
# Automatic installer # # Automatic installer #
####################### #######################
$(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi &&
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl &>/dev/null || apk add --no-cache curl) && \ 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" && \ eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh rm /automatic_packages.sh
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 1.0.1 (20-11-2021) ## 1.0.1 (20-11-2021)
- Update to latest version from linuxserver/docker-bazarr - Update to latest version from linuxserver/docker-bazarr

View File

@@ -1,29 +1,14 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ENV BASHIO_VERSION=0.14.3
ENV PACKAGES="jq \
curl \
cifs-utils \
keyutils \
samba \
samba-client"
RUN \ ##################
############################### # 2 Modify Image #
# Install apps test both dist # ##################
###############################
apk add --no-cache ${PACKAGES} \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
RUN \ RUN \
# Correct config folder # Correct config folder
@@ -36,10 +21,37 @@ RUN \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser
# copy local files ##################
COPY root/ / # 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \
curl \
cifs-utils \
keyutils \
samba \
samba-client"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do
printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k
done

View File

@@ -0,0 +1,19 @@
#!/usr/bin/with-contenv bash
if [ ! -d /share/storage/movies ]; then
echo "Creating /share/storage/movies"
mkdir -p /share/storage/movies
chown -R abc:abc /share/storage/movies
fi
if [ ! -d /share/downloads ]; then
echo "Creating /share/downloads"
mkdir -p /share/downloads
chown -R abc:abc /share/downloads
fi
if [ ! -d /config/bazarr ]; then
echo "Creating /config/bazarr"
mkdir -p /config/bazarr
chown -R abc:abc /config/bazarr
fi

View File

@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
# Mount local Share if configured
if bashio::config.has_value 'localdisks'; then
MOREDISKS=$(bashio::config 'localdisks')
echo "Local Disks mounting..."
# Separate comma separated values
for disk in ${MOREDISKS//,/ }; do
# Mount by device as default
devpath=/dev
# Mount as label
[ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label
# Creates dir
mkdir -p /mnt/$disk
chown -R $(id -u):$(id -g) /mnt/$disk
# Legacy mounting : mount to share if still exists (avoid breaking changes)
[ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true
# Mount
mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
done
fi

View File

@@ -0,0 +1,83 @@
#!/usr/bin/with-contenv bashio
#########################
# MOUNT SMB SHARES v1.6 #
#########################
if bashio::config.has_value 'networkdisks'; then
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
exit 0
fi
# Prepare mount point
mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname
#Tries to mount with default options
mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Messages
if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then
#Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze &&
bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" ||
bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
else
# Mounting failed messages
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
bashio::log.fatal "Here is some debugging info :"
# Provide debugging info
smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client
#smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
# Error code
bashio::log.fatal "Error read : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount /mnt/$diskname 2>/dev/null || true
rmdir /mnt/$diskname || true
fi
done
fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 1.23.0 (21-10-2021) ## 1.23.0 (21-10-2021)
- Update to latest version from dani-garcia/bitwarden_rs - Update to latest version from dani-garcia/bitwarden_rs

View File

@@ -1,20 +1,12 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:4.0.0 ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:4.0.0
###############################################################################
# Get prebuild containers from Bitwarden RS
###############################################################################
ARG BUILD_VERSION ARG BUILD_VERSION
ARG BUILD_UPSTREAM="1.23.0" ARG BUILD_UPSTREAM="1.23.0"
# hadolint ignore=DL3006
FROM "vaultwarden/server:${BUILD_UPSTREAM}" as vaultwarden FROM "vaultwarden/server:${BUILD_UPSTREAM}" as vaultwarden
###############################################################################
# Build the actual add-on.
###############################################################################
# hadolint ignore=DL3006
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Get the Bitwarden from official images # Get the Bitwarden from official images
@@ -22,33 +14,45 @@ COPY --from=vaultwarden /vaultwarden /opt/vaultwarden
COPY --from=vaultwarden /Rocket.toml /opt/Rocket.toml COPY --from=vaultwarden /Rocket.toml /opt/Rocket.toml
COPY --from=vaultwarden /web-vault /opt/web-vault COPY --from=vaultwarden /web-vault /opt/web-vault
################ ##################
# Install apps # # 2 Modify Image #
################ ##################
##################
# 3 Install apps #
##################
# Add rootfs # Add rootfs
COPY rootfs/ / COPY rootfs/ /
# Manual apps # Manual apps
ENV PACKAGES="libmariadb-dev-compat \ ENV PACKAGES="libmariadb-dev-compat \
libpq5 \ libpq5 \
nginx \ nginx \
sqlite3" sqlite3"
# Automatic apps & bashio # Automatic apps & bashio
RUN $(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi && \
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl || apk add --no-cache curl) && \ 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \ /automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
# Entrypoint logic ################
# 4 Entrypoint #
################
#RUN chmod 777 /entrypoint.sh #RUN chmod 777 /entrypoint.sh
#WORKDIR / #WORKDIR /
#ENTRYPOINT [ "/usr/bin/env" ] #ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ] #CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -2,18 +2,17 @@
# If dockerfile failed install manually # If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then if [ -e "/ENVFILE" ]; then
echo "Executing script" echo "Executing script"
PACKAGES=$(< /ENVFILE) PACKAGES=$(</ENVFILE)
( (
####################### #######################
# Automatic installer # # Automatic installer #
####################### #######################
$(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi &&
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl &>/dev/null || apk add --no-cache curl) && \ 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" && \ eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh rm /automatic_packages.sh
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,8 @@
## v2112.1.0-ls38 (12-12-2021)
- Update to latest version from linuxserver/docker-booksonic-air
- New standardized logic for Dockerfile build and packages installation
## nightly-0.1.0.1024-ls29 (14-11-2021) ## nightly-0.1.0.1024-ls29 (14-11-2021)
- Update to latest version from linuxserver/docker-booksonic-air - Update to latest version from linuxserver/docker-booksonic-air

View File

@@ -1,7 +1,30 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM linuxserver/booksonic-air:latest FROM $BUILD_FROM
ENV BASHIO_VERSION=0.14.3
##################
# 2 Modify Image #
##################
ENV BOOKSONIC_AIR_SETTINGS="/data"
RUN \
# Allow UID and GID setting
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser || true
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \ ENV PACKAGES="jq \
curl \ curl \
cifs-utils \ cifs-utils \
@@ -9,38 +32,28 @@ ENV PACKAGES="jq \
samba \ samba \
smbclient" smbclient"
RUN \ # 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); fi && \
# Install apps # 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); fi && \
################ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
apt-get clean \ chmod 777 /automatic_packages.sh && \
&& apt-get update \ /automatic_packages.sh "${PACKAGES:-}" && \
&& apt-get install -y --no-install-recommends ${PACKAGES} \ rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
\
###################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio
################# ################
# Correct image # # 4 Entrypoint #
################# ################
RUN \
# Allow UID and GID setting
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser || true
# copy local files #RUN chmod 777 /entrypoint.sh
COPY root/ / #WORKDIR /
ENV BOOKSONIC_AIR_SETTINGS="/data" #ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

8
booksonic_air/build.json Normal file
View File

@@ -0,0 +1,8 @@
{
"build_from": {
"armhf": "linuxserver/booksonic-air:arm32v7-latest",
"armv7": "linuxserver/booksonic-air:arm32v7-latest",
"aarch64": "linuxserver/booksonic-air:arm64v8-latest",
"amd64": "linuxserver/booksonic-air:amd64-latest"
}
}

View File

@@ -1,6 +1,11 @@
{ {
"apparmor": true, "apparmor": true,
"arch": ["aarch64", "amd64", "armv7", "armhf"], "arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"boot": "auto", "boot": "auto",
"description": "platform for accessing the audibooks you own wherever you are", "description": "platform for accessing the audibooks you own wherever you are",
"devices": [ "devices": [
@@ -35,7 +40,10 @@
"PUID": "0", "PUID": "0",
"PGID": "0" "PGID": "0"
}, },
"map": ["share:rw", "media:rw"], "map": [
"share:rw",
"media:rw"
],
"name": "Booksonic-air", "name": "Booksonic-air",
"options": { "options": {
"PUID": 0, "PUID": 0,
@@ -50,7 +58,10 @@
"ports_description": { "ports_description": {
"4040/tcp": "web interface" "4040/tcp": "web interface"
}, },
"privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], "privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"schema": { "schema": {
"PUID": "int", "PUID": "int",
"PGID": "int", "PGID": "int",
@@ -61,8 +72,8 @@
"cifspassword": "str?" "cifspassword": "str?"
}, },
"slug": "booksonic-air_nas", "slug": "booksonic-air_nas",
"upstream": "v2009.1.0-ls37", "upstream": "v2112.1.0-ls38",
"url": "https://github.com/alexbelgium/hassio-addons", "url": "https://github.com/alexbelgium/hassio-addons",
"version": "v2009.1.0-ls37", "version": "v2112.1.0-ls38",
"webui": "http://[HOST]:[PORT:4040]" "webui": "http://[HOST]:[PORT:4040]"
} }

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
# Mount local Share if configured
if bashio::config.has_value 'localdisks'; then
MOREDISKS=$(bashio::config 'localdisks')
echo "Local Disks mounting..."
# Separate comma separated values
for disk in ${MOREDISKS//,/ }; do
# Mount by device as default
devpath=/dev
# Mount as label
[ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label
# Creates dir
mkdir -p /mnt/$disk
chown -R $(id -u):$(id -g) /mnt/$disk
# Legacy mounting : mount to share if still exists (avoid breaking changes)
[ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true
# Mount
mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
done
fi

View File

@@ -0,0 +1,83 @@
#!/usr/bin/with-contenv bashio
#########################
# MOUNT SMB SHARES v1.6 #
#########################
if bashio::config.has_value 'networkdisks'; then
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
exit 0
fi
# Prepare mount point
mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname
#Tries to mount with default options
mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Messages
if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then
#Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze &&
bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" ||
bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
else
# Mounting failed messages
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
bashio::log.fatal "Here is some debugging info :"
# Provide debugging info
smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client
#smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
# Error code
bashio::log.fatal "Error read : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount /mnt/$diskname 2>/dev/null || true
rmdir /mnt/$diskname || true
fi
done
fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 15.9.11 (09-12-2021) ## 15.9.11 (09-12-2021)
- Update to latest version from coderaiser/cloudcmd - Update to latest version from coderaiser/cloudcmd

View File

@@ -1,6 +1,22 @@
#################
# 1 Build Image #
#################
ARG BUILD_VERSION ARG BUILD_VERSION
FROM coderaiser/cloudcmd:latest FROM coderaiser/cloudcmd:latest
ENV BASHIO_VERSION=0.14.3
##################
# 2 Modify Image #
##################
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \ ENV PACKAGES="jq \
cifs-utils \ cifs-utils \
keyutils \ keyutils \
@@ -8,39 +24,25 @@ ENV PACKAGES="jq \
smbclient \ smbclient \
nginx" nginx"
RUN \ # 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); fi && \
# Install apps # 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); fi && \
################ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
apt-get clean \ chmod 777 /automatic_packages.sh && \
&& apt-get update \ /automatic_packages.sh "${PACKAGES:-}" && \
&& apt-get install -y --no-install-recommends ${PACKAGES} \ rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
&& apt-get clean \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
# Copy root filesystem ################
COPY rootfs / # 4 Entrypoint #
################
RUN \
###############
# Permissions #
###############
chmod 777 /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ] ENTRYPOINT [ "/entrypoint.sh" ]
RUN chmod 777 /entrypoint.sh
VOLUME [ "/data" ] ############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -2,34 +2,6 @@
echo "Starting..." echo "Starting..."
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
else
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
fi
fi
#################### ####################
# Starting scripts # # Starting scripts #
#################### ####################

View File

@@ -1,29 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
################ #######################
# Install apps # # Automatic installer #
################ #######################
PACKAGES="${PACKAGES:="curl"}" 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); 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); fi &&
apt-get clean \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
&& apt-get update \ chmod 777 /automatic_packages.sh &&
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ eval /./automatic_packages.sh "$PACKAGES" &&
|| apk add --no-cache ${PACKAGES} rm /automatic_packages.sh
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
- Allow mounting local drives by label. Just pust the label instead of sda1 for example - Allow mounting local drives by label. Just pust the label instead of sda1 for example
- Allow mounting of devices up to sdg2 - Allow mounting of devices up to sdg2

View File

@@ -1,33 +1,56 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ENV BASHIO_VERSION=0.14.3
ENV PACKAGES="jq"
# Install bashio ##################
RUN apt-get update \ # 2 Modify Image #
&& apt-get install -y --no-install-recommends ${PACKAGES} \ ##################
##################
# Install bashio # RUN \
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
# Allow UID and GID setting # Allow UID and GID setting
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \ sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
# MOFIFY DATA PATH # MOFIFY DATA PATH
&& sed -i "s|config|data|g" /etc/services.d/code-server/run \ && sed -i "s|config|data|g" /etc/services.d/code-server/run \
&& sed -i "s|config|data|g" /etc/cont-init.d/30-config && sed -i "s|config|data|g" /etc/cont-init.d/30-config
VOLUME [ "/data" ] ##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
#RUN chmod 777 /entrypoint.sh
#WORKDIR /
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -1,7 +1,4 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
bashio::log.warning "Minimal (advised) system requirements: 2GB RAM, 1GB disk space, 2vCPU"
# ============================================================================== # ==============================================================================
# Displays a simple add-on banner on startup # Displays a simple add-on banner on startup
# ============================================================================== # ==============================================================================

View File

@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
# Mount local Share if configured
if bashio::config.has_value 'localdisks'; then
MOREDISKS=$(bashio::config 'localdisks')
echo "Local Disks mounting..."
# Separate comma separated values
for disk in ${MOREDISKS//,/ }; do
# Mount by device as default
devpath=/dev
# Mount as label
[ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label
# Creates dir
mkdir -p /mnt/$disk
chown -R $(id -u):$(id -g) /mnt/$disk
# Legacy mounting : mount to share if still exists (avoid breaking changes)
[ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true
# Mount
mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
done
fi

View File

@@ -0,0 +1,83 @@
#!/usr/bin/with-contenv bashio
#########################
# MOUNT SMB SHARES v1.6 #
#########################
if bashio::config.has_value 'networkdisks'; then
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
exit 0
fi
# Prepare mount point
mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname
#Tries to mount with default options
mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Messages
if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then
#Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze &&
bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" ||
bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
else
# Mounting failed messages
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
bashio::log.fatal "Here is some debugging info :"
# Provide debugging info
smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client
#smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
# Error code
bashio::log.fatal "Error read : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount /mnt/$diskname 2>/dev/null || true
rmdir /mnt/$diskname || true
fi
done
fi

View File

@@ -1,4 +1,6 @@
- New standardized logic for Dockerfile build and packages installation
- Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename - Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename
- Removed full_access and host_network
## 0.8.2-1-ls54 (19-05-2021) ## 0.8.2-1-ls54 (19-05-2021)

View File

@@ -1,39 +1,57 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ENV BASHIO_VERSION=0.14.3
##################
# 2 Modify Image #
##################
RUN \
# Allow UID and GID setting
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
# MOFIFY DATA PATH
&& sed -i "s|config|data|g" /defaults/autostart
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \ ENV PACKAGES="jq \
samba \ samba \
smbclient" smbclient"
# Install bashio # Automatic apps & bashio
RUN apt-get update \ 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); fi && \
&& apt-get install -y --no-install-recommends ${PACKAGES} \ 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); fi && \
\ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
################## chmod 777 /automatic_packages.sh && \
# Install bashio # /automatic_packages.sh "${PACKAGES:-}" && \
################## rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
# Allow UID and GID setting
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser
# copy local files ################
COPY rootfs/ / # 4 Entrypoint #
################
# MOFIFY DATA PATH #RUN chmod 777 /entrypoint.sh
RUN sed -i "s|config|data|g" /defaults/autostart #WORKDIR /
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
VOLUME [ "/data" ] ############
# 5 Labels #
###########
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -7,8 +7,6 @@
"PUID": "0", "PUID": "0",
"PGID": "0" "PGID": "0"
}, },
"full_access": true,
"host_network": true,
"map": ["backup:rw", "config:rw", "share:rw", "media:rw", "ssl"], "map": ["backup:rw", "config:rw", "share:rw", "media:rw", "ssl"],
"name": "Double commander", "name": "Double commander",
"options": { "options": {

View File

@@ -1,29 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
################ #######################
# Install apps # # Automatic installer #
################ #######################
PACKAGES="${PACKAGES:="curl"}" 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); 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); fi &&
apt-get clean \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
&& apt-get update \ chmod 777 /automatic_packages.sh &&
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ eval /./automatic_packages.sh "$PACKAGES" &&
|| apk add --no-cache ${PACKAGES} rm /automatic_packages.sh
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1 +1,2 @@
- New standardized logic for Dockerfile build and packages installation
- Initial build - Initial build

View File

@@ -1,21 +1,39 @@
#################
# 1 Build Image #
#################
ARG BUILD_UPSTREAM="7.14.2" ARG BUILD_UPSTREAM="7.14.2"
FROM elasticsearch:$BUILD_UPSTREAM FROM elasticsearch:$BUILD_UPSTREAM
##################
# 2 Modify Image #
##################
# Data persistence # Data persistence
RUN sed -i '5a echo "Data location moved. Please wait while elasticsearch starts..."' /usr/local/bin/docker-entrypoint.sh \ RUN sed -i '5a echo "Data location moved. Please wait while elasticsearch starts..."' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a chown -R $(id -u):$(id -g) $HOME' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a chown -R $(id -u):$(id -g) $HOME' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a done' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a done' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a ln -s $NEWHOME/$files /usr/share/elasticsearch || true' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a ln -s $NEWHOME/$files /usr/share/elasticsearch || true' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a rm -r /usr/share/elasticsearch/$files || true' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a rm -r /usr/share/elasticsearch/$files || true' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a cp -rn /usr/share/elasticsearch/$files $NEWHOME || true' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a cp -rn /usr/share/elasticsearch/$files $NEWHOME || true' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a for files in "data" "config"; do' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a for files in "data" "config"; do' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a mkdir -p $NEWHOME' /usr/local/bin/docker-entrypoint.sh \ && sed -i '5a mkdir -p $NEWHOME' /usr/local/bin/docker-entrypoint.sh \
&& sed -i '5a NEWHOME="/data"' /usr/local/bin/docker-entrypoint.sh && sed -i '5a NEWHOME="/data"' /usr/local/bin/docker-entrypoint.sh \
# Install plugins
&& /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment
# Install plugins ##################
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment # 3 Install apps #
##################
################
# 4 Entrypoint #
################
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -1,4 +1,8 @@
## 4.7.0.19 (14-12-2021)
- Update to latest version from linuxserver/docker-emby
- New standardized logic for Dockerfile build and packages installation
## 4.7.0.18 (20-11-2021) ## 4.7.0.18 (20-11-2021)
- Update to latest version from linuxserver/docker-emby - Update to latest version from linuxserver/docker-emby

View File

@@ -1,18 +1,18 @@
############### #################
# Build Image # # 1 Build Image #
############### #################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
################ ##################
# Modify Image # # 2 Modify Image #
################ ##################
# Set shell # Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \ RUN \
# Allow UID and GID setting # Allow UID and GID setting
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \ sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
@@ -24,9 +24,9 @@ RUN \
&& sed -i "s|/config|/emby|g" /etc/services.d/emby/run \ && sed -i "s|/config|/emby|g" /etc/services.d/emby/run \
&& sed -i "s|/config|/emby|g" /etc/cont-init.d/30-config && sed -i "s|/config|/emby|g" /etc/cont-init.d/30-config
################ ##################
# Install apps # # 3 Install apps #
################ ##################
# Copy local files # Copy local files
COPY rootfs/ / COPY rootfs/ /
@@ -34,20 +34,20 @@ COPY rootfs/ /
ENV PACKAGES="" ENV PACKAGES=""
# Automatic apps & bashio # Automatic apps & bashio
RUN $(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi && \
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl || apk add --no-cache curl) && \ 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \ /automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
############## ################
# Entrypoint # # 4 Entrypoint #
############## ################
########## ############
# Labels # # 5 Labels #
########## ############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE

View File

@@ -1,6 +1,11 @@
{ {
"apparmor": true, "apparmor": true,
"arch": ["aarch64", "amd64", "armv7", "armhf"], "arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"backup_exclude": [ "backup_exclude": [
"*/cache/", "*/cache/",
"*/logs/", "*/logs/",
@@ -47,7 +52,12 @@
"/dev/nvme1", "/dev/nvme1",
"/dev/nvme2" "/dev/nvme2"
], ],
"map": ["config:rw", "share:rw", "media:rw", "ssl:rw"], "map": [
"config:rw",
"share:rw",
"media:rw",
"ssl:rw"
],
"name": "Emby NAS", "name": "Emby NAS",
"options": { "options": {
"PUID": 0, "PUID": 0,
@@ -66,7 +76,10 @@
"7359/udp": "udp server discover (optional)", "7359/udp": "udp server discover (optional)",
"1900/udp": "dlna (optional)" "1900/udp": "dlna (optional)"
}, },
"privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], "privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"schema": { "schema": {
"PUID": "int", "PUID": "int",
"PGID": "int", "PGID": "int",
@@ -81,9 +94,9 @@
}, },
"slug": "emby_nas", "slug": "emby_nas",
"startup": "services", "startup": "services",
"upstream": "4.7.0.18", "upstream": "4.7.0.19",
"url": "https://github.com/alexbelgium/hassio-addons", "url": "https://github.com/alexbelgium/hassio-addons",
"version": "4.7.0.18", "version": "4.7.0.19",
"video": true, "video": true,
"webui": "http://[HOST]:[PORT:8096]" "webui": "http://[HOST]:[PORT:8096]"
} }

View File

@@ -2,18 +2,17 @@
# If dockerfile failed install manually # If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then if [ -e "/ENVFILE" ]; then
echo "Executing script" echo "Executing script"
PACKAGES=$(< /ENVFILE) PACKAGES=$(</ENVFILE)
( (
####################### #######################
# Automatic installer # # Automatic installer #
####################### #######################
$(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ 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); fi &&
$(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl &>/dev/null || apk add --no-cache curl) && \ 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh && \ chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" && \ eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh rm /automatic_packages.sh
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 0.7.7 (25-11-2021) ## 0.7.7 (25-11-2021)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt

View File

@@ -1,43 +1,48 @@
#################
# 1 Build Image #
#################
ARG BUILD_UPSTREAM="0.7.7" ARG BUILD_UPSTREAM="0.7.7"
FROM m4dm4rtig4n/enedisgateway2mqtt:$BUILD_UPSTREAM FROM m4dm4rtig4n/enedisgateway2mqtt:$BUILD_UPSTREAM
# Base system
ENV BASHIO_VERSION=0.14.3 ##################
# 2 Modify Image #
##################
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \ ENV PACKAGES="jq \
curl \ curl \
yamllint" yamllint"
# Copy root filesystem # Automatic apps & bashio
COPY rootfs / 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); fi && \
VOLUME [ "/config" ] 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
RUN \ ################
################ # 4 Entrypoint #
# Install apps # ################
################
apt-get clean \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& apt-get clean \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
#RUN ln -snf /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
CMD ["/entrypoint.sh"] CMD ["/entrypoint.sh"]
VOLUME [ "/data" ] VOLUME [ "/data" ]
### LABELS ############
# 5 Labels #
############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -1,29 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
################ #######################
# Install apps # # Automatic installer #
################ #######################
PACKAGES="${PACKAGES:="curl"}" 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); 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); fi &&
apt-get clean \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
&& apt-get update \ chmod 777 /automatic_packages.sh &&
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ eval /./automatic_packages.sh "$PACKAGES" &&
|| apk add --no-cache ${PACKAGES} rm /automatic_packages.sh
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,4 +1,5 @@
- Always aligned with dev versions - New standardized logic for Dockerfile build and packages installation
- Always aligned with dev versions
## 0.7.8-dev (23-11-2021) ## 0.7.8-dev (23-11-2021)
- Update to latest version from m4dm4rtig4n/enedisgateway2mqtt - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt

View File

@@ -1,43 +1,48 @@
#################
# 1 Build Image #
#################
ARG BUILD_UPSTREAM="0.7.8-dev" ARG BUILD_UPSTREAM="0.7.8-dev"
FROM m4dm4rtig4n/enedisgateway2mqtt:$BUILD_UPSTREAM FROM m4dm4rtig4n/enedisgateway2mqtt:$BUILD_UPSTREAM
# Base system
ENV BASHIO_VERSION=0.14.3
# Copy root filesystem ##################
COPY rootfs / # 2 Modify Image #
VOLUME [ "/config" ] ##################
RUN \ ##################
################ # 3 Install apps #
# Install apps # ##################
################
apt-get clean \ # Add rootfs
&& apt-get update \ COPY rootfs/ /
&& apt-get install -y \
jq \ # Manual apps
ENV PACKAGES="jq \
curl \ curl \
yamllint \ yamllint"
&& apt-get clean \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
#RUN ln -snf /usr/share/zoneinfo/Europe/Paris /etc/localtime # 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
CMD ["/entrypoint.sh"] CMD ["/entrypoint.sh"]
VOLUME [ "/data" ] VOLUME [ "/data" ]
### LABELS ############
# 5 Labels #
############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -1,30 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
# Remove errors on apt-get #######################
export DEBIAN_FRONTEND=noninteractive # Automatic installer #
################ #######################
# Install apps # 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); 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); fi &&
apt-get clean && curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
apt-get update && chmod 777 /automatic_packages.sh &&
apt-get install --no-install-recommends \ eval /./automatic_packages.sh "$PACKAGES" &&
jq \ rm /automatic_packages.sh
curl \
yamllint
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,4 +1,5 @@
- Mount ssl in write - Mount ssl in write
- New standardized logic for Dockerfile build and packages installation
- Mount nvme drives - Mount nvme drives
## 2.19.0 (25-11-2021) ## 2.19.0 (25-11-2021)

View File

@@ -1,8 +1,27 @@
#################
# 1 Build Image #
#################
ARG BUILD_VERSION ARG BUILD_VERSION
ARG BUILD_UPSTREAM="2.19.0" ARG BUILD_UPSTREAM="2.19.0"
FROM hurlenko/filebrowser:v${BUILD_UPSTREAM} FROM hurlenko/filebrowser:v${BUILD_UPSTREAM}
ENV BASHIO_VERSION=0.14.3
##################
# 2 Modify Image #
##################
RUN \
# Correct upstream image folders links
mkdir -p -m 777 /config/filebrowser
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="curl \ ENV PACKAGES="curl \
jq \ jq \
bash \ bash \
@@ -13,30 +32,17 @@ ENV PACKAGES="curl \
bind-tools \ bind-tools \
nginx" nginx"
RUN \ # 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); fi && \
# Install apps # 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); fi && \
################ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
apk add --no-cache ${PACKAGES} \ chmod 777 /automatic_packages.sh && \
\ /automatic_packages.sh "${PACKAGES:-}" && \
################## rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
RUN \ ################
######################################## # 4 Entrypoint #
# Correct upstream image folders links # ################
########################################
mkdir -p -m 777 /config/filebrowser
# Copy root filesystem
COPY rootfs /
VOLUME [ "/data" ] VOLUME [ "/data" ]
WORKDIR / WORKDIR /
@@ -44,8 +50,10 @@ RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/entrypoint.sh" ] CMD [ "/entrypoint.sh" ]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -2,34 +2,6 @@
echo "Starting..." echo "Starting..."
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
else
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
fi
fi
#################### ####################
# Starting scripts # # Starting scripts #
#################### ####################

View File

@@ -1,29 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
################ #######################
# Install apps # # Automatic installer #
################ #######################
PACKAGES="${PACKAGES:="curl"}" 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); 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); fi &&
apt-get clean \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
&& apt-get update \ chmod 777 /automatic_packages.sh &&
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ eval /./automatic_packages.sh "$PACKAGES" &&
|| apk add --no-cache ${PACKAGES} rm /automatic_packages.sh
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 3.2.4 (08-12-2021) ## 3.2.4 (08-12-2021)
- Update to latest version from flexget/flexget - Update to latest version from flexget/flexget

View File

@@ -1,32 +1,18 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM wiserain/flexget:latest FROM wiserain/flexget:latest
ENV BASHIO_VERSION=0.14.3
##################
# 2 Modify Image #
##################
RUN \ RUN \
##################
# Install apps #
##################
apk add --no-cache \
jq \
curl \
cifs-utils \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
###############
# Adapt image #
###############
# Allow UID and GID setting # Allow UID and GID setting
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \ sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
\ \
@@ -40,9 +26,40 @@ RUN \
&& sed -i 's/# set FG_WEBUI_PASSWD/if bashio::config.has_value "WebuiPass"; then FG_WEBUI_PASSWD=$(bashio::config "WebuiPass"); fi/g' /etc/cont-init.d/20-config \ && sed -i 's/# set FG_WEBUI_PASSWD/if bashio::config.has_value "WebuiPass"; then FG_WEBUI_PASSWD=$(bashio::config "WebuiPass"); fi/g' /etc/cont-init.d/20-config \
&& sed -i 's/# install custom plugins/if bashio::config.has_value "FG_PLUGINS"; then FG_PLUGINS=$(bashio::config "FG_PLUGINS"); fi/g' /etc/cont-init.d/20-config && sed -i 's/# install custom plugins/if bashio::config.has_value "FG_PLUGINS"; then FG_PLUGINS=$(bashio::config "FG_PLUGINS"); fi/g' /etc/cont-init.d/20-config
VOLUME [ "/data" ] ##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \
curl \
cifs-utils"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE]
################
# 4 Entrypoint #
################
#RUN chmod 777 /entrypoint.sh
#WORKDIR /
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bashio
mkdir -p /config/flexget

View File

@@ -1,7 +0,0 @@
## 2021.11 (27-11-2021)
- Update to latest version from freqtrade/freqtrade
## 2021.10 (29-10-2021)
- Update to latest version from freqtrade/freqtrade
- Initial release

View File

@@ -1,68 +0,0 @@
ARG BUILD_FROM
ARG BUILD_VERSION
FROM freqtradeorg/freqtrade:latest
ENV BASHIO_VERSION=0.14.3
ENV PACKAGES="jq git"
USER root
COPY rootfs /
RUN \
################
# Install apps #
################
apt-get update \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
\
###################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
VOLUME [ "/data" ]
WORKDIR /
RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/bin/bash" ]
CMD [ "/entrypoint.sh" ]
# use /data instead of /config for hass.io environment
# && sed -i "s|/config|/share/freqtrade|g" /etc/services.d/freqtrade/run \
#&& sed -i "s|/config|/share/freqtrade|g" /etc/cont-init.d/50-config \
#&& sed -i "s|/share/freqtrade/nginx|/config/nginx|g" /etc/cont-init.d/50-config \
#\
# Allow UID and GID setting
#&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
#&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
#&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser
### 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}

View File

@@ -1 +0,0 @@
EXPERIMENTAL - DO NOT USE

View File

@@ -1,48 +0,0 @@
#include <tunables/global>
profile freqtrade_addon 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,
}

View File

@@ -1,31 +0,0 @@
{
"apparmor": true,
"arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"boot": "auto",
"description": "Simple High frequency trading bot for crypto currencies ",
"devices": [],
"environment": {},
"map": [
"share:rw"
],
"name": "freqtrade web server - DO NOT USE",
"options": {},
"ports": {
"8080/tcp": 9711
},
"ports_description": {
"8080/tcp": "web interface"
},
"privileged": [],
"schema": {},
"slug": "freqtrade",
"upstream": "2021.11",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "2021.11",
"webui": "http://[HOST]:[PORT:80]"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,15 +0,0 @@
#!/bin/bash
echo "Starting"
if [ ! -f /data/config.json ]; then
echo "building userdir"
freqtrade create-userdir --userdir /data
echo "building initial config"
freqtrade new-config --config /data/config.json
fi
sleep 5000000
echo "Starting app"
freqtrade trade --logfile /data/logs/freqtrade.log --db-url sqlite://///data/tradesv3.sqlite --config /data/config.json --strategy SampleStrategy

View File

@@ -1,29 +0,0 @@
#!/bin/bash
# If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then
echo "Bashio does not exist, executing script"
(
################
# Install apps #
################
PACKAGES="${PACKAGES:="curl"}"
apt-get clean \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \
|| apk add --no-cache ${PACKAGES}
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null
fi

View File

@@ -1,4 +1,11 @@
## 0.6.1 (14-12-2021)
- Update to latest version from yukulehe/gazpar2mqtt
- New standardized logic for Dockerfile build and packages installation
## 0.6 (11-12-2021)
- Update to latest version from yukulehe/gazpar2mqtt
## 0.5.3 (07-12-2021) ## 0.5.3 (07-12-2021)
- Update to latest version from yukulehe/gazpar2mqtt - Update to latest version from yukulehe/gazpar2mqtt
- mqtt autodiscover added - mqtt autodiscover added

View File

@@ -1,40 +1,38 @@
#################
# 1 Build Image #
#################
FROM yukulehe/gazpar2mqtt:latest FROM yukulehe/gazpar2mqtt:latest
# Base system ##################
ENV BASHIO_VERSION=0.14.3 # 2 Modify Image #
##################
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \ ENV PACKAGES="jq \
curl \ curl \
yamllint" yamllint"
# Copy root filesystem # Automatic apps & bashio
COPY rootfs / 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
RUN \ ################
################ # 4 Entrypoint #
# Install apps # ################
################
apt-get clean \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& apt-get clean \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio || true
RUN \
#################
# Copy template #
#################
mkdir -p /share/gazpar2mqtt \
&& cp -n /templates/config.yaml /share/gazpar2mqtt/
RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
@@ -42,7 +40,10 @@ CMD ["/entrypoint.sh"]
VOLUME [ "/data" ] VOLUME [ "/data" ]
VOLUME [ "/share" ] VOLUME [ "/share" ]
### LABELS ############
# 5 Labels #
############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -25,7 +25,7 @@
"mqtt:want" "mqtt:want"
], ],
"slug": "gazpar2mqtt", "slug": "gazpar2mqtt",
"upstream": "0.5.3", "upstream": "0.6.1",
"url": "https://github.com/alexbelgium/hassio-addons", "url": "https://github.com/alexbelgium/hassio-addons",
"version": "0.5.3" "version": "0.6.1"
} }

View File

@@ -2,34 +2,6 @@
echo "Starting..." echo "Starting..."
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
else
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
fi
fi
#################### ####################
# Starting scripts # # Starting scripts #
#################### ####################

View File

@@ -1,29 +1,18 @@
#!/bin/bash #!/bin/bash
# If dockerfile failed install manually # If dockerfile failed install manually
if [ ! -f "/usr/bin/bashio" ]; then if [ -e "/ENVFILE" ]; then
echo "Bashio does not exist, executing script" echo "Executing script"
PACKAGES=$(</ENVFILE)
( (
################ #######################
# Install apps # # Automatic installer #
################ #######################
PACKAGES="${PACKAGES:="curl"}" 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); 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); fi &&
apt-get clean \ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
&& apt-get update \ chmod 777 /automatic_packages.sh &&
&& apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ eval /./automatic_packages.sh "$PACKAGES" &&
|| apk add --no-cache ${PACKAGES} rm /automatic_packages.sh
###################
# Install bashio #
##################
mkdir -p /tmp/bashio
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" |
tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio
) >/dev/null ) >/dev/null
fi fi

View File

@@ -83,7 +83,8 @@ while IFS= read -r line; do
if [[ $line =~ ^.+[=].+$ ]]; then if [[ $line =~ ^.+[=].+$ ]]; then
export $line export $line
# Export the variable # Export the variable
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || sed -i "1a export $line" /scripts/*run* sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
# Show in log # Show in log
bashio::log.blue "$line" bashio::log.blue "$line"
else else

View File

@@ -1,3 +1,4 @@
- New standardized logic for Dockerfile build and packages installation
## 1.7.25 (17-11-2021) ## 1.7.25 (17-11-2021)
- Update to latest version from linuxserver/docker-grav - Update to latest version from linuxserver/docker-grav

View File

@@ -1,33 +1,18 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ENV BASHIO_VERSION=0.14.3
ENV PACKAGES="jq \ ##################
curl \ # 2 Modify Image #
cifs-utils \ ##################
keyutils \
samba \
samba-client"
RUN \ RUN \
################
# Install apps #
################
apk add --no-cache ${PACKAGES} \
\
###################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
# use /data instead of /config for hass.io environment # use /data instead of /config for hass.io environment
# && sed -i "s|/config|/share/grav|g" /etc/services.d/grav/run \ sed -i "s|/config|/share/grav|g" /etc/cont-init.d/50-config \
&& sed -i "s|/config|/share/grav|g" /etc/cont-init.d/50-config \
&& sed -i "s|/share/grav/nginx|/config/nginx|g" /etc/cont-init.d/50-config \ && sed -i "s|/share/grav/nginx|/config/nginx|g" /etc/cont-init.d/50-config \
\ \
# Allow UID and GID setting # Allow UID and GID setting
@@ -35,10 +20,37 @@ RUN \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser
# copy local files ##################
COPY root/ / # 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \
curl \
cifs-utils \
keyutils \
samba \
samba-client"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bashio
echo "Updating folders..."
for FOLDERS in "/share/grav" "/app/grav-admin/backup"
do
echo "... $FOLDERS"
mkdir -p $FOLDERS
chown -R abc:abc $FOLDERS
done
bashio::log.warning "If error of missing folder when loading addon, just restart"

View File

@@ -1,39 +1,44 @@
#################
# 1 Build Image #
#################
FROM troglobit/inadyn:latest FROM troglobit/inadyn:latest
# Base system ##################
ENV BASHIO_VERSION=0.14.3 # 2 Modify Image #
ARG BUILD_ARCH ##################
ARG BUILD_ARCH
ENV LANG='C.UTF-8'\ ENV LANG='C.UTF-8'\
TERM='xterm-256color'\ TERM='xterm-256color'\
GOPATH='/opt/go' GOPATH='/opt/go'
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="curl \ ENV PACKAGES="curl \
jq \ jq \
bash \ bash \
xz build-base libressl-dev ca-certificates npm" build-base libressl-dev ca-certificates npm"
RUN \ # 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); fi && \
# Install apps # 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); fi && \
################ curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
apk add --no-cache ${PACKAGES} \ chmod 777 /automatic_packages.sh && \
\ /automatic_packages.sh "${PACKAGES:-}" && \
################## rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
# Install bashio #
################## # Install mustache
&& mkdir -p /tmp/bashio \ RUN apk add --no-cache \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
####################
# Install mustache #
####################
&& apk add --no-cache \
go \ go \
npm \ npm \
xz \
# && npm install mustache-cli --global # && npm install mustache-cli --global
&& apk upgrade --no-cache &&\ && apk upgrade --no-cache &&\
apk add --no-cache --virtual .build-deps\ apk add --no-cache --virtual .build-deps\
@@ -43,19 +48,22 @@ RUN \
go get -u github.com/quantumew/mustache-cli &&\ go get -u github.com/quantumew/mustache-cli &&\
cp $GOPATH/bin/* /usr/bin/ && \ cp $GOPATH/bin/* /usr/bin/ && \
rm -rf $GOPATH /var/cache/apk/* /tmp/src &&\ rm -rf $GOPATH /var/cache/apk/* /tmp/src &&\
apk del .build-deps xz build-base apk del .build-deps xz build-base || true
# Copy root filesystem ################
COPY rootfs / # 4 Entrypoint #
################
WORKDIR / WORKDIR /
RUN chmod 777 /run.sh RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/run.sh" ] CMD [ "/entrypoint.sh" ]
VOLUME [ "/data" ] VOLUME [ "/data" ]
### LABELS ############
# 5 Labels #
############
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -0,0 +1,17 @@
#!/bin/bash
echo "Starting..."
####################
# Starting scripts #
####################
cd /
for SCRIPTS in scripts/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown $(id -u):$(id -g) $SCRIPTS
chmod a+x $SCRIPTS
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' $SCRIPTS || true
./$SCRIPTS || echo "$SCRIPTS: exiting $?"
done

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bashio
#################
# Create config #
#################
mustache-cli /data/options.json /templates/inadyn.mustache >/etc/inadyn.conf
##############
# Launch App #
##############
/usr/sbin/inadyn --foreground

View File

@@ -1,4 +1,15 @@
## 0.20.162 (14-12-2021)
- Update to latest version from linuxserver/docker-jackett
## 0.20.159 (12-12-2021)
- Update to latest version from linuxserver/docker-jackett
- New standardized logic for Dockerfile build and packages installation
- Removed full access (not used anymore)
## 0.20.147 (11-12-2021)
- Update to latest version from linuxserver/docker-jackett
## 0.20.141 (10-12-2021) ## 0.20.141 (10-12-2021)
- Update to latest version from linuxserver/docker-jackett - Update to latest version from linuxserver/docker-jackett

View File

@@ -1,28 +1,14 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ENV BASHIO_VERSION=0.14.3
ENV PACKAGES="curl"
RUN \ ##################
################ # 2 Modify Image #
# Install apps # ##################
################
apk add --no-cache ${PACKAGES} \
\
##################
# Install bashio #
##################
&& curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.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 || true
# use /data instead of /config for hass.io environment # use /data instead of /config for hass.io environment
RUN sed -i "s|/config|/config/jackett|g" /etc/services.d/jackett/run \ RUN sed -i "s|/config|/config/jackett|g" /etc/services.d/jackett/run \
@@ -33,10 +19,32 @@ RUN sed -i "s|/config|/config/jackett|g" /etc/services.d/jackett/run \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser
# copy local files ##################
COPY root/ / # 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="curl"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

View File

@@ -11,7 +11,6 @@
"PUID": "0", "PUID": "0",
"PGID": "0" "PGID": "0"
}, },
"full_access": true,
"map": [ "map": [
"config:rw", "config:rw",
"share:rw", "share:rw",
@@ -44,8 +43,8 @@
}, },
"slug": "jackett_nas", "slug": "jackett_nas",
"startup": "services", "startup": "services",
"upstream": "0.20.141", "upstream": "0.20.162",
"url": "https://github.com/alexbelgium/hassio-addons", "url": "https://github.com/alexbelgium/hassio-addons",
"version": "0.20.141", "version": "0.20.162",
"webui": "http://[HOST]:[PORT:9117]" "webui": "http://[HOST]:[PORT:9117]"
} }

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
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); 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); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do
printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k
done

View File

@@ -0,0 +1,19 @@
#!/usr/bin/with-contenv bash
if [ ! -d /share/storage/movies ]; then
echo "Creating /share/storage/movies"
mkdir -p /share/storage/movies
chown -R abc:abc /share/storage/movies
fi
if [ ! -d /share/downloads ]; then
echo "Creating /share/downloads"
mkdir -p /share/downloads
chown -R abc:abc /share/downloads
fi
if [ ! -d /config/jackett ]; then
echo "Creating /config/jackett"
mkdir -p /config/jackett
chown -R abc:abc /config/jackett
fi

View File

@@ -0,0 +1,32 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
# Mount local Share if configured
if bashio::config.has_value 'localdisks'; then
MOREDISKS=$(bashio::config 'localdisks')
echo "Local Disks mounting..."
# Separate comma separated values
for disk in ${MOREDISKS//,/ }; do
# Mount by device as default
devpath=/dev
# Mount as label
[ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label
# Creates dir
mkdir -p /mnt/$disk
chown -R $(id -u):$(id -g) /mnt/$disk
# Legacy mounting : mount to share if still exists (avoid breaking changes)
[ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true
# Mount
mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
done
fi

View File

@@ -0,0 +1,83 @@
#!/usr/bin/with-contenv bashio
#########################
# MOUNT SMB SHARES v1.6 #
#########################
if bashio::config.has_value 'networkdisks'; then
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
exit 0
fi
# Prepare mount point
mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname
#Tries to mount with default options
mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Messages
if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then
#Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze &&
bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" ||
bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
else
# Mounting failed messages
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
bashio::log.fatal "Here is some debugging info :"
# Provide debugging info
smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client
#smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true
# Error code
bashio::log.fatal "Error read : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount /mnt/$diskname 2>/dev/null || true
rmdir /mnt/$diskname || true
fi
done
fi

View File

@@ -1,4 +1,5 @@
- Add local mount (see readmeà - New standardized logic for Dockerfile build and packages installation
- Add local mount (see readme)
- Added watchdog feature - Added watchdog feature
- Allow mounting of devices up to sdg2 - Allow mounting of devices up to sdg2
- Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename - Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename

View File

@@ -1,40 +1,59 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM ARG BUILD_FROM
ARG BUILD_VERSION ARG BUILD_VERSION
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
# Set shell ##################
SHELL ["/bin/bash", "-o", "pipefail", "-c"] # 2 Modify Image #
ENV BASHIO_VERSION=0.14.3 ##################
ENV PACKAGES="jq \
samba \
cifs-utils \
smbclient"
RUN apt-get update \ # Allow UID and GID setting
&& apt-get install -y --no-install-recommends ${PACKAGES} \ RUN \
\ sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
# Allow UID and GID setting
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \ && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
&& sed -i "s|/config|/config/jellyfin|g" /etc/services.d/jellyfin/run \ && sed -i "s|/config|/config/jellyfin|g" /etc/services.d/jellyfin/run \
&& sed -i "s|/config|/config/jellyfin|g" /etc/cont-init.d/10-adduser \ && sed -i "s|/config|/config/jellyfin|g" /etc/cont-init.d/10-adduser \
&& sed -i "s|/config|/config/jellyfin|g" /etc/cont-init.d/30-config && sed -i "s|/config|/config/jellyfin|g" /etc/cont-init.d/30-config
# copy local files ##################
COPY root/ / # 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Manual apps
ENV PACKAGES="jq \
samba \
cifs-utils \
smbclient"
# 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); 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); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
#RUN chmod 777 /entrypoint.sh
#WORKDIR /
#ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
### LABELS
ARG BUILD_ARCH ARG BUILD_ARCH
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_DESCRIPTION ARG BUILD_DESCRIPTION

Some files were not shown because too many files have changed in this diff Show More