#!/bin/pwsh # Set up Moodle in container $lang = 'ru' $wwwroot = 'http://localhost:90' $dirroot = '/var/www/html' $dataroot = '/var/moodledata' $dbtype = 'pgsql' $dbhost = 'exam-base' $dbname = 'moodle' $dbuser = 'moodle' $dbpass = 'moodle' $dbport = '5432' # $dbsocket = "" $dbprefix = 'mdl_' $adminUser = 'admin' $adminPassword = 'Aa1-2154' $adminemail = 'admin@domain.ru' $sapportemail = 'support@domain.ru' $siteName = 'exam' $siteShort = 'exam' docker exec -it -u www-data moodle /usr/bin/php /var/www/html/admin/cli/install_database.php --agree-license --allow-unstable --non-interactive --lang=$lang --wwwroot=$wwwroot --dirroot=$dirroot --dataroot=$dataroot --dbtype=$dbtype --dbhost=$dbhost --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass --dbport=$dbport --prefix=$dbprefix --adminuser=$adminUser --adminpass=$adminPassword --fullname=$siteName --shortname=$siteShort --adminemail=$adminemail --supportemail=$sapportemail # возможные преднастройки: # --agree-license # --allow-unstable # --skip-database # --non-interactive # --lang=$lang # --wwwroot=$wwwroot # --dataroot=$dataroot # --dbtype=$dbtype # --dbhost=$dbhost # --dbname=$dbname # --dbuser=$dbuser # --dbpass=$dbpass # --dbport=$dbport # --dbsocket=$dbsocket # --prefix=$dbprefix # --adminuser=$adminUser # --adminpass=$adminPassword # --fullname=$siteName # --shortname=$siteShort # --adminemail=$adminemail # --supportemail=$sapportemail # ручной запуск скрипта настройки клиента # /usr/bin/php /var/www/html/install.php --agree-license --allow-unstable --non-interactive --lang=$lang --wwwroot=$wwwroot --dataroot=$dataroot --dbtype=$dbtype --dbhost=$dbhost --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass --dbport=$dbport --prefix=$dbprefix --adminuser=$adminUser --adminpass=$adminPassword --fullname=$siteName --shortname=$siteShort --adminemail=$adminemail --supportemail=$sapportemail # install_database.php при запуске требует config.php, который генерируется при запуске скрипта - install.php # docker exec -it -u www-data moodle /usr/bin/php /var/www/html/admin/cli/install_database.php --agree-license --adminuser=$adminUser --adminpass=$adminPassword --fullname=$siteName --shortname=$siteShort --lang=$lang Write-Host "Admin account: $adminUser/$adminPassword" # Options: # --chmod=OCTAL-MODE Permissions of new directories created within dataroot. # Default is 2777. You may want to change it to 2770 # or 2750 or 750. See chmod man page for details. # --lang=CODE Installation and default site language. # --wwwroot=URL Web address for the Moodle site, # required in non-interactive mode. # --dataroot=DIR Location of the moodle data folder, # must not be web accessible. Default is moodledata # in the parent directory. # --dbtype=TYPE Database type. Default is mysqli # --dbhost=HOST Database host. Default is localhost # --dbname=NAME Database name. Default is moodle # --dbuser=USERNAME Database user. Default is root # --dbpass=PASSWORD Database password. Default is blank # --dbport=NUMBER Use database port. # --dbsocket=PATH Use database socket, 1 means default. Available for some databases only. # --prefix=STRING Table prefix for above database tables. Default is mdl_ # --fullname=STRING The fullname of the site # --shortname=STRING The shortname of the site # --summary=STRING The summary to be displayed on the front page # --adminuser=USERNAME Username for the moodle admin account. Default is admin # --adminpass=PASSWORD Password for the moodle admin account, # required in non-interactive mode. # --adminemail=STRING Email address for the moodle admin account. # --sitepreset=STRING Admin site preset to be applied during the installation process. # --supportemail=STRING Email address for support and help. # --upgradekey=STRING The upgrade key to be set in the config.php, leave empty to not set it. # --non-interactive No interactive questions, installation fails if any # problem encountered. # --agree-license Indicates agreement with software license, # required in non-interactive mode. # --allow-unstable Install even if the version is not marked as stable yet, # required in non-interactive mode. # --skip-database Stop the installation before installing the database. # -h, --help Print out this help