mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
fix errors
This commit is contained in:
commit
ff6b923d32
10 changed files with 256 additions and 238 deletions
10
README.md
10
README.md
|
@ -15,8 +15,8 @@ all manner of organisations and individuals.
|
||||||
** After the installation go to your domain https://domain.tld/moodle and create the admin account. **
|
** After the installation go to your domain https://domain.tld/moodle and create the admin account. **
|
||||||
|
|
||||||
## To-do
|
## To-do
|
||||||
[X]- Install script
|
- [X] Install script
|
||||||
[X]- Remove script
|
- [X] Remove script
|
||||||
[ ]- Upgrade script
|
- [ ] Upgrade script
|
||||||
[ ]- Backup and Restore scripts
|
- [ ] Backup and Restore scripts
|
||||||
[ ]- LDAP integration
|
- [ ] LDAP integration
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://download.moodle.org/download.php/stable34/moodle-latest-34.tgz
|
SOURCE_URL=https://github.com/moodle/moodle/archive/v3.4.0.tar.gz
|
||||||
SOURCE_SUM=977012578597718a79ad62fc390b32bf3c7b7ffce241c22875d2127e4e0a5db7
|
SOURCE_SUM=50913fe0e149adf56cfe34f29aec9e79fef17c3ff00590db4f5a643642fa67c7
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=
|
SOURCE_IN_SUBDIR=
|
||||||
|
|
|
@ -30,19 +30,17 @@
|
||||||
unset($CFG); // Ignore this line
|
unset($CFG); // Ignore this line
|
||||||
global $CFG; // This is necessary here for PHPUnit execution
|
global $CFG; // This is necessary here for PHPUnit execution
|
||||||
$CFG = new stdClass();
|
$CFG = new stdClass();
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 1. DATABASE SETUP
|
// 1. DATABASE SETUP
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// First, you need to configure the database where all Moodle data //
|
// First, you need to configure the database where all Moodle data //
|
||||||
// will be stored. This database must already have been created //
|
// will be stored. This database must already have been created //
|
||||||
// and a username/password created to access it. //
|
// and a username/password created to access it. //
|
||||||
|
|
||||||
$CFG->dbtype = 'pgsql'; // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
|
$CFG->dbtype = 'pgsql'; // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
|
||||||
$CFG->dblibrary = 'native'; // 'native' only at the moment
|
$CFG->dblibrary = 'native'; // 'native' only at the moment
|
||||||
$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP
|
$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP
|
||||||
$CFG->dbname = 'YNH_APP'; // database name, eg moodle
|
$CFG->dbname = 'YNH_DB_USER'; // database name, eg moodle
|
||||||
$CFG->dbuser = 'YNH_DB_USER'; // your database username
|
$CFG->dbuser = 'YNH_APP'; // your database username
|
||||||
$CFG->dbpass = 'YNH_DB_PWD'; // your database password
|
$CFG->dbpass = 'YNH_DB_PWD'; // your database password
|
||||||
$CFG->prefix = 'mdl_'; // prefix to use for all table names
|
$CFG->prefix = 'mdl_'; // prefix to use for all table names
|
||||||
$CFG->dboptions = array(
|
$CFG->dboptions = array(
|
||||||
|
@ -70,9 +68,16 @@ $CFG->dboptions = array(
|
||||||
// can be removed for MySQL (by default it will
|
// can be removed for MySQL (by default it will
|
||||||
// use 'utf8mb4_unicode_ci'. This option should
|
// use 'utf8mb4_unicode_ci'. This option should
|
||||||
// be removed for all other databases.
|
// be removed for all other databases.
|
||||||
|
// 'fetchbuffersize' => 100000, // On PostgreSQL, this option sets a limit
|
||||||
|
// on the number of rows that are fetched into
|
||||||
|
// memory when doing a large recordset query
|
||||||
|
// (e.g. search indexing). Default is 100000.
|
||||||
|
// Uncomment and set to a value to change it,
|
||||||
|
// or zero to turn off the limit. You need to
|
||||||
|
// set to zero if you are using pg_bouncer in
|
||||||
|
// 'transaction' mode (it is fine in 'session'
|
||||||
|
// mode).
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 2. WEB SITE LOCATION
|
// 2. WEB SITE LOCATION
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -83,10 +88,7 @@ $CFG->dboptions = array(
|
||||||
//
|
//
|
||||||
// If you need both intranet and Internet access please read
|
// If you need both intranet and Internet access please read
|
||||||
// http://docs.moodle.org/en/masquerading
|
// http://docs.moodle.org/en/masquerading
|
||||||
|
$CFG->wwwroot = 'https://YNH_DOMAINYNH_WWW_PATH';
|
||||||
$CFG->wwwroot = 'https://' . 'YNH_DOMAIN' . 'YNH_WWW_PATH';
|
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 3. DATA FILES LOCATION
|
// 3. DATA FILES LOCATION
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -99,10 +101,7 @@ $CFG->wwwroot = 'https://' . 'YNH_DOMAIN' . 'YNH_WWW_PATH';
|
||||||
// no permissions at all, but that "others" have full permissions.
|
// no permissions at all, but that "others" have full permissions.
|
||||||
//
|
//
|
||||||
// - On Windows systems you might specify something like 'c:\moodledata'
|
// - On Windows systems you might specify something like 'c:\moodledata'
|
||||||
|
|
||||||
$CFG->dataroot = 'YNH_VAR_ROOT';
|
$CFG->dataroot = 'YNH_VAR_ROOT';
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 4. DATA FILES PERMISSIONS
|
// 4. DATA FILES PERMISSIONS
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -113,10 +112,7 @@ $CFG->dataroot = 'YNH_VAR_ROOT';
|
||||||
// if you are concerned about world-access to the files (you will need
|
// if you are concerned about world-access to the files (you will need
|
||||||
// to make sure the web server process (eg Apache) can access the files.
|
// to make sure the web server process (eg Apache) can access the files.
|
||||||
// NOTE: the prefixed 0 is important, and don't use quotes.
|
// NOTE: the prefixed 0 is important, and don't use quotes.
|
||||||
|
|
||||||
$CFG->directorypermissions = 02777;
|
$CFG->directorypermissions = 02777;
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 5. DIRECTORY LOCATION (most people can just ignore this setting)
|
// 5. DIRECTORY LOCATION (most people can just ignore this setting)
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -127,10 +123,7 @@ $CFG->directorypermissions = 02777;
|
||||||
// new name here. eg "moodleadmin". This should fix all admin links in Moodle.
|
// new name here. eg "moodleadmin". This should fix all admin links in Moodle.
|
||||||
// After any change you need to visit your new admin directory
|
// After any change you need to visit your new admin directory
|
||||||
// and purge all caches.
|
// and purge all caches.
|
||||||
|
|
||||||
$CFG->admin = 'admin';
|
$CFG->admin = 'admin';
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)
|
// 6. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations)
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -878,8 +871,6 @@ $CFG->admin = 'admin';
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// ALL DONE! To continue installation, visit your main page with a browser
|
// ALL DONE! To continue installation, visit your main page with a browser
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
|
||||||
require_once(__DIR__ . '/lib/setup.php'); // Do not edit
|
require_once(__DIR__ . '/lib/setup.php'); // Do not edit
|
||||||
|
|
||||||
// There is no php closing tag in this file,
|
// There is no php closing tag in this file,
|
||||||
// it is intentional because it prevents trailing whitespace problems!
|
// it is intentional because it prevents trailing whitespace problems!
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
* * * * * /usr/bin/php7.1 YNH_WWW_PATH/admin/cli/cron.php >/dev/null
|
* * * * * /usr/bin/php7.1 YNH_DOMAIN/admin/cli/cron.php >/dev/null
|
||||||
|
|
|
@ -30,7 +30,7 @@ group = __USER__
|
||||||
; specific port;
|
; specific port;
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||||
; Note: This value is mandatory.
|
; Note: This value is mandatory.
|
||||||
listen = /var/run/php5-fpm-__NAMETOCHANGE__.sock
|
listen = /var/run/php7.1-fpm-__NAMETOCHANGE__.sock
|
||||||
|
|
||||||
; Set listen(2) backlog. A value of '-1' means unlimited.
|
; Set listen(2) backlog. A value of '-1' means unlimited.
|
||||||
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
|
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
"en": "Choose a path for Moodle",
|
"en": "Choose a path for Moodle",
|
||||||
"fr": "Choisissez un chemin pour Moodle"
|
"fr": "Choisissez un chemin pour Moodle"
|
||||||
},
|
},
|
||||||
"example": "/example",
|
"example": "/moodle",
|
||||||
"default": "/example"
|
"default": "/moodle"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -12,7 +12,28 @@ ynh_delete_file_checksum () {
|
||||||
ynh_app_setting_delete $app $checksum_setting_name
|
ynh_app_setting_delete $app $checksum_setting_name
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a dedicated php-fpm config php7.1
|
ynh_install_php7 () {
|
||||||
|
|
||||||
|
ynh_package_update
|
||||||
|
ynh_package_install apt-transport-https --no-install-recommends
|
||||||
|
|
||||||
|
wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||||
|
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
|
||||||
|
|
||||||
|
ynh_package_update
|
||||||
|
ynh_install_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-soap php7.1-pgsql postgresql-9.4
|
||||||
|
sudo update-alternatives --install /usr/bin/php php /usr/bin/php5 70
|
||||||
|
}
|
||||||
|
|
||||||
|
ynh_remove_php7 () {
|
||||||
|
sudo rm -f /etc/apt/sources.list.d/php7.list
|
||||||
|
sudo apt-key del 4096R/89DF5277
|
||||||
|
sudo apt-key del 2048R/11A06851
|
||||||
|
ynh_remove_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-soap php7.1-pgsql postgresql-9.4
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Create a dedicated php-fpm config
|
||||||
#
|
#
|
||||||
# usage: ynh_add_fpm_config
|
# usage: ynh_add_fpm_config
|
||||||
ynh_add_php7.1-fpm_config () {
|
ynh_add_php7.1-fpm_config () {
|
||||||
|
@ -37,7 +58,11 @@ ynh_add_php7.1-fpm_config () {
|
||||||
sudo systemctl reload php7.1-fpm
|
sudo systemctl reload php7.1-fpm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# Remove the dedicated php-fpm config for php7.1
|
# Remove the dedicated php-fpm config for php7.1
|
||||||
|
=======
|
||||||
|
# Remove the dedicated php-fpm config
|
||||||
|
>>>>>>> 4d1446000580d39209c48e91f1e764e3bb677881
|
||||||
#
|
#
|
||||||
# usage: ynh_remove_fpm_config
|
# usage: ynh_remove_fpm_config
|
||||||
ynh_remove_php7.1-fpm_config () {
|
ynh_remove_php7.1-fpm_config () {
|
||||||
|
@ -45,6 +70,7 @@ ynh_remove_php7.1-fpm_config () {
|
||||||
ynh_secure_remove "/etc/php/7.1/fpm/conf.d/20-$app.ini" 2>&1
|
ynh_secure_remove "/etc/php/7.1/fpm/conf.d/20-$app.ini" 2>&1
|
||||||
sudo systemctl reload php7.1-fpm
|
sudo systemctl reload php7.1-fpm
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
ynh_install_php7 () {
|
ynh_install_php7 () {
|
||||||
|
|
||||||
|
@ -67,3 +93,5 @@ ynh_remove_php7 () {
|
||||||
sudo apt-key del 2048R/11A06851
|
sudo apt-key del 2048R/11A06851
|
||||||
ynh_remove_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-soap php7.1-pgsql
|
ynh_remove_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-soap php7.1-pgsql
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
>>>>>>> 4d1446000580d39209c48e91f1e764e3bb677881
|
||||||
|
|
|
@ -67,7 +67,6 @@ ynh_app_setting_set $app is_public $is_public
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_install_app_dependencies postgresql-9.4
|
|
||||||
ynh_install_php7
|
ynh_install_php7
|
||||||
#=================================================
|
#=================================================
|
||||||
# Create postgresql database
|
# Create postgresql database
|
||||||
|
|
|
@ -17,7 +17,7 @@ source /usr/share/yunohost/helpers
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app psql_db)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue