This commit is contained in:
Alexandre
2023-07-22 08:57:05 +02:00
parent ad9096ef8d
commit be81dc8986
2 changed files with 12 additions and 23 deletions

View File

@@ -124,6 +124,6 @@
"slug": "nextcloud_ocr",
"uart": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud",
"version": "27.0.1-2",
"version": "27.0.1-3",
"webui": "https://[HOST]:[PORT:443]"
}

View File

@@ -22,19 +22,12 @@ rootuser='root'
datadirectory=$(bashio::config 'data_directory')
printf "Creating possible missing Directories\n"
mkdir -p "$ocpath"/data
mkdir -p "$ocpath"/assets
mkdir -p "$ocpath"/updater
mkdir -p "$ocpath"/apps
mkdir -p "$ocpath"/assets
mkdir -p "$ocpath"/config
mkdir -p "$ocpath"/data
mkdir -p "$ocpath"/themes
mkdir -p /data/config/nextcloud/config
mkdir -p /data/config/nextcloud/data
mkdir -p /data/config/www/nextcloud/occ 2>/dev/null
mkdir -p "$datadirectory"
mkdir -p /ssl/nextcloud/keys
for folder in "$ocpath"/data "$ocpath"/assets "$ocpath"/updater "$ocpath"/apps "$ocpath"/assets "$ocpath"/config "$ocpath"/data "$ocpath"/themes /data/config/nextcloud/config /data/config/nextcloud/data "$datadirectory" /ssl/nextcloud/keys; do
if [ ! -f "$folder" ]; then
echo "... $folder"
mkdir -p "$folder" || true
fi
done
printf "chmod Files and Directories. This could take some time, please wait...\n"
#chmod -R 777 "${ocpath}"
@@ -46,22 +39,18 @@ find "${ocpath}"/ -type d -exec chmod 0750 {} \;
printf "chown Directories. This could take some time, please wait...\n"
chown -R ${rootuser}:${htgroup} "${ocpath}"/
chown -R ${htuser}:${htgroup} "${ocpath}"/apps/
chown -R ${htuser}:${htgroup} "${ocpath}"/assets/
chown -R ${htuser}:${htgroup} "${ocpath}"/config/
chown -R ${htuser}:${htgroup} "${ocpath}"/data/
chown -R ${htuser}:${htgroup} "${ocpath}"/themes/
chown -R ${htuser}:${htgroup} "${ocpath}"/updater/
chown -R ${htuser}:${htgroup} "${datadirectory}"
chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true
chmod +x "${ocpath}"/occ
for folder in "${ocpath}"/apps/ "${ocpath}"/assets/ "${ocpath}"/config/ "${ocpath}"/data/ "${ocpath}"/themes/ "${datadirectory}" /ssl/nextcloud/keys; do
chown -R ${htuser}:${htgroup} || true
done
printf "chmod/chown .htaccess\n"
if [ -f "${ocpath}"/.htaccess ]; then
chmod 0644 "${ocpath}"/.htaccess
chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess
fi
if [ -f "${ocpath}"/data/.htaccess ]; then
chmod 0644 "${ocpath}"/data/.htaccess
chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess