mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Merge branch 'testing' into block_public_rooms
This commit is contained in:
commit
bd2b63f86d
9 changed files with 38 additions and 5 deletions
|
@ -14,7 +14,7 @@ Instant messaging server matrix network.
|
|||
|
||||
Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org)
|
||||
|
||||
**Shipped version:** 1.5.1
|
||||
**Shipped version:** 1.6.1
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -35,7 +35,7 @@ If you want a web client you can also install riot with this package: https://gi
|
|||
|
||||
If your server name is identical to the domain on which synapse is installed, and the default port 8448 is used, your server is normally already accessible by the federation.
|
||||
|
||||
If not, you may need to put the following line in the dns configuration:
|
||||
If not, you can add the following line in the dns configuration but you normally don't need it as a .well-known file is edited during the install to declare your server name and port to the federation.
|
||||
|
||||
```
|
||||
_matrix._tcp.<server_name.tld> <ttl> IN SRV 10 0 <port> <domain-or-subdomain-of-synapse.tld>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
domain="domain.tld" (DOMAIN)
|
||||
path="/_matrix/static/" (PATH)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
server_name="domain2.tld" (DOMAIN)
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.5.1/matrix-synapse_1.5.1-stretch-bin1_armv7l.tar.gz
|
||||
SOURCE_SUM=34e09433ef07b41a20125f5505bda98358233ff27e6e2248f3d70a72e423c9dd
|
||||
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.6.1/matrix-synapse_1.6.1-stretch-bin1_armv7l.tar.gz
|
||||
SOURCE_SUM=4836bd5fefdd9855a329b470875a7bc9f795755c72718670421009bc47826c35
|
||||
# (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# default: sha256
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
|
|
5
conf/server_name.conf
Normal file
5
conf/server_name.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
location /.well-known/matrix/ {
|
||||
return 200 '{"m.server": "__DOMAIN__:__PORT__"}';
|
||||
add_header Content-Type application/json;
|
||||
add_header Access-Control-Allow-Origin '*';
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Instant messaging server who use matrix",
|
||||
"fr": "Un serveur de messagerie instantané basé sur matrix"
|
||||
},
|
||||
"version": "1.5.1~ynh1",
|
||||
"version": "1.6.1~ynh1",
|
||||
"url": "http://matrix.org",
|
||||
"license": "Apache-2.0",
|
||||
"maintainer": {
|
||||
|
|
|
@ -25,6 +25,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=2
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=special_domain)
|
||||
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
||||
#=================================================
|
||||
|
@ -51,6 +52,10 @@ ynh_backup --src_path="$final_path"
|
|||
ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
if yunohost --output-as plain domain list | grep -q "^$server_name$"
|
||||
then
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE POSTGRESQL DATABASE
|
||||
|
|
|
@ -299,6 +299,16 @@ fi
|
|||
ynh_store_file_checksum --file="$homeserver_config_path"
|
||||
ynh_store_file_checksum --file="/etc/matrix-$app/log.yaml"
|
||||
|
||||
|
||||
# Create .well-known redirection for access by federation
|
||||
if yunohost --output-as plain domain list | grep -q "^$server_name$"
|
||||
then
|
||||
cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf
|
||||
ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SET COTURN CONFIG
|
||||
#=================================================
|
||||
|
|
|
@ -18,6 +18,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=3
|
|||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=special_domain)
|
||||
server_name=$(ynh_app_setting_get --app=$app --key=server_name)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
synapse_tls_port=$(ynh_app_setting_get --app=$app --key=synapse_tls_port)
|
||||
turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port)
|
||||
|
@ -91,6 +92,7 @@ ynh_secure_remove --file=/var/log/matrix-$app
|
|||
ynh_secure_remove --file=/etc/matrix-$app
|
||||
ynh_secure_remove --file=/etc/default/matrix-$app
|
||||
ynh_secure_remove --file=/etc/default/coturn-$app
|
||||
ynh_secure_remove --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
|
|
|
@ -236,6 +236,16 @@ fi
|
|||
ynh_store_file_checksum --file="$homeserver_config_path"
|
||||
ynh_store_file_checksum --file="/etc/matrix-$app/log.yaml"
|
||||
|
||||
# Create .well-known redirection for access by federation if it doesn't exist
|
||||
if yunohost --output-as plain domain list | grep -q "^$server_name$"
|
||||
then
|
||||
ynh_backup_if_checksum_is_different --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf
|
||||
cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf
|
||||
ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# MIGRATION 2 : MULTINSTANCE SUPPORT
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue