mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-29 01:10:32 +02:00
Improve permissions code https://github.com/alexbelgium/hassio-addons/issues/911
This commit is contained in:
@@ -124,6 +124,6 @@
|
|||||||
"slug": "nextcloud_ocr",
|
"slug": "nextcloud_ocr",
|
||||||
"uart": true,
|
"uart": true,
|
||||||
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud",
|
"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]"
|
"webui": "https://[HOST]:[PORT:443]"
|
||||||
}
|
}
|
||||||
@@ -22,19 +22,12 @@ rootuser='root'
|
|||||||
datadirectory=$(bashio::config 'data_directory')
|
datadirectory=$(bashio::config 'data_directory')
|
||||||
|
|
||||||
printf "Creating possible missing Directories\n"
|
printf "Creating possible missing Directories\n"
|
||||||
mkdir -p "$ocpath"/data
|
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
|
||||||
mkdir -p "$ocpath"/assets
|
if [ ! -f "$folder" ]; then
|
||||||
mkdir -p "$ocpath"/updater
|
echo "... $folder"
|
||||||
mkdir -p "$ocpath"/apps
|
mkdir -p "$folder" || true
|
||||||
mkdir -p "$ocpath"/assets
|
fi
|
||||||
mkdir -p "$ocpath"/config
|
done
|
||||||
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
|
|
||||||
|
|
||||||
printf "chmod Files and Directories. This could take some time, please wait...\n"
|
printf "chmod Files and Directories. This could take some time, please wait...\n"
|
||||||
#chmod -R 777 "${ocpath}"
|
#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"
|
printf "chown Directories. This could take some time, please wait...\n"
|
||||||
chown -R ${rootuser}:${htgroup} "${ocpath}"/
|
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
|
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"
|
printf "chmod/chown .htaccess\n"
|
||||||
|
|
||||||
if [ -f "${ocpath}"/.htaccess ]; then
|
if [ -f "${ocpath}"/.htaccess ]; then
|
||||||
chmod 0644 "${ocpath}"/.htaccess
|
chmod 0644 "${ocpath}"/.htaccess
|
||||||
chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess
|
chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${ocpath}"/data/.htaccess ]; then
|
if [ -f "${ocpath}"/data/.htaccess ]; then
|
||||||
chmod 0644 "${ocpath}"/data/.htaccess
|
chmod 0644 "${ocpath}"/data/.htaccess
|
||||||
chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess
|
chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess
|
||||||
|
|||||||
Reference in New Issue
Block a user