mirror of
https://github.com/YunoHost-Apps/mautrix_signal_ynh.git
synced 2024-09-03 19:46:07 +02:00
Testing (#3)
* remove signalctl dependency * remove --no-install-recommends * upgrade to 0.1.1 and signald 1.4 * add backup remove restore upgrade * typo backup log * error upgrade * same for restore * set python venv in restore script * Update README.md * prepare for add to app list * ynh_add_config in install * ynh_add_config in upgrade * Update config.yaml * Update check_process * restore signald user data folder
This commit is contained in:
parent
898c8ffc11
commit
68bd14ff52
5 changed files with 21 additions and 61 deletions
|
@ -1,25 +1,10 @@
|
||||||
# See here for more information
|
# See here for more information
|
||||||
# https://github.com/YunoHost/package_check#syntax-of-check_process
|
# https://github.com/YunoHost/package_check#syntax-of-check_process
|
||||||
|
|
||||||
# Move this file from check_process.default to check_process when you have filled it.
|
|
||||||
|
|
||||||
;; Test complet
|
;; Test complet
|
||||||
# auto_remove=1
|
# auto_remove=1
|
||||||
; pre-install
|
; pre-install
|
||||||
# synapse parameters
|
sudo yunohost tools update apps
|
||||||
sy_domain="domain.tld"
|
|
||||||
sy_path="/_matrix/static/"
|
|
||||||
sy_is_public=1
|
|
||||||
sy_server_name="domain2.tld"
|
|
||||||
sy_jitsi_server="jitsi.riot.im"
|
|
||||||
#admin="john" (USER)
|
|
||||||
#language="en"
|
|
||||||
#password="pass"
|
|
||||||
#port="666" (PORT)
|
|
||||||
|
|
||||||
sudo yunohost tools update --apps
|
|
||||||
sudo yunohost domain add $domain
|
|
||||||
sudo yunohost domain add $server_name
|
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_public=$is_public&jitsi_server=$jitsi_server" --force
|
sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_public=$is_public&jitsi_server=$jitsi_server" --force
|
||||||
; Manifest
|
; Manifest
|
||||||
# mautrix_whatsapp manifest parameters
|
# mautrix_whatsapp manifest parameters
|
||||||
|
@ -37,7 +22,8 @@
|
||||||
setup_private=0
|
setup_private=0
|
||||||
setup_public=0
|
setup_public=0
|
||||||
upgrade=1
|
upgrade=1
|
||||||
#upgrade=1 from_commit=CommitHash
|
upgrade=1 from_commit=898c8ffc11882f1411431bfd79d083a0c9471ea7
|
||||||
|
#upgrade=1 from_commit=c755a9e7e0d46402a231e00a675f41099dea3daa
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
port_already_use=1
|
port_already_use=1
|
||||||
|
@ -47,8 +33,8 @@
|
||||||
#;;; Levels
|
#;;; Levels
|
||||||
# # If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
# # If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
||||||
# Level 5=auto
|
# Level 5=auto
|
||||||
#;;; Upgrade options
|
;;; Upgrade options
|
||||||
# ; commit=CommitHash
|
; commit=898c8ffc11882f1411431bfd79d083a0c9471ea7
|
||||||
#name=Name and date of the commit.
|
name=0.1.1 before better signald handling.
|
||||||
#manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
# ; commit=c755a9e7e0d46402a231e00a675f41099dea3daa
|
||||||
|
# name=0.1.0 first working version.
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
# See here for more information
|
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
|
||||||
|
|
||||||
# Move this file from check_process.default to check_process when you have filled it.
|
|
||||||
|
|
||||||
;; Test complet
|
|
||||||
; Manifest
|
|
||||||
domain="domain.tld" (DOMAIN)
|
|
||||||
path="/path" (PATH)
|
|
||||||
admin="john" (USER)
|
|
||||||
language="fr"
|
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
|
||||||
password="pass"
|
|
||||||
port="666" (PORT)
|
|
||||||
; Checks
|
|
||||||
pkg_linter=1
|
|
||||||
setup_sub_dir=1
|
|
||||||
setup_root=1
|
|
||||||
setup_nourl=0
|
|
||||||
setup_private=1
|
|
||||||
setup_public=1
|
|
||||||
upgrade=1
|
|
||||||
upgrade=1 from_commit=CommitHash
|
|
||||||
backup_restore=1
|
|
||||||
multi_instance=1
|
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
|
||||||
;;; Options
|
|
||||||
Email=
|
|
||||||
Notification=none
|
|
||||||
;;; Upgrade options
|
|
||||||
; commit=CommitHash
|
|
||||||
name=Name and date of the commit.
|
|
||||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
app_service_registration_path=$(ynh_app_setting_get --app=$app --key=app_service_registration_path)
|
app_service_registration_path=$(ynh_app_setting_get --app=$app --key=app_service_registration_path)
|
||||||
mautrix_config_path="$final_path/config.yaml"
|
mautrix_config_path="$final_path/config.yaml"
|
||||||
|
signal_path="/var/lib/signald"
|
||||||
|
#signal_path="/usr/bin/signald"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SET CONSTANTS
|
# SET CONSTANTS
|
||||||
|
@ -54,7 +56,6 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -68,12 +69,13 @@ ynh_backup --src_path="/var/log/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
|
#ynh_backup --src_path="/etc/systemd/system/signald.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP VARIOUS FILES
|
# BACKUP VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# ynh_backup --src_path="/etc/cron.d/$app"
|
ynh_backup --src_path="$signal_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE POSTGRESQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
|
|
|
@ -46,6 +46,8 @@ mautrix_bridge_user=$app
|
||||||
mautrix_bridge_db_name=$app
|
mautrix_bridge_db_name=$app
|
||||||
mautrix_bridge_db_user=$app
|
mautrix_bridge_db_user=$app
|
||||||
upstream_version=$(ynh_app_upstream_version)
|
upstream_version=$(ynh_app_upstream_version)
|
||||||
|
signald_data="/var/lib/signald"
|
||||||
|
signald_exe="/usr/bin/signald"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -77,6 +79,8 @@ ynh_script_progression --message="Removing the PostgreSQL database..." --weight=
|
||||||
ynh_psql_remove_db --db_user=$mautrix_bridge_db_name --db_name=$mautrix_bridge_db_user
|
ynh_psql_remove_db --db_user=$mautrix_bridge_db_name --db_name=$mautrix_bridge_db_user
|
||||||
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$mautrix_bridge_user"";"
|
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$mautrix_bridge_user"";"
|
||||||
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$mautrix_bridge_user"";"
|
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$mautrix_bridge_user"";"
|
||||||
|
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP OWNED BY ""$botname"";"
|
||||||
|
ynh_psql_execute_as_root --database=$synapse_db_name --sql="DROP USER ""$botname"";"
|
||||||
#yunohost app action run $synapse_instance drop_user -a username=$botname
|
#yunohost app action run $synapse_instance drop_user -a username=$botname
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -93,7 +97,8 @@ ynh_remove_app_dependencies
|
||||||
ynh_script_progression --message="Removing app main directory..." --weight=1
|
ynh_script_progression --message="Removing app main directory..." --weight=1
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
#ynh_secure_remove --file="/etc/$app/"
|
ynh_secure_remove --file="$signald_data"
|
||||||
|
ynh_secure_remove --file="$signald_exe"
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -58,6 +58,8 @@ mautrix_bridge_user=$app
|
||||||
mautrix_bridge_db_name=$app
|
mautrix_bridge_db_name=$app
|
||||||
mautrix_bridge_db_user=$app
|
mautrix_bridge_db_user=$app
|
||||||
upstream_version=$(ynh_app_upstream_version)
|
upstream_version=$(ynh_app_upstream_version)
|
||||||
|
signald_data="/var/lib/signald"
|
||||||
|
#signald_exe="/usr/bin/signald"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -181,7 +183,7 @@ ynh_systemd_action --service_name=$app --action="start"
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# ynh_restore_file --origin_path="/etc/$app/"
|
ynh_restore_file --origin_path="$signald_data"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue