This commit is contained in:
Alexandre
2022-01-17 13:18:05 +01:00
parent 0b0b471cbe
commit a22ce94a46
67 changed files with 263 additions and 207 deletions

View File

@@ -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

View File

@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
PUID=$(bashio::config "PUID")
PGID=$(bashio::config "PGID")

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 :"

View File

@@ -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

View File

@@ -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
###########################