Skip to content

Commit

Permalink
Merge pull request #14 from ubc/moodlecpd-4.1LTS
Browse files Browse the repository at this point in the history
Request merging Moodlecpd 4.1 LTS to Medicine branch
  • Loading branch information
Lannro authored Sep 4, 2024
2 parents e45812d + 1a394c3 commit 16408c2
Show file tree
Hide file tree
Showing 141 changed files with 6,323 additions and 39 deletions.
147 changes: 108 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,142 +1,198 @@
FROM lthub/moodle:3.9.25
FROM lthub/moodle:4.1.13
MAINTAINER Tyler Cinkant <tyler.cinkant@ubc.ca>

RUN curl -L https://moodle.org/plugins/download.php/22949/mod_questionnaire_moodle310_2020062302.zip -o /questionnaire.zip \
##6May2024: production release
##Version 4.1.9
##FROM dangtue2020/moodlecore:419stg2-41ec0380b10f

##Version 4.1.10
##FROM dangtue2020/moodlecore:4110-2d9b62e726d4


#Updated to newer questionnaire 10Dec2023
RUN curl -L https://moodle.org/plugins/download.php/29228/mod_questionnaire_moodle42_2022092202.zip -o /questionnaire.zip \
&& cp /questionnaire.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip questionnaire.zip \
&& rm questionnaire.zip \
&& rm questionnaire.zip \

#This is the latest version of choicegroup plugin 18Jun2024
#REMOVED no confirmation from Kate for production 30July2024
#&& curl -L https://moodle.org/plugins/download.php/30464/mod_choicegroup_moodle43_2023110900.zip -o /choicegroup.zip \
#&& cp /choicegroup.zip /var/www/html/mod/ \
#&& cd /var/www/html/mod \
#&& unzip choicegroup.zip \
#&& rm choicegroup.zip \

#This is the latest version of plugin moodle33 as of 20Dec2022 and 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/11565/mod_certificate_moodle33_2016052300.zip -o /certificate.zip \
&& cp /certificate.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip certificate.zip \
&& rm certificate.zip \

&& curl -L https://moodle.org/plugins/download.php/29419/mod_hvp_moodle42_2023061200.zip -o /hvp.zip \
#Updated to newer hvp 10Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/30739/mod_hvp_moodle43_2023122500.zip -o /hvp.zip \
&& cp /hvp.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip hvp.zip \
&& rm hvp.zip \
&& rm hvp.zip \

#This is the latest version: And pending on Kate verification with her team.
#This is the latest version of plugin moodle33 as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/16906/block_poll_moodle37_2018052500.zip -o /poll.zip \
&& cp /poll.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip poll.zip \
&& rm poll.zip \

&& curl -L https://moodle.org/plugins/download.php/24644/report_customsql_moodle311_2021070700.zip -o /customsql.zip \
#This is the latest version of plugin moodle31 as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/26177/report_customsql_moodle40_2022031800.zip -o /customsql.zip \
&& cp /customsql.zip /var/www/html/report/ \
&& cd /var/www/html/report \
&& unzip customsql.zip \
&& rm customsql.zip \
&& rm customsql.zip \

&& curl -L https://moodle.org/plugins/download.php/24594/format_grid_moodle39_2020070705.zip -o /grid.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31635/format_grid_moodle41_2022112609.zip -o /grid.zip \
&& cp /grid.zip /var/www/html/course/format/ \
&& cd /var/www/html/course/format \
&& unzip grid.zip \
&& rm grid.zip \

&& curl -L https://moodle.org/plugins/download.php/21512/format_flexsections_moodle38_2020051100.zip -o /flex.zip \

#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/30735/format_flexsections_moodle43_2023122300.zip -o /flex.zip \
&& cp /flex.zip /var/www/html/course/format/ \
&& cd /var/www/html/course/format \
&& unzip flex.zip \
&& rm flex.zip \

&& curl -L https://moodle.org/plugins/download.php/23458/mod_facetoface_moodle39_2020080400.zip -o /facetoface.zip \
&& cp /facetoface.zip /var/www/html/mod/ \
&& cd /var/www/html/mod \
&& unzip facetoface.zip \
&& rm facetoface.zip \

