commit
f9dd286ff1
@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
|
|||||||
#=================================================
|
#=================================================
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Managing script failure..."
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
|
@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
|
|||||||
#=================================================
|
#=================================================
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Managing script failure..."
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
@ -23,6 +24,7 @@ ynh_abort_if_errors
|
|||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Retrieving arguments from the manifest..."
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
@ -63,7 +65,7 @@ ynh_app_setting_set --app=$app --key=ldap_password --value=$ldap_password
|
|||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Configuring firewall..."
|
ynh_print_info --message="Configuring firewall..."
|
||||||
|
|
||||||
# Find a free port
|
# Find an available port
|
||||||
port=$(ynh_find_port --port=8095)
|
port=$(ynh_find_port --port=8095)
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
|
||||||
@ -135,6 +137,7 @@ ynh_add_systemd_config
|
|||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Modifying a config file..."
|
||||||
|
|
||||||
config_file="$final_path/config.yml"
|
config_file="$final_path/config.yml"
|
||||||
cp -f ../conf/config.sample.yml $config_file
|
cp -f ../conf/config.sample.yml $config_file
|
||||||
@ -146,6 +149,7 @@ ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --ta
|
|||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Storing the config file checksum..."
|
||||||
|
|
||||||
# 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="$config_file"
|
ynh_store_file_checksum --file="$config_file"
|
||||||
@ -155,6 +159,7 @@ ynh_store_file_checksum --file="$config_file"
|
|||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Securing files and directories..."
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R "$app":"$app" "$final_path"
|
||||||
@ -162,14 +167,16 @@ chown -R "$app":"$app" "$final_path"
|
|||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
|
||||||
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:"
|
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="HTTP Server:"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -29,6 +29,7 @@ ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
|
|||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Removing service integration in YunoHost..."
|
||||||
|
|
||||||
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
|
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
|
||||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
@ -81,6 +82,7 @@ ynh_remove_nginx_config
|
|||||||
#=================================================
|
#=================================================
|
||||||
# CLOSE A PORT
|
# CLOSE A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Closing a port..."
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
then
|
then
|
||||||
|
@ -12,7 +12,8 @@ source /usr/share/yunohost/helpers
|
|||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#===ynh_print_info --message="Managing script failure..."
|
||||||
|
==============================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
@ -51,6 +52,7 @@ test ! -d $final_path \
|
|||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Restoring the nginx configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Restoring user rights..."
|
||||||
|
|
||||||
# Restore permissions on app files
|
# Restore permissions on app files
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R "$app":"$app" "$final_path"
|
||||||
@ -84,7 +87,6 @@ chown -R "$app":"$app" "$final_path"
|
|||||||
ynh_print_info --message="Reinstalling dependencies..."
|
ynh_print_info --message="Reinstalling dependencies..."
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version="10"
|
ynh_install_nodejs --nodejs_version="10"
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
@ -109,6 +111,7 @@ systemctl enable $app.service
|
|||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ ldap_password=$(ynh_app_setting_get --app=$app --key=ldap_password)
|
|||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info --message="Checking version..."
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user