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

[fix] $app usage and [rem] f2b config

This commit is contained in:
tituspijean 2020-04-15 18:04:06 +02:00
parent e0c4846cce
commit 19a00c98d2

View file

@ -322,7 +322,7 @@ fi
#Generate the appservice registration file by running ./mautrix-whatsapp -g.
#You can use the -c and -r flags to change the location of the config and registration files. They default to config.yaml and registration.yaml respectively.
./mautrix-whatsapp -g -r /etc/matrix-synapse/mautrix-whatsapp-registration.yaml
./mautrix-whatsapp -g -r /etc/matrix-synapse/$app-registration.yaml
#Add the path to the registration file (registration.yaml by default) to your synapse homeserver.yaml under app_service_config_files.
# A list of application service config files to use
#
@ -330,7 +330,7 @@ fi
# - app_service_1.yaml
# - "/etc/matrix-synapse/registration.yaml"
ynh_replace_string --match_string="#app_service_config_files:" --replace_string="app_service_config_files:" --target_file="/etc/matrix-synapse/homeserver.yaml"
ynh_replace_string --match_string="# - app_service_1.yaml" --replace_string=" - '/etc/matrix-synapse/mautrix-whatsapp-registration.yaml'" --target_file="/etc/matrix-synapse/homeserver.yaml"
ynh_replace_string --match_string="# - app_service_1.yaml" --replace_string=" - '/etc/matrix-synapse/$app-registration.yaml'" --target_file="/etc/matrix-synapse/homeserver.yaml"
#You will then need to restart the synapse server. Remember to restart it every time the registration file is regenerated.
service matrix-synapse restart
#Run the bridge with
@ -375,8 +375,8 @@ chown $mautrix_whatsapp_user:root -R $final_path
#setfacl -R -m user:turnserver:rX /etc/matrix-$app
#setfacl -R -m user:turnserver:rwX /var/log/matrix-$app
chown matrix-synapse:root /etc/matrix-synapse/mautrix-whatsapp-registration.yaml
chmod u=rwX,g=rX,o= /etc/matrix-synapse/mautrix-whatsapp-registration.yaml
chown $app:root /etc/matrix-synapse/$app-registration.yaml
chmod u=rwX,g=rX,o= /etc/matrix-synapse/$app-registration.yaml
#=================================================
# SETUP LOGROTATE
@ -406,7 +406,7 @@ ynh_use_logrotate --logfile "/var/log/$app"
### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script
### - As well as the section "ADVERTISE SERVICE IN ADMIN PANEL" in the restore script
yunohost service add $app --log "/var/log/$app/mautrix-whatsapp.log"
yunohost service add $app --log "/var/log/$app/$app.log"
# 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 XXX" --log "/var/log/$app/$app.log"
@ -424,7 +424,7 @@ ynh_script_progression --message="Starting a systemd service..." --time --weight
### - And the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the change_url script
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --line_match="Bot now ready to bridge Whatsapp and Matrix users from $botusers" --log_path="/var/log/$app/mautrix-whatsapp.log" --timeout=300
ynh_systemd_action --service_name=$app --action="start" --line_match="Bot now ready to bridge Whatsapp and Matrix users from $botusers" --log_path="/var/log/$app/$app.log" --timeout=300
#=================================================
# SETUP FAIL2BAN
@ -433,7 +433,7 @@ ynh_script_progression --message="Configuring fail2ban..." --time --weight=1
# Create a dedicated fail2ban config
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
ynh_add_fail2ban_config --use_template
#ynh_add_fail2ban_config --use_template
#=================================================
# SETUP SSOWAT