&& curl -L https://moodle.org/plugins/download.php/14468/local_mass_enroll_moodle33_2015092402.zip -o /mass.zip \
&& rm flex.zip \

# Kate requested to remove:
# && curl -L https://moodle.org/plugins/download.php/25559/mod_facetoface_moodle311_2021113000.zip -o /facetoface.zip \
# && cp /facetoface.zip /var/www/html/mod/ \
# && cd /var/www/html/mod \
# && unzip facetoface.zip \
# && rm facetoface.zip \
#

#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30331/local_mass_enroll_moodle43_2023102300.zip -o /mass.zip \
&& cp /mass.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip mass.zip \
&& rm mass.zip \

&& curl -L https://moodle.org/plugins/download.php/21761/block_course_modulenavigation_moodle39_2020061615.zip -o /modulenav.zip \
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30267/block_course_modulenavigation_moodle43_2023101700.zip -o /modulenav.zip \
&& cp /modulenav.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip modulenav.zip \
&& rm modulenav.zip \
&& rm modulenav.zip \

#This is the latest version of this plugin for moodle310 as of 11Jan2023 and 11Dec2023:
&& curl -L https://moodle.org/plugins/download.php/22758/block_configurable_reports_moodle310_2020110300.zip -o /configurable.zip \
&& cp /configurable.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip configurable.zip \
&& rm configurable.zip \

&& curl -L https://moodle.org/plugins/download.php/22161/local_boostnavigation_moodle38_2020080400.zip -o /boostnavig.zip \
#No change as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/27010/local_boostnavigation_moodle311_2021071501.zip -o /boostnavig.zip \
&& cp /boostnavig.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip boostnavig.zip \
&& rm boostnavig.zip \
&& rm boostnavig.zip \

&& curl -L https://moodle.org/plugins/download.php/20137/tool_mergeusers_moodle37_2019082000.zip -o /mergeuser.zip \
&& curl -L https://moodle.org/plugins/download.php/28943/tool_mergeusers_moodle41_2023040402.zip -o /mergeuser.zip \
&& cp /mergeuser.zip /var/www/html/admin/tool/ \
&& cd /var/www/html/admin/tool \
&& unzip mergeuser.zip \
&& rm mergeuser.zip \
&& rm mergeuser.zip \

&& curl -L https://moodle.org/plugins/download.php/22662/filter_multilang2_moodle310_2020101300.zip -o /multi.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31000/filter_multilang2_moodle43_2024013101.zip -o /multi.zip \
&& cp /multi.zip /var/www/html/filter/ \
&& cd /var/www/html/filter \
&& unzip multi.zip \
&& rm multi.zip \

&& curl -L https://moodle.org/plugins/download.php/24719/availability_language_moodle311_2021071800.zip -o /avail.zip \
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/30198/availability_language_moodle43_2023101400.zip -o /avail.zip \
&& cp /avail.zip /var/www/html/availability/condition/ \
&& cd /var/www/html/availability/condition \
&& unzip avail.zip \
&& rm avail.zip \

&& curl -L https://moodle.org/plugins/download.php/23089/block_panopto_moodle310_2020121100.zip -o /panopto.zip \
#Pending on Kate verification with her team.
#Updated as of 11Dec2023
&& curl -L https://moodle.org/plugins/download.php/29980/block_panopto_moodle42_2023091800.zip -o /panopto.zip \
&& cp /panopto.zip /var/www/html/blocks/ \
&& cd /var/www/html/blocks \
&& unzip panopto.zip \
&& rm panopto.zip \

&& curl -L https://moodle.org/plugins/download.php/21850/local_recompletion_moodle39_2020062500.zip -o /recomplete.zip \
#Updated as of 11Dec2023 and 18Apr2024
&& curl -L https://moodle.org/plugins/download.php/31207/local_recompletion_moodle42_2023112702.zip -o /recomplete.zip \
&& cp /recomplete.zip /var/www/html/local/ \
&& cd /var/www/html/local \
&& unzip recomplete.zip \
&& rm recomplete.zip \

