Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c4e09fa
Mecontract 240 (#2)
Oct 21, 2024
65166a0
MECONTRACT-242 - Add in multiple site script (#4)
Oct 29, 2024
3b316c8
MECONTRACT-242 - Fix typo in list of options. (#7)
Nov 12, 2024
2acd9ba
MECONTRACT-242 - Use the folder name as the project name so it is eas…
nicolas-dalpe Nov 12, 2024
1705157
MECONTRACT-242 - Rename the Moodle instances according to folder's name.
nicolas-dalpe Nov 12, 2024
b294bfb
MECONTRACT-242 - Added info_message() decorator.
nicolas-dalpe Nov 12, 2024
c6a7b34
MECONTRACT-242 - Added error_message() decorator function.
nicolas-dalpe Nov 12, 2024
c959435
MECONTRACT-242 - DRY COMPOSE_PROJECT_NAME.
nicolas-dalpe Nov 13, 2024
b35379b
MECONTRACT-242 - Set unique session cookie name to avoid login issue.
nicolas-dalpe Nov 13, 2024
fa31509
MECONTRACT-242 - Use the error_message decorator to display error mes…
nicolas-dalpe Nov 21, 2024
2a53349
Merge pull request #9 from nicolas-dalpe/mrg_MECONTRACT-242
Nov 26, 2024
acbaee6
MECONTRACT-246 - Update version of mariadb used. (#10)
Nov 27, 2024
f54951a
MECONTRACK-250 - Remove deprecated version element from yml files. (#11)
Dec 6, 2024
ad5eb4c
Merge branch 'main' into K1main
nicolas-dalpe Mar 5, 2025
1b01566
MECONTRACK-245 - Add xDebug to Docker on many instances (#17)
nicolas-dalpe Mar 7, 2025
76c9c16
MECONTRACK-216 - Disable course recycle bin.
nicolas-dalpe Apr 23, 2025
6895116
MECONTRACK-216 - Do not include users in course backup.
nicolas-dalpe Apr 23, 2025
e7fe895
MECONTRACK-216 - Disable automatically check for available updates.
nicolas-dalpe Apr 23, 2025
bc2e74d
MECONTRACK-216 - Force user to login and disable dashboard for guest.
nicolas-dalpe Apr 23, 2025
aa2d62e
MECONTRACK-216 - Set default country, city and timezone.
nicolas-dalpe Apr 23, 2025
110aebd
MECONTRACK-216 - Hide guest login button on login page.
nicolas-dalpe Apr 23, 2025
833ef77
MECONTRACK-216 - Do not notify about new builds.
nicolas-dalpe Apr 23, 2025
25bc5d2
MECONTRACK-216 - Disable analytics and statistics.
nicolas-dalpe Apr 23, 2025
2c541e2
MECONTRACK-216 - Set default Moodle settings during --build process.
nicolas-dalpe May 8, 2025
f7cb7cd
MECONTRACK-216 - Disable course recycle bin during --build process.
nicolas-dalpe May 27, 2025
0969970
MECONTRACK-216 - Disable category recycle bin during --build process.
nicolas-dalpe May 27, 2025
76926c0
MECONTRACK-216 - Disable indexing by search engines during --build pr…
nicolas-dalpe Aug 6, 2025
04373cf
Merge remote-tracking branch 'upstream/main' into mergetest
hafid-feghouli-k1 Oct 3, 2025
a27186e
Removed environment parameters to centralize configuration in k1many.sh.
hafid-feghouli-k1 Oct 7, 2025
758068f
Refactored script to support new Moodle folder architecture and Moodl…
hafid-feghouli-k1 Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/adminer/plugins/001-tables-filter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require_once('plugins/tables-filter.php');

return new AdminerTablesFilter();
4 changes: 4 additions & 0 deletions assets/adminer/plugins/002-readable-dates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require_once('plugins/readable-dates.php');

return new AdminerReadableDates();
4 changes: 4 additions & 0 deletions assets/adminer/plugins/003-table-header-scroll.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require_once('plugins/table-header-scroll.php');

return new AdminerTableHeaderScroll();
4 changes: 4 additions & 0 deletions assets/adminer/plugins/004-pretty-json-column.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require_once('plugins/pretty-json-column.php');
$adminer = new AdminerPlugin([]);
return new AdminerPrettyJsonColumn($adminer);
40 changes: 40 additions & 0 deletions assets/adminer/plugins/pretty-json-column.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/** Pretty print JSON values in edit
*/
class AdminerPrettyJsonColumn {
/** @var AdminerPlugin */
protected $adminer;

public function __construct($adminer) {
$this->adminer = $adminer;
}

private function _testJson($value) {
if ((substr($value, 0, 1) == '{' || substr($value, 0, 1) == '[') && ($json = json_decode($value, true))) {
return $json;
}
return $value;
}

function editInput($table, $field, $attrs, $value) {
$json = $this->_testJson($value);
if ($json !== $value) {
$jsonText = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
return <<<HTML
<textarea $attrs cols="50" rows="20">$jsonText</textarea>
HTML;
}
return '';
}

function processInput($field, $value, $function = '') {
if ($function === '') {
$json = $this->_testJson($value);
if ($json !== $value) {
$value = json_encode($json);
}
}
return $this->adminer->_callParent('processInput', array($field, $value, $function));
}
}
49 changes: 49 additions & 0 deletions assets/adminer/plugins/readable-dates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/** This plugin replaces UNIX timestamps with human-readable dates in your local format.
* Mouse click on the date field reveals timestamp back.
*
* @link https://www.adminer.org/plugins/#use
* @author Anonymous
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerReadableDates {
/** @access protected */
var $prepend;

function __construct() {
$this->prepend = <<<EOT

document.addEventListener('DOMContentLoaded', function(event) {
var date = new Date();
var tds = document.querySelectorAll('td[id^="val"]');
for (var i = 0; i < tds.length; i++) {
var text = tds[i].innerHTML.trim();
if (text.match(/^\d{10}$/)) {
date.setTime(parseInt(text) * 1000);
tds[i].oldDate = text;

// tds[i].newDate = date.toUTCString().substr(5); // UTC format
tds[i].newDate = date.toLocaleString(); // Local format
// tds[i].newDate = date.toLocaleFormat('%e %b %Y %H:%M:%S'); // Custom format - works in Firefox only

tds[i].newDate = '<span style="color: #009900">' + tds[i].newDate + '</span>';
tds[i].innerHTML = tds[i].newDate;
tds[i].dateIsNew = true;

tds[i].addEventListener('click', function(event) {
this.innerHTML = (this.dateIsNew ? this.oldDate : this.newDate);
this.dateIsNew = !this.dateIsNew;
});
}
}
});

EOT;
}

function head() {
echo script($this->prepend);
}
}
75 changes: 75 additions & 0 deletions assets/adminer/plugins/table-header-scroll.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php
/**
* Adminer Table header scroll plugin.
*
* Copyright (C) 2016 Jonathan Vollebregt <jnvsor@gmail.com>.
*
* LICENSE:
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
class AdminerTableHeaderScroll
{
public function head()
{
?>

<script<?php echo nonce(); ?>>
function tableHeaderPositionUpdate(){
// If your theme has a fixed position header, change these for compatibility
var offset = -1;
var zindex = 10000;

// Find tables in the content
var tables = document.getElementById('content').getElementsByTagName('table');
for (var i = 0; i < tables.length; i++) {
var table = tables[i];

// Find the table header
var tableHeader = table.getElementsByTagName('thead');
if (tableHeader.length) {
tableHeader = tableHeader[0];
} else {
continue;
}

// Calculate the distance from the top and bottom
var tableTop = table.getBoundingClientRect().top - offset;
var tableBottom = table.getBoundingClientRect().bottom - offset - tableHeader.offsetHeight;

// Set the relative position based on the distance
if (tableTop < 0 && tableBottom > 0){
tableHeader.style['z-index'] = zindex;
tableHeader.style.position = 'relative';

if (typeof tableHeader.style.transform === 'undefined') {
tableHeader.style.top = -tableTop + 'px';
} else {
tableHeader.style.transform = 'translateY(' + -tableTop + 'px)';
}
} else {
tableHeader.style.position = 'static';
tableHeader.style.transform = 'none';
}
}
}

if (window.addEventListener) {
window.addEventListener('scroll', tableHeaderPositionUpdate);
}
</script>

<?php
return true;
}
}
13 changes: 13 additions & 0 deletions assets/php/10-docker-php-moodle.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; CONFIGURATION SETTINGS REQUIRED BY MOODLE

; How many GET/POST/COOKIE input variables may be accepted
; See MDL-71390 for more info. This is the recommended / required
; value to support sites having 1000 courses, activities, users....
max_input_vars = 5000

; Increase the maximum filesize to 200M, which is a more realistic figure.
upload_max_filesize = 2G

; Increase the maximum post size to accomodate the increased upload_max_filesize.
; The default value is 6MB more than the default upload_max_filesize.
post_max_size = 2G
9 changes: 9 additions & 0 deletions assets/php/docker-php-ext-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
xdebug.mode = debug
xdebug.client_host = host.docker.internal
xdebug.idekey=VSCODE
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.log=/tmp/xdebug.log
xdebug.log_level=10
xdebug.discover_client_host=1
zend_extension=xdebug
2 changes: 1 addition & 1 deletion db.mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
MOODLE_DOCKER_DBTYPE: mariadb
MOODLE_DOCKER_DBCOLLATION: utf8mb4_bin
db:
image: mariadb:${MOODLE_DOCKER_DB_VERSION:-10.11}
image: mariadb:${MOODLE_DOCKER_DB_VERSION:-10.11.10}
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_bin
Expand Down
Loading