mirror of
https://github.com/linuxserver/docker-nextcloud.git
synced 2026-02-19 23:03:50 +08:00
Add admin password reset
This commit is contained in:
parent
6bfe392a35
commit
7f0c54263e
@ -138,6 +138,7 @@ if [[ -f /config/www/nextcloud/config/needs_migration ]] || [[ -f /tmp/needs_ins
|
||||
--database-name="${DB_NAME}" \
|
||||
--database-user="${DB_USER}" \
|
||||
--database-pass="${DB_PASS}" \
|
||||
--admin-user="${ADMIN_USER:-admin}" \
|
||||
--admin-pass="${ADMIN_PASS}" \
|
||||
--data-dir=/data
|
||||
|
||||
@ -183,6 +184,12 @@ if occ config:system:get installed >/dev/null 2>&1; then
|
||||
if ! occ config:system:get upgrade.disable-web >/dev/null 2>&1; then
|
||||
occ config:system:set upgrade.disable-web --value=true --type=boolean
|
||||
fi
|
||||
|
||||
# Set admin password
|
||||
if [[ "${ADMIN_PASS+x}" ]]; then
|
||||
echo "Setting admin password"
|
||||
occ user:resetpassword --password-from-env "${ADMIN_USER:-admin}"
|
||||
fi
|
||||
else
|
||||
echo "After completing the web-based installer, restart the Nextcloud container to apply default memory caching and transactional file locking configurations."
|
||||
echo "Alternatively, you can apply your own configurations by editing /config/www/nextcloud/config/config.php following the documentation:"
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
sudo -u abc -s /bin/bash -c "php /app/www/public/occ $*"
|
||||
export NC_PASS=${ADMIN_PASS}
|
||||
sudo -E -u abc -s /bin/bash -c "php /app/www/public/occ $*"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user