mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-31 09:13:33 +02:00
fix(nextcloud): use /share/nextcloud as default data directory and add data_location option
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/3206d642-bf8c-49cc-b828-1ca2fe084ac7 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
253909d46d
commit
9ca9b54cb0
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
## 33.0.3-2 (2026-05-29)
|
||||||
|
- Fix: Change default data directory for new installations from /config/data to /share/nextcloud
|
||||||
|
- Add data_location option to allow users to customize the Nextcloud data directory
|
||||||
|
|
||||||
## 33.0.3 (2026-05-02)
|
## 33.0.3 (2026-05-02)
|
||||||
- Update to latest version from linuxserver/docker-nextcloud (changelog : https://github.com/linuxserver/docker-nextcloud/releases)
|
- Update to latest version from linuxserver/docker-nextcloud (changelog : https://github.com/linuxserver/docker-nextcloud/releases)
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ schema:
|
|||||||
keyfile: str
|
keyfile: str
|
||||||
localdisks: str?
|
localdisks: str?
|
||||||
networkdisks: str?
|
networkdisks: str?
|
||||||
|
data_location: str?
|
||||||
skip_permissions_check: bool?
|
skip_permissions_check: bool?
|
||||||
trusted_domains: str?
|
trusted_domains: str?
|
||||||
use_own_certs: bool
|
use_own_certs: bool
|
||||||
@@ -151,5 +152,5 @@ slug: nextcloud_ocr
|
|||||||
uart: true
|
uart: true
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud
|
||||||
version: "33.0.3"
|
version: "33.0.3-2"
|
||||||
webui: https://[HOST]:[PORT:443]
|
webui: https://[HOST]:[PORT:443]
|
||||||
|
|||||||
@@ -16,17 +16,31 @@ mkdir -p /data/config
|
|||||||
chmod 755 -R /data/config
|
chmod 755 -R /data/config
|
||||||
chown -R "$PUID:$PGID" "/data/config"
|
chown -R "$PUID:$PGID" "/data/config"
|
||||||
|
|
||||||
|
# Check data_location option
|
||||||
|
if bashio::config.has_value "data_location"; then
|
||||||
|
custom_data_location="$(bashio::config 'data_location')"
|
||||||
|
# Validate path is in an allowed location
|
||||||
|
location_ok=""
|
||||||
|
for location in "/share" "/config" "/data" "/mnt"; do
|
||||||
|
if [[ "$custom_data_location" == "$location"* ]]; then
|
||||||
|
location_ok=true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -z "$location_ok" ]; then
|
||||||
|
bashio::log.warning "Your data_location value can only be set in /share, /config, /data or /mnt. Falling back to default."
|
||||||
|
custom_data_location=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Check current version
|
# Check current version
|
||||||
if [ -f /data/config/www/nextcloud/config/config.php ]; then
|
if [ -f /data/config/www/nextcloud/config/config.php ]; then
|
||||||
datadirectory="$(sed -n "s|.*datadirectory.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
|
datadirectory="$(sed -n "s|.*datadirectory.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
|
||||||
echo "... data directory detected : $datadirectory"
|
echo "... data directory detected : $datadirectory"
|
||||||
else
|
else
|
||||||
datadirectory=/config/data
|
datadirectory="${custom_data_location:-/share/nextcloud}"
|
||||||
echo "Nextcloud is not installed yet, the default data directory is : $datadirectory. You can change it during nextcloud installation."
|
echo "Nextcloud is not installed yet, the default data directory is : $datadirectory. You can change it during nextcloud installation."
|
||||||
mkdir -p /config/data
|
mkdir -p "$datadirectory"
|
||||||
chmod 755 /config/data
|
chmod 755 "$datadirectory"
|
||||||
mkdir -p /share/nextcloud
|
|
||||||
chmod 755 /share/nextcloud
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Is the directory valid
|
# Is the directory valid
|
||||||
|
|||||||
Reference in New Issue
Block a user