&& curl -L https://github.com/ArloSoftware/moodle-enrol_arlo/archive/refs/tags/v3.11.3.zip -o /enrolarlo.zip \
&& cp /enrolarlo.zip /var/www/html/enrol/ \
&& cd /var/www/html/enrol \
&& rm recomplete.zip

#This is the latest version of this plugin ARLO v4.1.4 - checked again on 23Jan2024 12:38:
#ARLO plugin requires Arlo_connection setting.
# && curl -L https://moodle.org/plugins/download.php/30634/enrol_arlo_moodle42_2023110900.zip -o /enrolarlo.zip \
# && cp /enrolarlo.zip /var/www/html/enrol/ \
# && cd /var/www/html/enrol \
# && unzip enrolarlo.zip \
# && rm enrolarlo.zip

# add arlo version 4.1.4
COPY plugin/enrol_arlo_moodle42_2023110900.zip /var/www/html/enrol/enrolarlo.zip
RUN cd /var/www/html/enrol \
&& unzip enrolarlo.zip \
&& mv moodle-enrol_arlo-3.11.3 arlo \
&& rm enrolarlo.zip
&& rm enrolarlo.zip


# add custom cert
COPY certificate.php /var/www/html/mod/certificate/type/letter_non_embedded/

# add custom moove theme
COPY themes/moove_premium.zip /var/www/html/theme/
RUN cd /var/www/html/theme \
&& unzip moove_premium.zip \
&& rm moove_premium.zip

# add custom theme
COPY themes/maker-v6.1-moodle-3.9.zip /var/www/html/theme/
COPY themes/maker-v10.0-moodle-4.1.zip /var/www/html/theme/
RUN cd /var/www/html/theme \
&& unzip maker-v6.1-moodle-3.9.zip \
&& rm maker-v6.1-moodle-3.9.zip
&& unzip maker-v10.0-moodle-4.1.zip \
&& rm maker-v10.0-moodle-4.1.zip

# add tinymce for panopto
COPY plugin/panoptobutton.zip /var/www/html/lib/editor/tinymce/plugins/

RUN cd /var/www/html/lib/editor/tinymce/plugins/ \
&& unzip panoptobutton.zip \
&& rm panoptobutton.zip

# add new config file for mergeusers plugin
COPY plugin/config.local.php /var/www/html/admin/tool/mergeusers/config/


RUN cd /var/www/html/theme/maker/pix/ \
&& rm favicon.ico

COPY themes/favicon.ico /var/www/html/theme/maker/pix/

# add favicon to moove
COPY themes/favicon.ico /var/www/html/theme/moove/pix/

# add custom font
COPY fonts /var/www/html/theme/maker/fonts

# add custom font to moove
COPY fonts /var/www/html/theme/moove/fonts

RUN chown -R www-data /var/www/html

