mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-02-01 09:27:44 +01:00
hadolint
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
ocpath="${NEXTCLOUD_PATH}"
|
||||
htuser='abc'
|
||||
@@ -44,13 +45,11 @@ chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true
|
||||
chmod +x ${ocpath}/occ
|
||||
|
||||
printf "chmod/chown .htaccess\n"
|
||||
if [ -f ${ocpath}/.htaccess ]
|
||||
then
|
||||
if [ -f ${ocpath}/.htaccess ]; then
|
||||
chmod 0644 ${ocpath}/.htaccess
|
||||
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
|
||||
fi
|
||||
if [ -f ${ocpath}/data/.htaccess ]
|
||||
then
|
||||
if [ -f ${ocpath}/data/.htaccess ]; then
|
||||
chmod 0644 ${ocpath}/data/.htaccess
|
||||
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
PUID=$(bashio::config "PUID")
|
||||
PGID=$(bashio::config "PGID")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
if bashio::config.true 'use_own_certs'; then
|
||||
|
||||
@@ -26,7 +27,7 @@ echo "... adding ssl certs in files"
|
||||
#Sets certificates
|
||||
for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do
|
||||
if [ -f $NGINXFILE ]; then
|
||||
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
|
||||
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
|
||||
if [ ! -z $LINE ]; then
|
||||
sed -i "/ssl_certificate/ d" $NGINXFILE
|
||||
sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
#create folders
|
||||
datadirectory=$(bashio::config 'data_directory')
|
||||
@@ -6,17 +7,17 @@ mkdir -p \
|
||||
$datadirectory \
|
||||
/data/config/nextcloud/config \
|
||||
/data/config/nextcloud/data \
|
||||
/data/config/www/nextcloud/config
|
||||
/data/config/www/nextcloud/config
|
||||
|
||||
#permissions
|
||||
chown abc:abc \
|
||||
$datadirectory \
|
||||
/data/config/nextcloud/config \
|
||||
/data/config/nextcloud/data \
|
||||
/data/config/www/nextcloud/config
|
||||
|
||||
chown -R abc:abc \
|
||||
/data/config/www/nextcloud/config
|
||||
|
||||
chown -R abc:abc \
|
||||
/var/lib/nginx
|
||||
|
||||
|
||||
rm -r /data/config/www/nextcloud/assets &>/dev/null
|
||||
chmod -R 777 /data/config
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Change data directory
|
||||
datadirectory=$(bashio::config 'data_directory')
|
||||
@@ -6,7 +7,7 @@ bashio::log.info "Setting data diretory: ${datadirectory}"
|
||||
sed -i "s|%%datadirectory%%|$datadirectory|g" /defaults/config.php
|
||||
|
||||
# copy config
|
||||
[[ ! -f /data/config/www/nextcloud/config/config.php ]] && \
|
||||
[[ ! -f /data/config/www/nextcloud/config/config.php ]] &&
|
||||
cp /defaults/config.php /data/config/www/nextcloud/config/config.php
|
||||
|
||||
# permissions
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found"
|
||||
if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
if bashio::services.available 'mysql'; then
|
||||
bashio::log.warning "MariaDB addon was found! It can't be configured automatically, but you can configure it manually using those values in the initial set-up :"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found"
|
||||
if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
||||
@@ -27,14 +28,14 @@ if bashio::config.has_value 'OCR'; then
|
||||
if bashio::config.has_value 'OCRLANG'; then
|
||||
OCRLANG=$(bashio::config 'OCRLANG')
|
||||
for LANG in $(echo "$OCRLANG" | tr "," " "); do
|
||||
if [ $LANG != "eng" ]; then
|
||||
apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community
|
||||
fi
|
||||
bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform"
|
||||
# Downloading trainer data
|
||||
cd /usr/share/tessdata
|
||||
rm -r $LANG.traineddata &>/dev/null || true
|
||||
wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null
|
||||
if [ $LANG != "eng" ]; then
|
||||
apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community
|
||||
fi
|
||||
bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform"
|
||||
# Downloading trainer data
|
||||
cd /usr/share/tessdata
|
||||
rm -r $LANG.traineddata &>/dev/null || true
|
||||
wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null
|
||||
done
|
||||
fi
|
||||
elif $(bashio::config 'OCR') = false; then
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found"
|
||||
if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
||||
@@ -20,15 +21,15 @@ if bashio::config.has_value 'trusted_domains'; then
|
||||
bashio::log.info "Currently set trusted domains :"
|
||||
$LAUNCHER config:system:get trusted_domains || bashio::log.info "No trusted domain set yet. The first one will be set when doing initial configuration"
|
||||
|
||||
bashio::log.info "Trusted domains set in the configuration. Refreshing domains." && \
|
||||
###################################
|
||||
# Remove previous trusted domains #
|
||||
###################################
|
||||
bashio::log.info "... removing previously added trusted domain (except for first one created)"
|
||||
bashio::log.info "Trusted domains set in the configuration. Refreshing domains." &&
|
||||
###################################
|
||||
# Remove previous trusted domains #
|
||||
###################################
|
||||
bashio::log.info "... removing previously added trusted domain (except for first one created)"
|
||||
i=2
|
||||
until [ $i -gt 5 ]; do
|
||||
$LAUNCHER config:system:delete trusted_domains $i && \
|
||||
((i = i + 1)) || exit
|
||||
$LAUNCHER config:system:delete trusted_domains $i &&
|
||||
((i = i + 1)) || exit
|
||||
done
|
||||
|
||||
###########################
|
||||
|
||||
Reference in New Issue
Block a user