1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00
This commit is contained in:
ericgaspar 2021-02-19 16:04:53 +01:00
parent fd1abc3371
commit 8ec548cbfb
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 25 additions and 94 deletions

View file

@ -46,14 +46,6 @@ ynh_backup --src_path="$final_path"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
#ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================

View file

@ -66,16 +66,6 @@ ynh_script_progression --message="Finding an available port..." --weight=3
port=$(ynh_find_port --port=8443)
ynh_app_setting_set --app=$app --key=port --value=$port
# Open the port
# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
#ynh_script_progression --message="Installing dependencies..." --time --weight=1
#ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -121,20 +111,28 @@ public_ip4="$(curl ip.yunohost.org)" || true
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="public_ip4"
#=================================================
# CREAT GROUPS FILE
#=================================================
# Define app's groups directory
groups="$final_path/groups"
# Create groups folders
mkdir -p "$groups"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
#ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
#ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
#cp ../conf/passwd $final_path/data/passwd
#ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/data/passwd"
#ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/data/passwd"
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
cp ../conf/passwd $final_path/data/passwd
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/data/passwd"
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/data/passwd"
mv ../conf/groupname.json $final_path/groups/$group_name.json
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/groups/$group_name.json"
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/groups/$group_name.json"
#mv ../conf/groupname.json $final_path/groups/$group_name.json
#ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/groups/$group_name.json"
#ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/groups/$group_name.json"
ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
@ -154,14 +152,6 @@ ynh_store_file_checksum --file="$final_path/groups/$group_name.json"
chown -R $app: $final_path
chmod -R 755 $final_path
#=================================================
# SETUP LOGROTATE
#=================================================
#ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
#ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
@ -185,7 +175,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=2
# Make app public if necessary
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission "main" --add "visitors"
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================

View file

@ -41,14 +41,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
#ynh_script_progression --message="Removing dependencies..." --time --weight=1
# Remove metapackage and its dependencies
#ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
@ -65,24 +57,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1
# Remove the app-specific logrotate config
#ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
# if yunohost firewall list | grep -q "\- $port$"
# then
# ynh_script_progression --message="Closing port $port..." --time --weight=1
# ynh_exec_warn_less yunohost firewall disallow TCP $port
# fi
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -73,16 +73,6 @@ ynh_system_user_create --username=$app
chown -R $app: $final_path
chmod -R 755 $final_path
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
#ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
#ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE SYSTEMD
#=================================================
@ -105,12 +95,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
#ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -42,6 +42,12 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If groups folder doesn't exist, create it
if [ -z "$final_path/groups" ]; then
# Create groups folders
mkdir -p "$final_path/groups"
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -63,7 +69,7 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -106,13 +112,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
#ynh_script_progression --message="Upgrading dependencies..." --weight=1
#ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -139,14 +138,6 @@ ynh_add_systemd_config
chown -R $app: $final_path
chmod -R 755 $final_path
#=================================================
# SETUP LOGROTATE
#=================================================
# ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
# # Use logrotate to manage app-specific logfile(s)
# ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================