# install odbc for shib sp
Expand All @@ -154,4 +210,17 @@ COPY moodle-shib.conf /etc/apache2/conf-enabled/
COPY docker-entrypoint.d/* /docker-entrypoint.d/
COPY 000-default.conf /etc/apache2/sites-available/

# add modified files for Language Icon
COPY themes/maker-header.mustache /var/www/html/theme/maker/templates/header.mustache
COPY themes/boost-language_menu.mustache /var/www/html/theme/boost/templates/language_menu.mustache
COPY themes/updated-icon-designs-4.1/mod/ /var/www/html/theme/maker/pix_plugins/mod

COPY themes/updated-icon-designs-4.1/core/f/ /var/www/html/pix/f/

##COPY themes/lib/outputrenderers.php /var/www/html/lib/
RUN sed -i.bak '/public function lang_menu/ i\ public function get_language() {return current_language();}\n' /var/www/html/lib/outputrenderers.php

RUN sleep 3 && echo "\$THEME->removedprimarynavitems = ['courses'];" >> /var/www/html/theme/maker/config.php
##RUN sleep 3 && sed -i "\$a\\n\\n\$THEME->removedprimarynavitems = ['courses'];" /var/www/html/theme/maker/config.php

RUN chmod -R 755 /docker-entrypoint.d/
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,97 @@
## MoodleCPD 4.1LTS


<!--img width="847" alt="MoodleCPD_L2" src="https://github.com/ubc/moodle-docker/assets/86985864/bb61e8a3-866d-4f5e-8a62-1a900e874511"-->

![alt text](image-1.png)

## Build MoodleCPD Image

* Step 1-2: build MoodleCore 4.1-LTS
- Source to build MoodleCore https://github.com/ubc/moodle-docker/tree/moodlecore-4.1LTS


* Step 3: for development

* HOW-TO Build MoodleCPD from MoodleCore 4.1-LTS with Github > Codespace

* - (optional) fork "moodlecpd-4.1LTS" branch
- From "moodlecpd-4.1LTS" branch:
- click on the (green button) "<> CODE"
- select "Codespaces" tab
- click the + to launch Codespaces instance
- This will launch a default Codespaces instance with 2-core 8GB RAM, 32GB (sufficient to build this image)
- The browser navigates to the codespace instance: something like this... [some random name]gp.github.dev
- At bottom, select tab "Terminal" - this is bash shell
- Edit Dockerfile or other
- After completed the change (if any), then do build image

- Execute > docker-compose build
- After build completed, tag the image.

- (optional) docker login -u [your hub.docker.com accout]

- Execute > docker tag [some image ID] [your hub.docker.com accout]/moodlecpd:4.1.6-[some unique id]
- example, docker tag eb73e7a5c010 hubdocker2020/moodlecpd:4.1.6-eb73e7a5c010

- Execute > docker push [your hub.docker.com accout]/moodlecpd:4.1.6-[some unique id]
- example, docker push hubdocker2020/moodlecpd:4.1.6-eb73e7a5c010

- DONE with buidling MoodleCPD 4.1 LTS, this image to your hub.docker.com account.



* Step 4: for deployment to STAGING or PROD

* After completion of Step 3 above:

- commit the change back to main repo branch "moodlecpd-4.1LTS" from the Github > Codespaces instance above.

- this "commit" step will initiate the automatic building of the image to LTHub, making it ready for the next step 5: HELM launch.

- DONE with MoodleCPD 4.1 LTS, the Moodle Core image is on LTHub: https://hub.docker.com/u/lthub



* Step 5: for building MoodleCPD with MoodleCore image from Step 3 OR Step 4 above:


- Update values_stg2.yaml with the following:
- Check value_stg2.yaml about line 16, for repo location and tag
- image:
- repository: lthub/moodlecore
- tag: moodlecore-4.1.6

- value_stg2.yaml about line 102, for database name:
- db:
- type: mysqli
- auth:
- database: mdl_ubccpd_stg2

- value_stg2.yaml about line 254, for NFS moodledata folder location:
- resources:
- nfs:
- server: storageverf.lthub.ubc.ca
- path: "/medicinemoodlestg2"


- Launch HELM:

- helm INSTALL -n default -f ./configuration/moodle/values_stg2.yaml moodle-medicine-stg2 ./charts/moodle/

- OR

- helm UPGRADE -n default -f ./configuration/moodle/values_stg2.yaml moodle-medicine-stg2 ./charts/moodle/

-----------------------

* Optional Moodle CLI commands:

- upgrade command: php ./admin/cli/upgrade.php
- clear cache command: php ./admin/cli/purge_cache.php

-----------------------

## Known Issues

* When using NFS shared volume for `/moodledata`, you may get `session data file is not created by your uid` error. It is due to the NFS mount user id mapping is not consistent with local user id. Use Redis session for workaround.
Expand Down
Binary file added image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugin/enrol_arlo_moodle42_2023110900.zip
Binary file not shown.
44 changes: 44 additions & 0 deletions themes/boost-language_menu.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost/language_menu
Language menu template.
Context variables required for this template:
* title - The title of the menu (displays the text of the currently active language).
* items - Array of data representing the available languages to be displayed in the language menu.
* link - If a link is provided render it.
* title - The title of the language item.
* text - The text displayed for the language item.
* url - The url link to activate the given language.
* isactive - Whether the language is currently active.
Example context (json):
{
"title": "English (en)",
"items": {
"link": {
"title": "English (en)",
"text": "English (en)",
"url": "http://example.com",
"isactive": 0
}
}
}
}}

Loading

0 comments on commit 16408c2

Please sign in to comment.