From f76e4bce2fc5409df9134e5a0cfbc9b48c1f8c5f Mon Sep 17 00:00:00 2001 From: "pvr.mza" Date: Sat, 25 Jul 2020 10:10:53 -0300 Subject: [PATCH 1/5] Added Branch 3.7 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index af6b012..5134415 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install mysql-client pwgen python-setuptools curl git unzip apache2 php php-gd libapache2-mod-php postfix wget supervisor php-pgsql curl libcurl4 libcurl3-dev php-curl php-xmlrpc php-intl php-mysql git-core php-xml php-mbstring php-zip php-soap cron php-ldap vim locales # -RUN cd /tmp && git clone -b MOODLE_39_STABLE git://git.moodle.org/moodle.git --depth=1 && \ +RUN cd /tmp && git clone -b MOODLE_37_STABLE git://git.moodle.org/moodle.git --depth=1 && \ mv /tmp/moodle/* /var/www/html/ && rm -rf /var/www/html/index.html && \ chown -R www-data:www-data /var/www/html From 7e80241561c1280a534e19f77faac704938c89bc Mon Sep 17 00:00:00 2001 From: "pvr.mza" Date: Sun, 26 Jul 2020 00:46:21 -0300 Subject: [PATCH 2/5] added more functionalities v3.7 --- .gitignore | 5 ++- Dockerfile | 6 ++- README.md | 32 +++++++++++++--- env_moodle_example | 35 ++++++++++++------ files/apache-moodle.conf | 4 +- files/foreground.sh | 65 ++++++++++++++++++++++++-------- lang_support.md | 80 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 191 insertions(+), 36 deletions(-) create mode 100644 lang_support.md diff --git a/.gitignore b/.gitignore index 763b166..54eebb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ # dotenv environment variables file -construye.sh .env* *.env +# dev tools +construye.sh +docker-compose-dev.yml + # Temporary folders tmp/ temp/ diff --git a/Dockerfile b/Dockerfile index 5134415..11f8776 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install mysql-client pwgen python-setuptools curl git unzip apache2 php php-gd libapache2-mod-php postfix wget supervisor php-pgsql curl libcurl4 libcurl3-dev php-curl php-xmlrpc php-intl php-mysql git-core php-xml php-mbstring php-zip php-soap cron php-ldap vim locales # + RUN cd /tmp && git clone -b MOODLE_37_STABLE git://git.moodle.org/moodle.git --depth=1 && \ mv /tmp/moodle/* /var/www/html/ && rm -rf /var/www/html/index.html && \ chown -R www-data:www-data /var/www/html @@ -22,7 +23,7 @@ COPY files/moodlecron /etc/cron.d/moodlecron # RUN chmod 0644 /etc/cron.d/moodlecron ; \ - chmod +x /etc/foreground.sh ; \ + chmod +x /etc/foreground.sh ; \ cd /var/log/apache2/ ; for i in *log; do rm $i; ln -s /dev/stdout $i;done ; \ a2enconf apache-moodle ; \ echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf @@ -34,4 +35,7 @@ RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/list VOLUME ["/var/moodledata","/var/www/html/theme","/var/www/html/mod"] EXPOSE 80 443 +ENV MOODLE_VER=3.7 + ENTRYPOINT ["/etc/foreground.sh"] + diff --git a/README.md b/README.md index 2ef5cb3..3714c9c 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,18 @@ Moodle is a very popular open source learning management solution (LMS) for the Site: https://moodle.org/ +## Version/TAG: +* 3.7 (3.7_STABLE 3.7.7+ build 20200716) +* 3.8 (3.8_STABLE 3.8.4+ build 20200723) +* 3.9 (3.9_STABLE 3.9.1+ build 20200723) + + ## Features -* All configurations can be added from environment variables -* Moodle security recommendations for apache and php -* Check/move admin directory -* Version: 3.7 (STABLE) / 3.8 (STABLE) / 3.9 (STABLE) +- [x] All configurations can be added from environment variables to config.php +- [x] Moodle security recommendations for apache and php +- [x] Check/move admin directory +- [x] Timezone and Language setting from enviroment +- [x] Proxy support and URL setting from enviroment ### Config values All environment variables starting MOODLE_ will be transformed to $CFG and added automatically to the config.php file. Double _ separates array. Example: @@ -25,6 +32,20 @@ All environment variables starting MOODLE_ will be transformed to $CFG and added ### Check/move admin directory If you define MOODLE_admin ($CFG->admin) rename admin directory to MOODLE_admin +In certain circumstances you will want to move the management directory (/admin) to another location (for security or compatibility reasons) +For this you only have to define the environment variable MOODLE_admin with the name with which you want it to be renaming the directory "admin" + +### URL +The VIRTUAL_HOST and VIRTUAL_PORT variables are used with double functionality. + +On the one hand they can be used for the docker with reverse proxy, but they are also used to generate the variable MOODLE_wwwroot ($CFG->wwwroot) together with the environment variable VIRTUAL_URL + +MOODLE_wwwroot = $proto://$VIRTUAL_HOST:$VIRTUAL_PORT$VIRTUAL_URL + +If the variable MOODLE_sslproxy is defined, $proto is https, else http +In this way, you can use VIRTUAL_URL to publish moodle in any URL, something very useful when you are behind a reverse proxy + + ## Deploy ### Docker Composer @@ -33,7 +54,7 @@ If you define MOODLE_admin ($CFG->admin) rename admin directory to MOODLE_admin $ git clone https://github.com/pvrmza/docker-moodle.git $ cd docker-moodle $ cp env_mysql_example .env_mysql - $ cp env_moodle_example .env_observium + $ cp env_moodle_example .env_moodle $ docker-compose up ``` @@ -44,3 +65,4 @@ If you define MOODLE_admin ($CFG->admin) rename admin directory to MOODLE_admin # Ports 80 + diff --git a/env_moodle_example b/env_moodle_example index eda08f8..835b5c8 100644 --- a/env_moodle_example +++ b/env_moodle_example @@ -1,31 +1,44 @@ + +# date time & languages TZ=America/Argentina/Mendoza -VIRTUAL_HOST=moodle.local -VIRTUAL_PORT=80 +MOODLE_lang=es -MOODLE_wwwroot=http://localhost:8011 +#### nging proxy reverse and SSL +VIRTUAL_HOST=localhost +VIRTUAL_PORT=8011 +VIRTUAL_URL=/moodle -MOODLE_dbtype=mysqli -MOODLE_dblibrary=native +# If the docker is behind a reverse proxy +# MOODLE_reverseproxy=true +# If the reverse proxy is SSL +# MOODLE_sslproxy=true + +# This is generated when starting the container with the previous variables +# MOODLE_wwwroot=http://$VIRTUAL_HOST:$VIRTUAL_PORT$VIRTUAL_URL + + +# DB Connect +MOODLE_dbtype=mysqli MOODLE_dbhost=db MOODLE_dbname=moodle MOODLE_dbuser=moodle MOODLE_dbpass=moodlepwd@ -MOODLE_prefix=mdl_ +# DB Options +MOODLE_prefix=mdl_ +MOODLE_dblibrary=native MOODLE_dboptions__dbpersist=false MOODLE_dboptions__dbsocket=false MOODLE_dboptions__dbport=3306 MOODLE_dboptions__dbhandlesoptions=false MOODLE_dboptions__dbcollation=utf8mb4_unicode_ci - +# Directory and permission MOODLE_dataroot=/var/moodledata MOODLE_directorypermissions=02777 MOODLE_admin=admin -MOODLE_lang=es - -#MOODLE_reverseproxy=true -#MOODLE_sslproxy=true +# log username in access_log MOODLE_apacheloguser=2 + diff --git a/files/apache-moodle.conf b/files/apache-moodle.conf index 64d7196..a8bbdc3 100644 --- a/files/apache-moodle.conf +++ b/files/apache-moodle.conf @@ -1,5 +1,3 @@ -Alias /moodle /var/www/html - ServerSignature Off ServerTokens Prod TraceEnable off @@ -9,4 +7,4 @@ TraceEnable off Options -Indexes -FollowSymLinks AllowOverride None Require all granted - \ No newline at end of file + diff --git a/files/foreground.sh b/files/foreground.sh index 121965d..cd81fa8 100644 --- a/files/foreground.sh +++ b/files/foreground.sh @@ -10,28 +10,47 @@ touch /etc/crontab /etc/cron.d/php /etc/cron.d/moodlecron ####### # timezone -echo $TZ > /etc/timezone && rm /etc/localtime && \ -ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ -dpkg-reconfigure -f noninteractive tzdata +if test -v TZ; then + echo $TZ > /etc/timezone + rm /etc/localtime && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata + echo "date.timezone=$TZ" > /etc/php/7.2/apache2/conf.d/99_datatime.ini +fi ####### -# permission check -echo "placeholder" > /var/moodledata/placeholder -chown -R www-data:www-data /var/moodledata -find /var/moodledata -type d -exec chmod 700 {} \; -find /var/moodledata -type f -exec chmod 600 {} \; +# LANG +if test -v MOODLE_lang; then + if ! test -d /var/www/html/lang/$MOODLE_lang; then + mkdir -p cd $MOODLE_dataroot/lang && cd $MOODLE_dataroot/lang/ + wget https://download.moodle.org/download.php/direct/langpack/$MOODLE_VER/$MOODLE_lang.zip -q -O /tmp/temp.zip && unzip /tmp/temp.zip && rm -rf /tmp/temp.zip + apt-get update && apt-get -y install language-pack-$MOODLE_lang && dpkg-reconfigure locales + fi +fi + +####### +# Building URL +if test -v VIRTUAL_URL; then + # Apache conf + echo -e "\nAlias $VIRTUAL_URL /var/www/html \n" >> /etc/apache2/conf-available/apache-moodle.conf +fi + +if test -v MOODLE_sslproxy; then + proto=https + export MOODLE_reverseproxy=true +else + proto=http +fi + +export MOODLE_wwwroot=$proto://$VIRTUAL_HOST:$VIRTUAL_PORT$VIRTUAL_URL -chown -R root:www-data /var/www/html -find /var/www/html -type d -exec chmod 750 {} \; -find /var/www/html -type f -exec chmod 640 {} \; ####### # check/move admin dir if test -v MOODLE_admin; then - mv /var/www/html/admin /var/www/html/$MOODLE_admin + admin_dir=$(find /var/www/html/ -iname admin_settings_search_form.php | xargs dirname) + mv $admin_dir /var/www/html/$MOODLE_admin 2>/dev/null fi - ####### # ENVIRONMENT to CONFIG rm -rf /var/www/html/config.php @@ -42,7 +61,7 @@ global \$CFG; " > /var/www/html/config.php while IFS= read -r line -do +do key=`echo $line | cut -d = -f 1 |sed "s/MOODLE_//g"` if test $(echo $key | egrep __) ; then var=`echo $key | sed "s/__/['/g" | sed "s/$/']/g" ` @@ -50,7 +69,7 @@ do var=$key fi - value=`echo $line | cut -d = -f 2- ` + value=`echo $line | cut -d = -f 2- |sed 's/\"//g'` case $value in [0-9]*) echo "\$CFG->$var=$value;" ;; true|false) echo "\$CFG->$var=$value;" ;; @@ -58,14 +77,30 @@ do esac done < <(printenv | egrep ^MOODLE_ | sort -u) >> /var/www/html/config.php + echo " require_once(dirname(__FILE__) . '/lib/setup.php'); ?>" >> /var/www/html/config.php +####### +# permission check +echo "Check permission in $MOODLE_dataroot... " +echo "placeholder" > $MOODLE_dataroot/placeholder +chown -R www-data:www-data $MOODLE_dataroot +find $MOODLE_dataroot -type d -exec chmod 700 {} \; +find $MOODLE_dataroot -type f -exec chmod 600 {} \; + +echo "Check permission in www-root... " +chown -R root:www-data /var/www/html +find /var/www/html -type d -exec chmod 750 {} \; +find /var/www/html -type f -exec chmod 640 {} \; + + # start up cron /usr/sbin/cron # start up apache source /etc/apache2/envvars exec apache2 -D FOREGROUND + diff --git a/lang_support.md b/lang_support.md new file mode 100644 index 0000000..0bb08f1 --- /dev/null +++ b/lang_support.md @@ -0,0 +1,80 @@ +# List of supported languages +af - translation updates for language Afrikaans +am - translation updates for language Amharic +an - translation updates for language Aragonese +ar - translation updates for language Arabic +as - translation updates for language Assamese +az - translation updates for language Azerbaijani +be - translation updates for language Belarusian +bg - translation updates for language Bulgarian +bn - translation updates for language Bengali +br - translation updates for language Breton +bs - translation updates for language Bosnian +ca - translation updates for language Catalan; Valencian +cs - translation updates for language Czech +cy - translation updates for language Welsh +da - translation updates for language Danish +de - translation updates for language German +dz - translation updates for language Dzongkha +el - translation updates for language Greek, Modern (1453-) +en - translation updates for language English +eo - translation updates for language Esperanto +es - translation updates for language Spanish; Castilian +et - translation updates for language Estonian +eu - translation updates for language Basque +fa - translation updates for language Persian +fi - translation updates for language Finnish +fr - translation updates for language French +ga - translation updates for language Irish +gd - translation updates for language Gaelic; Scottish Gaelic +gl - translation updates for language Galician +gu - translation updates for language Gujarati +he - translation updates for language Hebrew +hi - translation updates for language Hindi +hr - translation updates for language Croatian +hu - translation updates for language Hungarian +ia - translation updates for language Interlingua (International Auxiliary Language Association) +id - translation updates for language Indonesian +is - translation updates for language Icelandic +it - translation updates for language Italian +ja - translation updates for language Japanese +ka - translation updates for language Georgian +kk - translation updates for language Kazakh +km - translation updates for language Central Khmer +kn - translation updates for language Kannada +ko - translation updates for language Korean +ku - translation updates for language Kurdish +lt - translation updates for language Lithuanian +lv - translation updates for language Latvian +mk - translation updates for language Macedonian +ml - translation updates for language Malayalam +mr - translation updates for language Marathi +ms - translation updates for language Malay +my - translation updates for language Burmese +nb - translation updates for language Bokm?l, Norwegian; Norwegian Bokm?l +ne - translation updates for language Nepali +nl - translation updates for language Dutch; Flemish +nn - translation updates for language Norwegian Nynorsk; Nynorsk, Norwegian +oc - translation updates for language Occitan (post 1500); Proven?al +or - translation updates for language Oriya +pa - translation updates for language Panjabi; Punjabi +pl - translation updates for language Polish +pt - translation updates for language Portuguese +ro - translation updates for language Romanian; Moldavian; Moldovan +ru - translation updates for language Russian +si - translation updates for language Sinhala; Sinhalese +sk - translation updates for language Slovak +sl - translation updates for language Slovenian +sq - translation updates for language Albanian +sr - translation updates for language Serbian +sv - translation updates for language Swedish +ta - translation updates for language Tamil +te - translation updates for language Telugu +tg - translation updates for language Tajik +th - translation updates for language Thai +tr - translation updates for language Turkish +ug - translation updates for language Uighur; Uyghur +uk - translation updates for language Ukrainian +vi - translation updates for language Vietnamese +xh - translation updates for language Xhosa + From 1f8ff21ca087b67f5fb2439f60ac4b1c3542fbc3 Mon Sep 17 00:00:00 2001 From: pvrmza Date: Tue, 22 Sep 2020 10:44:25 -0300 Subject: [PATCH 3/5] Update build 20200922 --- Dockerfile | 13 +++++++------ README.md | 9 ++++----- files/foreground.sh | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11f8776..4ab2acf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,22 +10,24 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install mysql-client # -RUN cd /tmp && git clone -b MOODLE_37_STABLE git://git.moodle.org/moodle.git --depth=1 && \ +RUN cd /tmp && git clone -b MOODLE_39_STABLE git://git.moodle.org/moodle.git --depth=1 && \ mv /tmp/moodle/* /var/www/html/ && rm -rf /var/www/html/index.html && \ - chown -R www-data:www-data /var/www/html + chown -R root:www-data /var/www/html && \ + find /var/www/html -type d -exec chmod 750 {} \; && \ + find /var/www/html -type f -exec chmod 640 {} \; + # COPY files/foreground.sh /etc/foreground.sh # COPY files/moodle-php.ini /etc/php/7.2/apache2/conf.d/moodle-php.ini -COPY files/apache-moodle.conf /etc/apache2/conf-available/apache-moodle.conf +COPY files/apache-moodle.conf /etc/apache2/conf-enabled/apache-moodle.conf COPY files/moodlecron /etc/cron.d/moodlecron # RUN chmod 0644 /etc/cron.d/moodlecron ; \ chmod +x /etc/foreground.sh ; \ cd /var/log/apache2/ ; for i in *log; do rm $i; ln -s /dev/stdout $i;done ; \ - a2enconf apache-moodle ; \ echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf # Cleanup, this is ran to reduce the resulting size of the image. @@ -35,7 +37,6 @@ RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/list VOLUME ["/var/moodledata","/var/www/html/theme","/var/www/html/mod"] EXPOSE 80 443 -ENV MOODLE_VER=3.7 +ENV MOODLE_VER=3.9 ENTRYPOINT ["/etc/foreground.sh"] - diff --git a/README.md b/README.md index 3714c9c..e1482d2 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Moodle is a very popular open source learning management solution (LMS) for the Site: https://moodle.org/ ## Version/TAG: -* 3.7 (3.7_STABLE 3.7.7+ build 20200716) -* 3.8 (3.8_STABLE 3.8.4+ build 20200723) -* 3.9 (3.9_STABLE 3.9.1+ build 20200723) +* 3.7 (3.7_STABLE 3.7.8 build 20200922) +* 3.8 (3.8_STABLE 3.8.5+ build 20200922) +* 3.9 (3.9_STABLE 3.9.2+ build 20200922) ## Features @@ -55,7 +55,7 @@ In this way, you can use VIRTUAL_URL to publish moodle in any URL, something ver $ cd docker-moodle $ cp env_mysql_example .env_mysql $ cp env_moodle_example .env_moodle - $ docker-compose up + $ docker-compose up -d ``` # Volumen @@ -65,4 +65,3 @@ In this way, you can use VIRTUAL_URL to publish moodle in any URL, something ver # Ports 80 - diff --git a/files/foreground.sh b/files/foreground.sh index cd81fa8..d72f1c0 100644 --- a/files/foreground.sh +++ b/files/foreground.sh @@ -10,13 +10,14 @@ touch /etc/crontab /etc/cron.d/php /etc/cron.d/moodlecron ####### # timezone -if test -v TZ; then +if [ -f /usr/share/zoneinfo/$TZ ]; then echo $TZ > /etc/timezone rm /etc/localtime && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata echo "date.timezone=$TZ" > /etc/php/7.2/apache2/conf.d/99_datatime.ini fi + ####### # LANG if test -v MOODLE_lang; then @@ -31,7 +32,7 @@ fi # Building URL if test -v VIRTUAL_URL; then # Apache conf - echo -e "\nAlias $VIRTUAL_URL /var/www/html \n" >> /etc/apache2/conf-available/apache-moodle.conf + echo -e "\nAlias $VIRTUAL_URL /var/www/html \n" > /etc/apache2/conf-enabled/apache-moodle-url.conf fi if test -v MOODLE_sslproxy; then @@ -103,4 +104,3 @@ find /var/www/html -type f -exec chmod 640 {} \; # start up apache source /etc/apache2/envvars exec apache2 -D FOREGROUND - From 397890ed270cf3b6ec3d18599e7d411d053cf2a8 Mon Sep 17 00:00:00 2001 From: pvrmza Date: Fri, 2 Oct 2020 14:52:31 -0300 Subject: [PATCH 4/5] eliminado chequeos inecesarios si es un reinicio del contenedor --- Dockerfile | 4 ++-- README.md | 6 +++--- docker-compose.yml | 3 +-- files/foreground.sh | 42 +++++++++++++++++++++++------------------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ab2acf..c743b02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install mysql-client # -RUN cd /tmp && git clone -b MOODLE_39_STABLE git://git.moodle.org/moodle.git --depth=1 && \ +RUN cd /tmp && git clone -b MOODLE_37_STABLE git://git.moodle.org/moodle.git --depth=1 && \ mv /tmp/moodle/* /var/www/html/ && rm -rf /var/www/html/index.html && \ chown -R root:www-data /var/www/html && \ find /var/www/html -type d -exec chmod 750 {} \; && \ @@ -37,6 +37,6 @@ RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/list VOLUME ["/var/moodledata","/var/www/html/theme","/var/www/html/mod"] EXPOSE 80 443 -ENV MOODLE_VER=3.9 +ENV MOODLE_VER=3.7 ENTRYPOINT ["/etc/foreground.sh"] diff --git a/README.md b/README.md index e1482d2..4e281f0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Moodle is a very popular open source learning management solution (LMS) for the Site: https://moodle.org/ ## Version/TAG: -* 3.7 (3.7_STABLE 3.7.8 build 20200922) -* 3.8 (3.8_STABLE 3.8.5+ build 20200922) -* 3.9 (3.9_STABLE 3.9.2+ build 20200922) +* 3.7 (3.7_STABLE 3.7.8 build 20201002) +* 3.8 (3.8_STABLE 3.8.5+ build 20201002) +* 3.9 (3.9_STABLE 3.9.2+ build 20201002) ## Features diff --git a/docker-compose.yml b/docker-compose.yml index fff3749..23a2a31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,8 +17,7 @@ services: - db links: - db:db - #image: docker-moodle:200711-1840 - image: pvrmza/docker-moodle + image: pvrmza/docker-moodle:3.9 restart: always env_file: - .env_moodle diff --git a/files/foreground.sh b/files/foreground.sh index d72f1c0..f3206bd 100644 --- a/files/foreground.sh +++ b/files/foreground.sh @@ -10,21 +10,28 @@ touch /etc/crontab /etc/cron.d/php /etc/cron.d/moodlecron ####### # timezone -if [ -f /usr/share/zoneinfo/$TZ ]; then - echo $TZ > /etc/timezone - rm /etc/localtime && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata - - echo "date.timezone=$TZ" > /etc/php/7.2/apache2/conf.d/99_datatime.ini +if test -v TZ && [ `readlink /etc/localtime` != "/usr/share/zoneinfo/$TZ" ]; then + if [ -f /usr/share/zoneinfo/$TZ ]; then + echo $TZ > /etc/timezone + rm /etc/localtime + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime + dpkg-reconfigure -f noninteractive tzdata + + echo "date.timezone=$TZ" > /etc/php/7.2/apache2/conf.d/99_datatime.ini + fi fi - ####### # LANG if test -v MOODLE_lang; then - if ! test -d /var/www/html/lang/$MOODLE_lang; then - mkdir -p cd $MOODLE_dataroot/lang && cd $MOODLE_dataroot/lang/ - wget https://download.moodle.org/download.php/direct/langpack/$MOODLE_VER/$MOODLE_lang.zip -q -O /tmp/temp.zip && unzip /tmp/temp.zip && rm -rf /tmp/temp.zip - apt-get update && apt-get -y install language-pack-$MOODLE_lang && dpkg-reconfigure locales + if ! test -d /var/www/html/lang/$MOODLE_lang && ! test -d $MOODLE_dataroot/lang/$MOODLE_lang; then + mkdir -p $MOODLE_dataroot/lang && cd $MOODLE_dataroot/lang/ + wget https://download.moodle.org/download.php/direct/langpack/$MOODLE_VER/$MOODLE_lang.zip -q -O /tmp/temp.zip && unzip /tmp/temp.zip && rm -rf /tmp/temp.zip + fi + # check lang package + if [ `dpkg-query -l language-pack-$MOODLE_lang 2>/dev/null | egrep ^ii >/dev/null; echo $?` -eq 1 ]; then + apt-get update + apt-get -y install language-pack-$MOODLE_lang + dpkg-reconfigure locales fi fi @@ -37,12 +44,15 @@ fi if test -v MOODLE_sslproxy; then proto=https + export VIRTUAL_PORT=443 export MOODLE_reverseproxy=true else proto=http fi -export MOODLE_wwwroot=$proto://$VIRTUAL_HOST:$VIRTUAL_PORT$VIRTUAL_URL +if ! test -v MOODLE_wwwroot; then + export MOODLE_wwwroot=$proto://$VIRTUAL_HOST:$VIRTUAL_PORT$VIRTUAL_URL +fi ####### @@ -86,18 +96,12 @@ require_once(dirname(__FILE__) . '/lib/setup.php'); ####### # permission check -echo "Check permission in $MOODLE_dataroot... " +echo "Check permissions in $MOODLE_dataroot... " echo "placeholder" > $MOODLE_dataroot/placeholder chown -R www-data:www-data $MOODLE_dataroot find $MOODLE_dataroot -type d -exec chmod 700 {} \; find $MOODLE_dataroot -type f -exec chmod 600 {} \; -echo "Check permission in www-root... " -chown -R root:www-data /var/www/html -find /var/www/html -type d -exec chmod 750 {} \; -find /var/www/html -type f -exec chmod 640 {} \; - - # start up cron /usr/sbin/cron From 7f9ee10fface9b103bd095c6d0eed68b55b09132 Mon Sep 17 00:00:00 2001 From: Pablo Vargas Date: Wed, 16 Feb 2022 23:34:32 -0300 Subject: [PATCH 5/5] Actualizado README.md para disparar docker build v3.7.9 --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e281f0..0796177 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,9 @@ Moodle is a very popular open source learning management solution (LMS) for the Site: https://moodle.org/ ## Version/TAG: -* 3.7 (3.7_STABLE 3.7.8 build 20201002) -* 3.8 (3.8_STABLE 3.8.5+ build 20201002) -* 3.9 (3.9_STABLE 3.9.2+ build 20201002) - +* 3.7 (3.7_STABLE 3.7.9 build 20220216) +* 3.8 (3.8_STABLE 3.8.9 build 20220216) +* 3.9 (3.9_STABLE 3.9.12 build 20220216) ## Features - [x] All configurations can be added from environment variables to config.php