mirror of
https://github.com/YunoHost/example_ynh.git
synced 2024-09-03 20:06:13 +02:00
Update install
This commit is contained in:
parent
530e4122c2
commit
ea6b817b1c
1 changed files with 12 additions and 12 deletions
|
@ -57,8 +57,8 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
|
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
|
||||||
|
|
||||||
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
|
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
|
||||||
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
|
### If the app provides an internal web server (or uses another application server such as uwsgi), hould be "/opt/yunohost/$app"
|
||||||
final_path=/var/www/$app
|
final_path=/opt/yunohost/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||||
|
|
||||||
# Register (book) web path
|
# Register (book) web path
|
||||||
|
@ -88,7 +88,7 @@ ynh_script_progression --message="Configuring firewall..." --time --weight=1
|
||||||
### - Remove the section "CLOSE A PORT" in the remove script
|
### - Remove the section "CLOSE A PORT" in the remove script
|
||||||
|
|
||||||
# Find a free port
|
# Find a free port
|
||||||
port=$(ynh_find_port --port=8095)
|
port=$(ynh_find_port --port=7080)
|
||||||
# Open this port
|
# Open this port
|
||||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
@ -106,7 +106,7 @@ ynh_script_progression --message="Installing dependencies..." --time --weight=1
|
||||||
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
||||||
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
#sw. ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
|
@ -122,10 +122,10 @@ ynh_script_progression --message="Creating a MySQL database..." --time --weight=
|
||||||
### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script
|
### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script
|
||||||
### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script
|
### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
#sw. db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_user=$db_name
|
#sw. db_user=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
#sw. ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
#sw. ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -175,7 +175,7 @@ ynh_script_progression --message="Configuring php-fpm..." --time --weight=1
|
||||||
### - And the section "PHP-FPM CONFIGURATION" in the upgrade script
|
### - And the section "PHP-FPM CONFIGURATION" in the upgrade script
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config
|
#sw. ynh_add_fpm_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -240,7 +240,7 @@ fi
|
||||||
### `ynh_replace_string` is used to replace a string in a file.
|
### `ynh_replace_string` is used to replace a string in a file.
|
||||||
### (It's compatible with sed regular expressions syntax)
|
### (It's compatible with sed regular expressions syntax)
|
||||||
|
|
||||||
ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/CONFIG_FILE"
|
#ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/CONFIG_FILE"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
@ -251,7 +251,7 @@ ynh_replace_string --match_string="match_string" --replace_string="replace_strin
|
||||||
### you can make a backup of this file before modifying it again if the admin had modified it.
|
### you can make a backup of this file before modifying it again if the admin had modified it.
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
# Calculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
|
#ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -280,7 +280,7 @@ ynh_script_progression --message="Configuring log rotation..." --time --weight=1
|
||||||
### - And the section "SETUP LOGROTATE" in the upgrade script
|
### - And the section "SETUP LOGROTATE" in the upgrade script
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
#sw. ynh_use_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
|
Loading…
Add table
Reference in a new issue