1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Merge pull request #351 from YunoHost-Apps/testing

Testing
This commit is contained in:
Josue-T 2022-11-30 08:00:06 +01:00 committed by GitHub
commit e990ce4e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 96 additions and 111 deletions

View file

@ -20,7 +20,7 @@ Instant messaging server matrix network.
Yunohost chatroom with matrix : [https://matrix.to/#/#yunohost:matrix.org](https://matrix.to/#/#yunohost:matrix.org)
**Shipped version:** 1.69.0~ynh1
**Shipped version:** 1.71.0~ynh1
## Disclaimers / important information
## Configuration

View file

@ -20,7 +20,7 @@ Instant messaging server matrix network.
Yunohost chatroom with matrix : [https://matrix.to/#/#yunohost:matrix.org](https://matrix.to/#/#yunohost:matrix.org)
**Version incluse :** 1.69.0~ynh1
**Version incluse :** 1.71.0~ynh1
## Avertissements / informations importantes
## Configuration

View file

@ -1,9 +1,9 @@
;; General
; Manifest
domain="domain.tld" (DOMAIN)
path="/_matrix/static/" (PATH)
is_free_registration=1 (PUBLIC|public=1|private=0)
server_name="domain.tld" (DOMAIN)
domain="domain.tld"
path="/_matrix/static/"
is_free_registration=1
server_name="domain.tld"
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -1,11 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.69.0/matrix-synapse_1.69.0-bullseye-bin1_armv7l.tar.gz
SOURCE_SUM=d390ac7900e545e5fb58f243c98a1c2cfe6d8dba4fd58775c8e73e931d20afe2
# (Optional) Program to check the integrity (sha256sum, md5sum...)
# default: sha256
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.71.0/matrix-synapse_1.71.0-bullseye-bin1_armv7l.tar.gz
SOURCE_SUM=01458745ca40441f5b10b0d81bad8488fdcec0ed7fb19d977b7d5b08eb5efa99
SOURCE_SUM_PRG=sha256sum
# (Optional) Archive format
# default: tar.gz
SOURCE_FORMAT=tar.gz
# (Optional) Put false if sources are directly in the archive root
# default: true
SOURCE_IN_SUBDIR=true

View file

@ -1,11 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.69.0/matrix-synapse_1.69.0-buster-bin1_armv7l.tar.gz
SOURCE_SUM=e99f100a3446b9ceff29a5c3ea55657342a2ee22cf2eb5821e75716ede9bea8b
# (Optional) Program to check the integrity (sha256sum, md5sum...)
# default: sha256
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.71.0/matrix-synapse_1.71.0-buster-bin1_armv7l.tar.gz
SOURCE_SUM=e38a39163680ce741a26a665ce7529ba5ddc33acc8acf88ed160750d494ee416
SOURCE_SUM_PRG=sha256sum
# (Optional) Archive format
# default: tar.gz
SOURCE_FORMAT=tar.gz
# (Optional) Put false if sources are directly in the archive root
# default: true
SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
[Unit]
Description=coturn
Description=Coturn
Documentation=man:coturn(1) man:turnadmin(1) man:turnserver(1)
After=syslog.target network.target

View file

@ -1,53 +0,0 @@
version = "0.1"
name = "Synapse configuration panel"
[synapse_config]
name = "Synapse configuration"
[synapse_config.server_config]
name = "Synapse server configuration"
[synapse_config.server_config.server_statistics]
ask = "Server statistics"
type = "boolean"
default = false
help = "True to send anonymous statistics about synapse to improve the performances"
[synapse_config.server_config.is_free_registration]
ask = "Server with free registration"
type = "boolean"
default = false
help = "A public server means that anybody will be able to register on this server."
[synapse_config.server_config.allow_public_rooms]
ask = "Public rooms directory"
type = "boolean"
default = false
help = "If set to 'false', requires authentication to access the server's public rooms directory through the client API and forbids any other homeserver to fetch the server's public rooms directory via federation."
[synapse_config.client_config]
name = "Matrix client configuration"
[synapse_config.client_config.jitsi_server]
ask = "Jitsi server address for conference"
type = "string"
default = 'jitsi.riot.im'
help = "Address of the Jitsi server for conference. Note that it's only for conference in rooms with more than 2 person. With 2 person the stun/turn server is used."
[synapse_config.client_config.e2e_enabled_by_default]
ask = "End to end encryption by default for direct messages"
type = "boolean"
default = true
help = "By default, Element will create encrypted DM rooms if the user you are chatting with has keys uploaded on their account. For private room creation, Element will default to encryption on but give you can disable this settings here."
[package_config]
name = "Package configuration"
[package_config.package_config]
name = "Upgrade"
[package_config.package_config.backup_before_upgrade]
ask = "Backup before upgrade"
type = "boolean"
default = true
help = "True to do a backup before every upgrade"

54
config_panel.toml.example Normal file
View file

@ -0,0 +1,54 @@
version = "1.0"
[main]
name = "Synapse configuration"
[main.config]
name = "Configuration Options"
[main.config.server_statistics]
ask = "Server statistics"
type = "boolean"
yes = true
no = false
help = "Set to 'true' to send anonymous statistics to Synapse to improve performance."
[main.config.is_free_registration]
ask = "Free registration"
type = "boolean"
yes = true
no = false
help = "A public server means that anybody will be able to register on this server."
[main.config.allow_public_rooms]
ask = "Public rooms directory"
type = "boolean"
yes = true
no = false
help = "If set to 'false', requires authentication to access the server's public rooms directory through the client API and forbids any other homeserver to fetch the server's public rooms directory via federation."
[main.client_config]
name = "Matrix client configuration"
[main.client_config.jitsi_server]
ask = "Jitsi server address"
type = "string"
default = 'jitsi.riot.im'
help = "Jitsi server address for the conference. Note that this is only for conferences in rooms with more than 2 people. With 2 people, the stun/turn server is used."
[main.client_config.e2e_enabled_by_default]
ask = "End to end encryption by default for direct messages"
type = "boolean"
yes = true
no = false
help = "By default, Element will create encrypted DM rooms if the user you are chatting with has keys uploaded on their account. For private room creation, Element will default to encryption on but give you can disable this settings here."
[main.package_config]
name = "Package configuration"
[main.package_config.backup_before_upgrade]
ask = "Backup before upgrade"
type = "boolean"
yes = true
no = false
help = "Set to 'true' to back up before each upgrade."

View file

@ -4,9 +4,9 @@
"packaging_format": 1,
"description": {
"en": "Instant messaging server which uses Matrix",
"fr": "Un serveur de messagerie instantané basé sur Matrix"
"fr": "Serveur de messagerie instantané basé sur Matrix"
},
"version": "1.69.0~ynh1",
"version": "1.71.0~ynh1",
"url": "http://matrix.org",
"license": "Apache-2.0",
"maintainer": {
@ -45,7 +45,7 @@
"name": "is_free_registration",
"type": "boolean",
"ask": {
"en": "Is it a server with free registration ?",
"en": "Is it a server with free registration?",
"fr": "Est-ce un serveur avec création de compte libre ?"
},
"default": false,

View file

@ -45,12 +45,16 @@ upstream_version=$(ynh_app_upstream_version)
final_www_path="/var/www/$app"
data_path="/home/yunohost.app/matrix-$app"
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_print_info --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path"
ynh_backup --src_path="$final_www_path"
@ -58,7 +62,6 @@ ynh_backup --src_path="$final_www_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_print_info --message="Backing up nginx web server configuration..."
# BACKUP THE PHP-FPM CONFIGURATION
ynh_backup --src_path "/etc/php/$phpversion/fpm/pool.d/$app.conf"
@ -72,14 +75,12 @@ fi
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
ynh_psql_dump_db --database="$synapse_db_name" > ${YNH_CWD}/dump.sql
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
ynh_print_info --message="Backing up fail2ban configuration"
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
@ -89,14 +90,12 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
#=================================================
# BACKUP SYNAPSE CONFIG
#=================================================
ynh_print_info --message="Backing up synapse configuration..."
ynh_backup --src_path="/etc/matrix-$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_print_info --message="Backing up systemd configuration..."
ynh_backup --src_path="/etc/default/matrix-$app"
ynh_backup --src_path="/etc/systemd/system/matrix-$app.service"
@ -106,21 +105,18 @@ ynh_backup --src_path="/etc/systemd/system/coturn-$app.service"
#=================================================
# BACKUP SYNAPSE DATA
#=================================================
ynh_print_info --message="Backing up synapse data..."
ynh_backup --src_path="$data_path" --is_big=1
#=================================================
# BACKUP SYNAPSE LOG
#=================================================
ynh_print_info --message="Backing up synapse log..."
ynh_backup --src_path="/var/log/matrix-$app" --is_big=1
#=================================================
# BACKUP HOOKS
#=================================================
ynh_print_info --message="Backing up synapse hook..."
# Copy hook
ynh_backup --src_path "/etc/yunohost/hooks.d/post_cert_update/50-$app"

View file

@ -67,7 +67,7 @@ ynh_systemd_action --service_name=matrix-$app.service --action=stop
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Updating nginx configuration..."
ynh_script_progression --message="Updating NGINX configuration..."
# MODIFY URL IN NGINX CONF
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -89,7 +89,7 @@ fi
# UPDATE SYNAPSE CONFIG
#=================================================
ynh_script_progression --message="Updating synapse config..." --weight=2
ynh_script_progression --message="Updating Synapse config..." --weight=2
# WARNING : theses command are used in INSTALL, UPGRADE, CONFIG, CHANGE-URL (4 times)
# For any update do it in all files
@ -127,7 +127,7 @@ chmod u=rwX,g=rX,o= -R /etc/matrix-$app
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression --message="Restarting synapse services..." --weight=5
ynh_script_progression --message="Restarting Synapse services..." --weight=5
ynh_systemd_action --service_name=coturn-$app.service --action=restart
ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Synapse now listening on TCP port $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300

View file

@ -138,7 +138,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=80
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files
ynh_install_app_dependencies $dependances
ynh_exec_warn_less ynh_install_app_dependencies $dependances
#=================================================
# CREATE DEDICATED USER
@ -197,7 +197,7 @@ chown $synapse_user:root -R $final_www_path
# CREATE SYNAPSE CONFIG
#=================================================
ynh_script_progression --message="Creating synapse config..." --weight=3
ynh_script_progression --message="Creating Synapse config..." --weight=3
# Go in virtualenvironnement
set +u;
@ -237,7 +237,7 @@ ynh_add_systemd_config --service=coturn-$app --template=coturn-synapse.service
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=2
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated php-fpm config
ynh_script_progression --message="Configuring application..."
@ -255,7 +255,7 @@ ynh_add_nginx_config app
#=================================================
# SET SYNAPSE CONFIG
#=================================================
ynh_script_progression --message="Configuring synapse..." --weight=2
ynh_script_progression --message="Configuring Synapse..." --weight=2
# Find password for turnserver and database
turnserver_pwd=$(ynh_string_random --length=30)
@ -283,7 +283,7 @@ ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml"
#=================================================
# SET COTURN CONFIG
#=================================================
ynh_script_progression --message="Configuring coturn..." --weight=1
ynh_script_progression --message="Configuring Coturn..." --weight=1
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files
@ -381,7 +381,7 @@ yunohost service add coturn-$app --needs_exposed_ports $turnserver_tls_port
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression --message="Restarting synapse services..." --weight=11
ynh_script_progression --message="Restarting Synapse services..." --weight=11
ynh_systemd_action --service_name=coturn-$app.service --action=restart
ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Synapse now listening on TCP port $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300
@ -389,7 +389,7 @@ ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Syn
#=================================================
# SETUP FAIL2BAN
#=================================================
ynh_script_progression --message="Configuring fail2ban..." --weight=10
ynh_script_progression --message="Configuring Fail2Ban..." --weight=10
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files

View file

@ -93,7 +93,7 @@ ynh_secure_remove --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.c
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing nginx web server configuration" --weight=2
ynh_script_progression --message="Removing NGINX web server configuration" --weight=2
# Remove the dedicated nginx config
ynh_remove_nginx_config
@ -129,7 +129,7 @@ closeport $turnserver_alt_tls_port
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Removing fail2ban configuration..." --weight=8
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8
# Remove the dedicated fail2ban config
ynh_remove_fail2ban_config

View file

@ -71,7 +71,7 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=70
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files
ynh_install_app_dependencies $dependances
ynh_exec_warn_less ynh_install_app_dependencies $dependances
#=================================================
# RECREATE THE DEDICATED USER
@ -101,7 +101,7 @@ install_sources
# RESTORE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Reload fail2ban..." --weight=6
ynh_script_progression --message="Reload Fail2Ban..." --weight=6
ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
@ -155,7 +155,7 @@ fi
#=================================================
# RECONFIGURE THE TURNSERVER
#=================================================
ynh_script_progression --message="Reconfiguring coturn..." --weight=23
ynh_script_progression --message="Reconfiguring Coturn..." --weight=23
# To be sure that at the restoration the IP address in coturn config is the same as the real address we remake the coturn config
@ -227,7 +227,7 @@ chown $synapse_user:root -R $final_www_path
#=================================================
# RELOAD NGINX, SYNAPSE AND COTURN
#=================================================
ynh_script_progression --message="Restarting synapse services..." --weight=7
ynh_script_progression --message="Restarting Synapse services..." --weight=7
ynh_systemd_action --service_name=coturn-$app.service --action=restart
ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Synapse now listening on TCP port $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300
@ -256,7 +256,7 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --type="restore"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..."
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -169,7 +169,7 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files
ynh_install_app_dependencies $dependances
ynh_exec_warn_less ynh_install_app_dependencies $dependances
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -318,7 +318,7 @@ fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated php-fpm config
ynh_script_progression --message="Configuring application..."
@ -330,7 +330,7 @@ then
ynh_add_config --template="server_name.conf" --destination="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
fi
# Create a dedicated nginx config
# Create a dedicated NGINX config
ynh_add_nginx_config app
#=================================================
@ -338,7 +338,7 @@ ynh_add_nginx_config app
#=================================================
# UPDATE COTURN CONFIG
#=================================================
ynh_script_progression --message="Updating coturn config..." --weight=1
ynh_script_progression --message="Updating Coturn config..." --weight=1
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files
@ -397,7 +397,7 @@ ynh_add_systemd_config --service=coturn-$app --template=coturn-synapse.service
#=================================================
# UPGRADE FAIL2BAN
#=================================================
ynh_script_progression --message="Reconfiguring fail2ban..." --weight=8
ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8
# WARNING : theses command are used in INSTALL, UPGRADE
# For any update do it in all files
@ -480,7 +480,7 @@ ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression --message="Restarting synapse services..." --weight=5
ynh_script_progression --message="Restarting Synapse services..." --weight=5
ynh_systemd_action --service_name=coturn-$app.service --action=restart
ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Synapse now listening on TCP port $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300