1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/horde_ynh.git synced 2024-09-03 19:16:08 +02:00

Add title for each part of code

This commit is contained in:
Josué Tille 2018-02-11 00:32:26 +01:00
parent 56e2f75387
commit f03a61d33f
7 changed files with 69 additions and 21 deletions

View file

@ -1,8 +1,17 @@
#!/bin/bash #!/bin/bash
#=================================================
# SET ALL CONSTANTS
#=================================================
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path="/var/www/$app"
gollem_data_dir="/home/yunohost.app/$app" gollem_data_dir="/home/yunohost.app/$app"
#=================================================
# DEFINE ALL COMMON FONCTIONS
#=================================================
install_dependance() { install_dependance() {
ynh_install_app_dependencies php-pear expect php5-imagick php5-tidy ynh_install_app_dependencies php-pear expect php5-imagick php5-tidy
} }

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -10,13 +14,14 @@ ynh_abort_if_errors
source ../settings/scripts/experimental_helper.sh source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
# LOAD SETTINGS
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
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 db_name)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
ynh_backup "$final_path" ynh_backup "$final_path"

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -50,23 +54,13 @@ then
change_path=1 change_path=1
fi fi
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the nginx config file
# if [ $change_path -eq 1 ]
# then
# # Make a backup of the original nginx config file if modified
# ynh_backup_if_checksum_is_different "$nginx_conf_path"
# # Replace locations starting with old_path
# # Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
# ynh_replace_string "location\( \(=\|~\|~\*\|\^~\)\)\? $old_path" "location\1 $new_path" "$nginx_conf_path"
# # Replace path in "return" directives
# ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path"
# # Calculate and store the nginx config file checksum
# ynh_store_file_checksum "$nginx_conf_path"
# fi
# Change the domain for nginx # Change the domain for nginx
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -64,6 +68,10 @@ then
optionnal_apps_list="$optionnal_apps_list horde/wicked" optionnal_apps_list="$optionnal_apps_list horde/wicked"
fi fi
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# Enable all necessary locales # Enable all necessary locales
if [[ "$language" != "en" ]] if [[ "$language" != "en" ]]
then then
@ -127,6 +135,10 @@ config_nginx
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
set_permission set_permission

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -16,6 +20,10 @@ db_name=$(ynh_app_setting_get $app db_name)
db_user=$(ynh_app_setting_get $app db_user) db_user=$(ynh_app_setting_get $app db_user)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -10,9 +14,6 @@ ynh_abort_if_errors
source ../settings/scripts/experimental_helper.sh source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
# LOAD SETTINGS
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path) path_url=$(ynh_app_setting_get $app path)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
@ -24,6 +25,10 @@ ynh_webpath_available $domain $path_url \
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die "There is already a directory: $final_path " || ynh_die "There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# Define and install dependencies # Define and install dependencies
install_dependance install_dependance
@ -38,6 +43,10 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd)
ynh_mysql_setup_db $db_name $db_name $db_pwd ynh_mysql_setup_db $db_name $db_name $db_pwd
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
set_permission set_permission

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -10,7 +14,6 @@ ynh_abort_if_errors
source ./experimental_helper.sh source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
# LOAD SETTINGS # LOAD SETTINGS
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_normalize_url_path $(ynh_app_setting_get $app path)) path_url=$(ynh_normalize_url_path $(ynh_app_setting_get $app path))
@ -33,6 +36,10 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
install_dependance install_dependance
@ -50,5 +57,9 @@ config_horde
# NGINX CONFIGURATION # NGINX CONFIGURATION
config_nginx config_nginx
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
set_permission set_permission