1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00

Update install

This commit is contained in:
liberodark 2020-01-22 16:02:40 +01:00 committed by GitHub
parent bc5d1f7c82
commit 36ed7091d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,20 +51,20 @@ final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Normalize the url path syntax # Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url) path_url=$(ynh_normalize_url_path "$path_url")
# Check web path availability # Check web path availability
ynh_webpath_available $domain $path_url ynh_webpath_available "$domain" "$path_url"
# Register (book) web path # Register (book) web path
ynh_webpath_register $app $domain $path_url ynh_webpath_register "$app" "$domain" "$path_url"
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_app_setting_set $app domain $domain ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set $app path $path_url ynh_app_setting_set "$app" path "$path_url"
ynh_app_setting_set $app is_public $is_public ynh_app_setting_set "$app" is_public "$is_public"
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -84,20 +84,20 @@ ynh_install_app_dependencies postgresql
db_name=$app db_name=$app
db_pwd=$(ynh_string_random 30) db_pwd=$(ynh_string_random 30)
ynh_app_setting_set $app psql_db $db_name ynh_app_setting_set "$app" psql_db "$db_name"
ynh_app_setting_set $app psqlpwd $db_pwd ynh_app_setting_set "$app" psqlpwd "$db_pwd"
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_create_user $app $db_pwd ynh_psql_create_user "$app" "$db_pwd"
ynh_psql_execute_as_root \ ynh_psql_execute_as_root \
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;" "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set "$app" final_path "$final_path"
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path" ynh_setup_source "$final_path"
cp ../conf/config.php $final_path/. cp ../conf/config.php "$final_path"/.
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -111,7 +111,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# Create a system user # Create a system user
ynh_system_user_create $app ynh_system_user_create "$app"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -153,16 +153,16 @@ ynh_replace_string "YNH_VAR_ROOT" "$var_root" "$final_path/config.php"
ynh_store_file_checksum "$final_path/config.php" ynh_store_file_checksum "$final_path/config.php"
# Create the home directory # Create the home directory
mkdir -p $var_root mkdir -p "$var_root"
chown -R $app: $var_root chown -R "$app": "$var_root"
chmod -R 700 $var_root chmod -R 700 "$var_root"
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
# Set right permissions for curl install # Set right permissions for curl install
chown -R $app: $final_path chown -R "$app": "$final_path"
# Reload Nginx # Reload Nginx
systemctl reload nginx systemctl reload nginx
@ -174,26 +174,26 @@ systemctl reload nginx
#================================================= #=================================================
# Set permissions to app files # Set permissions to app files
chown root: $final_path/config.php chown root: "$final_path"/config.php
# Set up poller # Set up poller
sudo cp ../conf/cron /etc/cron.d/$app sudo cp ../conf/cron /etc/cron.d/"$app"
ynh_replace_string "YNH_DOMAIN" "$final_path" "/etc/cron.d/$app" ynh_replace_string "YNH_DOMAIN" "$final_path" "/etc/cron.d/$app"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
if [ $is_public -eq 0 ] if [ "$is_public" -eq 0 ]
then # Remove the public access then # Remove the public access
ynh_app_setting_delete $app skipped_uris ynh_app_setting_delete "$app" skipped_uris
fi fi
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ "$is_public" -eq 1 ]
then then
# unprotected_uris allows SSO credentials to be passed anyway. # unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set $app unprotected_uris "/" ynh_app_setting_set "$app" unprotected_uris "/"
fi fi
yunohost app ssowatconf yunohost app ssowatconf