Skip to content

Commit

Permalink
Restore
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbelgium committed Nov 21, 2023
1 parent 2e6e469 commit 8e035dd
Show file tree
Hide file tree
Showing 350 changed files with 1,813 additions and 1,233 deletions.
246 changes: 151 additions & 95 deletions .github/stars.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/starsevol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/stats_addons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .templates/00-global_var.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ for KEYS in "${arr[@]}"; do
export "${KEYS}='${VALUE}'"
# set .env
echo "$KEYS=\"$VALUE\"" >> /.env || true
# set /etc/environmemt
# set /etc/environment
mkdir -p /etc
echo "$KEYS=$VALUE" >> /etc/environmemt
echo "$KEYS=$VALUE" >> /etc/environment
# For non s6
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
Expand Down
14 changes: 14 additions & 0 deletions .templates/00-smb_mounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ if bashio::config.has_value 'networkdisks'; then
SMBVERS="$(nmap --script smb-protocols "$server" -p 445 2>1 | awk '/ [0-9]/' | awk '{print $NF}' | cut -c -3 | sort -V | tail -n 1 || true)"
# Manage output
if [ -n "$SMBVERS" ]; then
case $SMBVERS in
202)
SMBVERS="2.0"
;;
21)
SMBVERS="2.1"
;;
302)
SMBVERS="3.02"
;;
311)
SMBVERS="3.1.1"
;;
esac
echo "... SMB version $SMBVERS detected"
SMBVERS=",vers=$SMBVERS"
elif smbclient -t 2 -L "$server" -m NT1 -N $DOMAINCLIENT &>/dev/null; then
Expand Down
41 changes: 33 additions & 8 deletions .templates/01-config_yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ set -e
##################

# Exit if /config is not mounted
if [ ! -f /config/configuration.yaml ] || [ ! -d /config/.storage ]; then
if [ ! -d /config ]; then
exit 0
fi

# Define slug if
slug="${HOSTNAME#*-}"

# Check type of config folder
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
# New config location
CONFIGLOCATION="/config"
else
# Legacy config location
CONFIGLOCATION="/config/addons_config/${slug}"
fi

# Where is the config
if bashio::config.has_value 'CONFIG_LOCATION'; then

Expand All @@ -29,14 +41,27 @@ if bashio::config.has_value 'CONFIG_LOCATION'; then
fi
done
if [ -z "$LOCATIONOK" ]; then
CONFIGSOURCE=/config/addons_config/${HOSTNAME#*-}
CONFIGSOURCE="$CONFIGLOCATION"
bashio::log.red "Watch-out : your CONFIG_LOCATION values can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $CONFIGSOURCE"
fi

else
# Use default
CONFIGSOURCE="/config/addons_config/${HOSTNAME#*-}/config.yaml"
CONFIGSOURCE="$CONFIGLOCATION/config.yaml"
fi

# Migrate if needed
if [ "$CONFIGLOCATION" == "/config" ]; then
# Migrate file
if [ -f "/homeassistant/addons_config/${slug}/config.yaml" ]; then
echo "Migrating config.yaml to new config location"
mv /homeassistant/addons_config/"${slug}"/config.yaml /config/config.yaml
fi
# Migrate option
if [[ "$(bashio::config "CONFIG_LOCATION")" == "/config/addons_config"* ]] && [ -f /config/config.yaml ]; then
bashio::addon.option "CONFIG_LOCATION" "/config/config.yaml"
CONFIGSOURCE="$(bashio::config "CONFIG_LOCATION")"
fi
fi

# Permissions
Expand Down Expand Up @@ -120,13 +145,13 @@ while IFS= read -r line; do
# Check if secret
if [[ "${line}" == *'!secret '* ]]; then
echo "secret detected"
secret=${line#*secret }
secret="${line#*secret }"
# Check if single match
secretnum=$(sed -n "/$secret:/=" /config/secrets.yaml)
secretnum="$(sed -n "/$secret:/=" /config/secrets.yaml)"
[[ $(echo $secretnum) == *' '* ]] && bashio::exit.nok "There are multiple matches for your password name. Please check your secrets.yaml file"
# Get text
secret=$(sed -n "/$secret:/p" /config/secrets.yaml)
secret=${secret#*: }
secret="$(sed -n "/$secret:/p" /config/secrets.yaml)"
secret="${secret#*: }"
line="${line%%=*}='$secret'"
fi
# Data validation
Expand All @@ -144,7 +169,7 @@ while IFS= read -r line; do
# set .env
if [ -f /.env ]; then echo "$KEYS=$VALUE" >> /.env; fi
mkdir -p /etc
echo "$KEYS=$VALUE" >> /etc/environmemt
echo "$KEYS=$VALUE" >> /etc/environment
# Export to scripts
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
Expand Down
35 changes: 22 additions & 13 deletions .templates/01-custom_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,35 @@
# shellcheck shell=bash
set -e

# Define slug if needed
slug="${HOSTNAME#*-}"
bashio::log.green "Execute /config/addons_autoscripts/${slug}.sh if existing"
bashio::log.green "---------------------------------------------------------"
echo "Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation"

mkdir -p /config/addons_autoscripts

# Migrate scripts
if [ -f /config/"${slug}".sh ]; then
mv -f /config/"${slug}".sh /config/addons_autoscripts/"${slug}".sh
# Check type of config folder
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
# Migrate previous script
if [ -f /homeassistant/addons_autoscripts/"${slug}".sh ]; then
echo "Migrating scripts to new config location"
mv -f /homeassistant/addons_autoscripts/"${slug}".sh /config/"${slug}".sh
fi
# New config location
CONFIGLOCATION="/config"
else
# Legacy config location
CONFIGLOCATION="/config/addons_autoscripts"
mkdir -p /config/addons_autoscripts
fi

bashio::log.green "Execute $CONFIGLOCATION/${slug}.sh if existing"
bashio::log.green "---------------------------------------------------------"
echo "Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation"

# Execute scripts
if [ -f /config/addons_autoscripts/"${slug}".sh ]; then
if [ -f "$CONFIGLOCATION/${slug}".sh ]; then
bashio::log.green "... script found, executing"
# Convert scripts to linux
dos2unix /config/addons_autoscripts/"${slug}".sh || true
chmod +x /config/addons_autoscripts/"${slug}".sh || true
/./config/addons_autoscripts/"${slug}".sh
dos2unix "$CONFIGLOCATION/${slug}".sh || true
chmod +x "$CONFIGLOCATION/${slug}".sh || true
/."$CONFIGLOCATION/${slug}".sh
else
bashio::log.green "... no script found, exiting"
fi

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ If you want to do add the repository manually, please follow the procedure highl
### Number of addons

- In the repository : 83
- Installed : 38360
- Installed : 46033

### Top 3

1. Filebrowser (4144x)
2. Portainer (4136x)
3. Arpspoof (1277x)
1. Filebrowser (6078x)
2. Portainer (5838x)
3. Arpspoof (1429x)

### Architectures used

Expand All @@ -74,7 +74,7 @@ If you want to do add the repository manually, please follow the procedure highl
## Add-ons provided by this repository


✓ [Arpspoof (1277x)](arpspoof/) : block internet connection for local network devices
✓ [Arpspoof (1429x)](arpspoof/) : block internet connection for local network devices

  ![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Farpspoof%2Fconfig.json)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Farpspoof%2Fupdater.json)
Expand Down Expand Up @@ -223,7 +223,7 @@ If you want to do add the repository manually, please follow the procedure highl
![amd64][amd64-badge]
![armv7no][armv7no-badge]

✓ ![image](https://api.iconify.design/mdi/file-search.svg) [Filebrowser (4144x)](filebrowser/) : filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files
✓ ![image](https://api.iconify.design/mdi/file-search.svg) [Filebrowser (6078x)](filebrowser/) : filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files

  ![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Ffilebrowser%2Fconfig.json)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Ffilebrowser%2Fupdater.json)
Expand Down Expand Up @@ -272,7 +272,7 @@ If you want to do add the repository manually, please follow the procedure highl
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fflexget%2Fupdater.json)
![aarch64][aarch64-badge]
![amd64][amd64-badge]
![armv7][armv7-badge]
![armv7no][armv7no-badge]

✓ [Free Games Claimer (NoVNC not working)](free_games_claimer/) : automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG

Expand Down Expand Up @@ -491,13 +491,13 @@ If you want to do add the repository manually, please follow the procedure highl
![amd64][amd64-badge]
![armv7no][armv7no-badge]

✓ [Paperless NGX](paperless_ngx/) : scan, index and archive all your physical documents
✓ [Paperless NGX](paperless_ngx/) : Scan, index and archive all your physical documents

  ![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fpaperless_ngx%2Fconfig.json)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fpaperless_ngx%2Fupdater.json)
![aarch64][aarch64-badge]
![amd64][amd64-badge]
![armv7][armv7-badge]
![armv7no][armv7no-badge]
![MariaDB][mariadb-badge]
![smb][smb-badge]
![localdisks][localdisks-badge]
Expand Down Expand Up @@ -551,7 +551,7 @@ If you want to do add the repository manually, please follow the procedure highl
![amd64][amd64-badge]
![armv7][armv7-badge]

✓ ![image](https://api.iconify.design/mdi/docker.svg) [Portainer (4136x)](portainer/) : Manage your Docker environment with ease
✓ ![image](https://api.iconify.design/mdi/docker.svg) [Portainer (5838x)](portainer/) : Manage your Docker environment with ease

  ![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer%2Fconfig.json)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer%2Fupdater.json)
Expand All @@ -560,7 +560,7 @@ If you want to do add the repository manually, please follow the procedure highl
![armv7][armv7-badge]
![ingress][ingress-badge]

✓ [Portainer (4136x) Agent](portainer_agent/) : An agent used to manage all the resources in a Swarm cluster
✓ [Portainer (5838x) Agent](portainer_agent/) : An agent used to manage all the resources in a Swarm cluster

  ![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer_agent%2Fconfig.json)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer_agent%2Fupdater.json)
Expand Down
Loading

0 comments on commit 8e035dd

Please sign in to comment.