diff --git a/README.md b/README.md index 97a8d3356ce5e9918142f744cf36c52981fa2628..82e00840fab52d35de1bbfc49563df8a50bb61b0 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Overview -Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments. This charm deploys Moodle 3.3 (using git://git.moodle.org/moodle.git as source) as outlined by the Moodle Installation Guide. +Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments. This charm deploys Moodle (using git://git.moodle.org/moodle.git as source) as outlined by the Moodle Installation Guide. # Usage @@ -55,7 +55,7 @@ If you enable this feature a cron job will be installed, and every night checks juju config moodle auto-update=true ##Branch -It refers to Moodle git branch. By default this charm checkouts MOODLE_34_STABLE branch, but you can upgrade your Moodle installation by setting this charm option +It refers to Moodle git branch. By default this charm checkouts MOODLE_35_STABLE branch, but you can upgrade your Moodle installation by setting this charm option juju config moodle branch=MOODLE_XY_STABLE @@ -71,5 +71,5 @@ Moodle needs to send e-mail notifications to users. You can set up your outgoing # Contact Information -csd-support@garr.it +cloud-support@garr.it diff --git a/config.yaml b/config.yaml index 1f01bdd2b041f0e599bae99534cbf90c3ce0a5aa..752d8ae6e143ca7db10b986aefa6dd39c167c694 100644 --- a/config.yaml +++ b/config.yaml @@ -4,7 +4,7 @@ options: type: string description: The FQDN to access Moodle on (without HTTP protocol. E.g. www.example.com) branch: - default: "MOODLE_34_STABLE" + default: "MOODLE_38_STABLE" type: string description: Moodle git branch to install or upgrade datadir: diff --git a/hooks/config-changed b/hooks/config-changed index 63d6ce9c14b6599d2d6fa18a8f8726ce745285d4..087686d2fec25393b471612b83c5d1172622eb70 100755 --- a/hooks/config-changed +++ b/hooks/config-changed @@ -63,15 +63,15 @@ if [ -f $WWWROOT/config.php ]; then OLD_DATADIR=`cat $WWWROOT/config.php | grep dataroot | awk '{print $3}' | cut -d "'" -f 2` if [ "$OLD_DATADIR" != "$DATADIR" ]; then - juju-log "Changing Moodle data dir" - mkdir -p $DATADIR - mv $OLD_DATADIR/* $DATADIR - chown -R root $DATADIR - chgrp -R www-data $DATADIR - chmod -R 02770 $DATADIR - STR_OLD=`cat $WWWROOT/config.php | grep dataroot` - STR_NEW="\$CFG->dataroot = '$DATADIR';" - sed -i "s|$STR_OLD|$STR_NEW|g" $WWWROOT/config.php + juju-log "Changing Moodle data dir" + mkdir -p $DATADIR + mv $OLD_DATADIR/* $DATADIR + chown -R root $DATADIR + chgrp -R www-data $DATADIR + chmod -R 02770 $DATADIR + STR_OLD=`cat $WWWROOT/config.php | grep dataroot` + STR_NEW="\$CFG->dataroot = '$DATADIR';" + sed -i "s|$STR_OLD|$STR_NEW|g" $WWWROOT/config.php fi fi @@ -154,23 +154,23 @@ fi if [ ! -z "$MPM_TYPE" ]; then juju-log "Configure Apache MPM" if ( echo "mpm_prefork mpm_event mpm_worker" | grep -w $MPM_TYPE ); then - for atype in mpm_prefork mpm_event mpm_worker ; do - if [ "$atype" != "$MPM_TYPE" ]; then - a2dismod $atype - fi - done - for atype in mpm_prefork mpm_event mpm_worker ; do - if [ "$atype" == "$MPM_TYPE" ]; then - a2enmod $atype - set -f - mpmCfgArray=(${MPM_CONFIG//,/ }) - for elemArray in "${mpmCfgArray[@]}" ; do - elemKey=$(echo $elemArray | cut -f1 -d=) - elemVal=$(echo $elemArray | cut -f2 -d=) - sed -i "s|^\(\s\+\)$elemKey.*|\1 $elemKey $elemVal|g" /etc/apache2/mods-available/${MPM_TYPE}.conf - done - fi - done + for atype in mpm_prefork mpm_event mpm_worker ; do + if [ "$atype" != "$MPM_TYPE" ]; then + a2dismod $atype + fi + done + for atype in mpm_prefork mpm_event mpm_worker ; do + if [ "$atype" == "$MPM_TYPE" ]; then + a2enmod $atype + set -f + mpmCfgArray=(${MPM_CONFIG//,/ }) + for elemArray in "${mpmCfgArray[@]}" ; do + elemKey=$(echo $elemArray | cut -f1 -d=) + elemVal=$(echo $elemArray | cut -f2 -d=) + sed -i "s|^\(\s\+\)$elemKey.*|\1 $elemKey $elemVal|g" /etc/apache2/mods-available/${MPM_TYPE}.conf + done + fi + done fi fi diff --git a/hooks/mysql-db-relation-broken b/hooks/mysql-db-relation-broken old mode 100644 new mode 100755 diff --git a/hooks/mysql-db-relation-changed b/hooks/mysql-db-relation-changed old mode 100644 new mode 100755 index f650b2f5bf83eb2fb02e7f13ab30e999be293d05..ccb4aea23f73f2b25051a7da8ec668229fe20e7a --- a/hooks/mysql-db-relation-changed +++ b/hooks/mysql-db-relation-changed @@ -66,7 +66,7 @@ else #Execute CLI Moodle installer juju-log "Database population" - /usr/bin/php $WWWROOT/admin/cli/install.php --lang=it --wwwroot=$HTTP_PROT://$DNS_NAME --dataroot=$DATADIR --dbtype=mysqli --dbhost=$db_host --dbname=$db_db --dbuser=$db_user --dbpass=$db_pass --prefix=mdl --fullname="$FULLNAME" --shortname="$SHORTNAME" --adminuser=$MDL_ADMIN --adminpass=$MDL_ADMINPASS --chmod=2770 --non-interactive --agree-license + /usr/bin/php $WWWROOT/admin/cli/install.php --lang=en --wwwroot=$HTTP_PROT://$DNS_NAME --dataroot=$DATADIR --dbtype=mysqli --dbhost=$db_host --dbname=$db_db --dbuser=$db_user --dbpass=$db_pass --prefix=mdl --fullname="$FULLNAME" --shortname="$SHORTNAME" --adminuser=$MDL_ADMIN --adminpass=$MDL_ADMINPASS --chmod=2770 --non-interactive --agree-license #Remove install dir for security rm -r $WWWROOT/install diff --git a/hooks/mysql-db-relation-departed b/hooks/mysql-db-relation-departed old mode 100644 new mode 100755 diff --git a/hooks/pgsql-db-relation-broken b/hooks/pgsql-db-relation-broken old mode 100644 new mode 100755 diff --git a/hooks/pgsql-db-relation-changed b/hooks/pgsql-db-relation-changed old mode 100644 new mode 100755 index 2ddcf4758026245303b0fa4d18e49bfdcab0e930..0ba3aaa2ce8c827c7cd2f6e3cb467b7c49b5f7e6 --- a/hooks/pgsql-db-relation-changed +++ b/hooks/pgsql-db-relation-changed @@ -66,7 +66,7 @@ else #Execute CLI Moodle installer juju-log "Database population" - /usr/bin/php $WWWROOT/admin/cli/install.php --lang=it --wwwroot=$HTTP_PROT://$DNS_NAME --dataroot=$DATADIR --dbtype=pgsql --dbhost=$db_host --dbname=$db_db --dbuser=$db_user --dbpass=$db_pass --prefix=mdl --fullname="$FULLNAME" --shortname="$SHORTNAME" --adminuser=$MDL_ADMIN --adminpass=$MDL_ADMINPASS --chmod=2770 --non-interactive --agree-license + /usr/bin/php $WWWROOT/admin/cli/install.php --lang=en --wwwroot=$HTTP_PROT://$DNS_NAME --dataroot=$DATADIR --dbtype=pgsql --dbhost=$db_host --dbname=$db_db --dbuser=$db_user --dbpass=$db_pass --prefix=mdl --fullname="$FULLNAME" --shortname="$SHORTNAME" --adminuser=$MDL_ADMIN --adminpass=$MDL_ADMINPASS --chmod=2770 --non-interactive --agree-license #Remove install dir for security rm -r $WWWROOT/install diff --git a/hooks/pgsql-db-relation-departed b/hooks/pgsql-db-relation-departed old mode 100644 new mode 100755 diff --git a/metadata.yaml b/metadata.yaml index 014d19a0a88de5b6ba586d38a307114199a0e1d9..1e301227a7cb1769faa5c982ee1c1a9285878c7e 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,6 +1,6 @@ name: moodle summary: Moodle is a free open-source LMF for e-Learning. -maintainer: Gianni Marzulli <gianni.marzulli@garr.it> +maintainer: GARR Cloud <cloud-support@garr.it> description: | Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments. This charm deploys Moodle as outlined by the Moodle Installation Guide. diff --git a/revision b/revision index ec635144f60048986bc560c5576355344005e6e7..7813681f5b41c028345ca62a2be376bae70b7f61 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -9 +5 \ No newline at end of file