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

Updated readme and few fixes in upgrade and restore

This commit is contained in:
anmol 2020-10-13 19:08:06 +05:30
parent 9a73892263
commit 7154fffaf7
4 changed files with 11 additions and 13 deletions

View file

@ -10,8 +10,7 @@
> *This package allows you to install Misskey quickly and simply on a YunoHost server. > *This package allows you to install Misskey quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
<img src="https://藍.moe/aiart/31.png" width="160" style="zoom: 200%;" /> ![](https://藍.moe/aiart/31.png)
## Overview ## Overview

View file

@ -300,8 +300,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 ynh_script_progression --message="Configuring SSOwat..."
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then

View file

@ -49,10 +49,7 @@ test ! -d $final_path \
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -149,5 +146,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
#===============================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Restoration completed for $app" ynh_script_progression --message="Restoration completed for $app"

View file

@ -21,7 +21,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public) is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
@ -97,12 +96,12 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
# For now nothing will upgrade as I don't which files needs to be backed up before upgrade
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
@ -131,8 +130,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app ynh_system_user_create --username=$app
@ -190,7 +188,7 @@ ynh_add_systemd_config
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. ### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
ynh_backup_if_checksum_is_different --file="$config" ynh_backup_if_checksum_is_different --file="$config"
ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$config" ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/.config/default.yml.backup"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config" ynh_store_file_checksum --file="$config"