DD- facilita la instalacion desde el dd-ctl

develop
elena 2022-10-26 16:05:48 +02:00 committed by Evilham
parent 651d5f8e90
commit bd27ef4b6a
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
2 changed files with 13 additions and 17 deletions

14
dd-ctl
View File

@ -444,12 +444,21 @@ setup_moodle(){
echo " --> Applying custom settings in moodle" echo " --> Applying custom settings in moodle"
# TODO: check why admin/cli/cfg can't be read with -u nobody # TODO: check why admin/cli/cfg can't be read with -u nobody
docker exec -i dd-apps-moodle sh -s <<-EOF docker exec -i dd-apps-moodle sh -s <<-EOF
php7 admin/cli/maintenance.php --enable
php7 admin/cli/cfg.php --name=guestloginbutton --set=0 php7 admin/cli/cfg.php --name=guestloginbutton --set=0
php7 admin/cli/cfg.php --name=enrol_plugins_enabled --set=manual php7 admin/cli/cfg.php --name=enrol_plugins_enabled --set=manual
php7 admin/cli/cfg.php --name=enablemobilewebservice --set=0 php7 admin/cli/cfg.php --name=enablemobilewebservice --set=0
php7 admin/cli/cfg.php --name=enablebadges --set=0 php7 admin/cli/cfg.php --name=enablebadges --set=0
php7 admin/cli/cfg.php --name=timezone --set="${MOODLE_TIMEZONE-Europe/Madrid}" php7 admin/cli/cfg.php --name=timezone --set="${MOODLE_TIMEZONE-Europe/Madrid}"
php7 admin/cli/purge_caches.php php7 admin/cli/upgrade.php --non-interactive
php7 theme/cbe/postinstall.php \
--wwwroot="moodle.${DD_DOMAIN}" \
--ncadmin="${NEXTCLOUD_ADMIN_USER}" \
--ncpass="${NEXTCLOUD_ADMIN_PASSWORD}" \
--sitename="${DD_TITLE}" \
--contactname="${DD_LETSENCRYPT_EMAIL}" \
--contactemail="${DD_LETSENCRYPT_EMAIL}"
php7 admin/cli/maintenance.php --disable
EOF EOF
} }
@ -905,6 +914,9 @@ case "$OPERATION" in
setup_moodle setup_moodle
setup_wordpress setup_wordpress
chown 82:82 /opt/DD/data/moodle/saml2/*
chmod 777 /opt/DD/data/moodle/saml2/*
saml --no-up saml --no-up
cat <<-EOF cat <<-EOF

View File

@ -238,22 +238,6 @@ sleep 30
./dd-ctl down ./dd-ctl down
./dd-ctl up ./dd-ctl up
# Address Moodle custom settings, plugins and registration
NEXTCLOUD_ADMIN_USER="$(grep -E '^NEXTCLOUD_ADMIN_USER=' dd.conf | cut -d = -f 2-)"
NEXTCLOUD_ADMIN_PASSWORD="$(grep -E '^NEXTCLOUD_ADMIN_PASSWORD=' dd.conf | cut -d = -f 2-)"
docker exec -i -u nobody dd-apps-moodle sh -s <<EOF
php admin/cli/maintenance.php --enable
php admin/cli/upgrade.php --non-interactive
php theme/cbe/postinstall.php \
--wwwroot="moodle.${DD_DOMAIN}" \
--ncadmin="${NEXTCLOUD_ADMIN_USER}" \
--ncpass="${NEXTCLOUD_ADMIN_PASSWORD}" \
--sitename="${DD_TITLE}" \
--contactname="${DD_LETSENCRYPT_EMAIL}" \
--contactemail="${DD_LETSENCRYPT_EMAIL}"
php admin/cli/maintenance.php --disable
EOF
## Ensure SAML is set up ## Ensure SAML is set up
./dd-ctl saml --no-up ./dd-ctl saml --no-up