mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
several improvements from feedback
This commit is contained in:
parent
dc9e7cef8b
commit
ca6619eb71
5 changed files with 11 additions and 7 deletions
|
@ -41,11 +41,11 @@ If your server name is identical to the domain on which synapse is installed, an
|
||||||
If not, you may need to put the following line in the dns configuration:
|
If not, you may need to put the following line in the dns configuration:
|
||||||
|
|
||||||
```
|
```
|
||||||
_matrix._tcp.<yourdomain.com> <ttl> IN SRV 10 0 <port> <server.name>
|
_matrix._tcp.<server_name-you-choose-at-install> <ttl> IN SRV 10 0 <port> <domain-or-subdomain-of-synapse>
|
||||||
```
|
```
|
||||||
for example
|
for example
|
||||||
```
|
```
|
||||||
_matrix._tcp.example.com. 3600 IN SRV 10 0 SYNAPSE_PORT example.com.
|
_matrix._tcp.example.com. 3600 IN SRV 10 0 SYNAPSE_PORT synapse.example.com.
|
||||||
```
|
```
|
||||||
You need to replace SYNAPSE_PORT by the real port. This port can be obtained by the command: `yunohost app setting SYNAPSE_INSTANCE_NAME synapse_tls_port`
|
You need to replace SYNAPSE_PORT by the real port. This port can be obtained by the command: `yunohost app setting SYNAPSE_INSTANCE_NAME synapse_tls_port`
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
"en": "Choose a domain for Synapse",
|
"en": "Choose a domain for Synapse",
|
||||||
"fr": "Choisissez un domaine pour Synapse"
|
"fr": "Choisissez un domaine pour Synapse"
|
||||||
},
|
},
|
||||||
"example": "matrix.domain.org"
|
"example": "synapse.domain.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "server_name",
|
"name": "server_name",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a name for Matrix accounts",
|
"en": "If your synapse domain is a subdomain, you can choose a name for your Synapse server to have your matrix user-ids looking like @user:domain.org instead of @user:synapse.domain.org",
|
||||||
"fr": "Choisissez un nom pour les comptes Matrix"
|
"fr": "Si votre domaine pour synapse est un sous-domaine, vous pouvez choisir un nom pour votre serveur Synapse afin que vos identifiants matrix soient @utilisateur:domain.org plutôt que @utilisateur:synapse.domain.org"
|
||||||
},
|
},
|
||||||
"example": "domain.org"
|
"example": "domain.org"
|
||||||
},
|
},
|
||||||
|
|
|
@ -69,6 +69,7 @@ apply_config() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get $app special_domain)
|
domain=$(ynh_app_setting_get $app special_domain)
|
||||||
|
server_name=$(ynh_app_setting_get $app server_name)
|
||||||
synapse_db_pwd=$(ynh_app_setting_get $app synapse_db_pwd)
|
synapse_db_pwd=$(ynh_app_setting_get $app synapse_db_pwd)
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
port=$(ynh_app_setting_get $app synapse_port)
|
port=$(ynh_app_setting_get $app synapse_port)
|
||||||
|
@ -96,6 +97,7 @@ apply_config() {
|
||||||
|
|
||||||
ynh_replace_string __APP__ $app "$homeserver_config_path"
|
ynh_replace_string __APP__ $app "$homeserver_config_path"
|
||||||
ynh_replace_string __DOMAIN__ $domain "$homeserver_config_path"
|
ynh_replace_string __DOMAIN__ $domain "$homeserver_config_path"
|
||||||
|
ynh_replace_string __SERVER_NAME__ $server_name "$homeserver_config_path"
|
||||||
ynh_replace_string __SYNAPSE_DB_USER__ $synapse_db_user "$homeserver_config_path"
|
ynh_replace_string __SYNAPSE_DB_USER__ $synapse_db_user "$homeserver_config_path"
|
||||||
ynh_replace_string __SYNAPSE_DB_PWD__ $synapse_db_pwd "$homeserver_config_path"
|
ynh_replace_string __SYNAPSE_DB_PWD__ $synapse_db_pwd "$homeserver_config_path"
|
||||||
ynh_replace_string __PORT__ $port "$homeserver_config_path"
|
ynh_replace_string __PORT__ $port "$homeserver_config_path"
|
||||||
|
|
|
@ -57,6 +57,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||||
# This hack solve the issue : https://github.com/YunoHost-Apps/synapse_ynh/issues/14
|
# This hack solve the issue : https://github.com/YunoHost-Apps/synapse_ynh/issues/14
|
||||||
ynh_app_setting_set $app special_domain $domain
|
ynh_app_setting_set $app special_domain $domain
|
||||||
ynh_app_setting_set $app special_path $path_url
|
ynh_app_setting_set $app special_path $path_url
|
||||||
|
ynh_app_setting_set $app server_name $server_name
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
ynh_app_setting_set $app synapse_version $upstream_version
|
ynh_app_setting_set $app synapse_version $upstream_version
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
|
@ -179,7 +180,7 @@ PS1=${PS1:-}
|
||||||
source $final_path/bin/activate
|
source $final_path/bin/activate
|
||||||
|
|
||||||
# Generate config
|
# Generate config
|
||||||
python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $domain --report-stats=no -c homeserver.yml
|
python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $server_name --report-stats=no -c homeserver.yml
|
||||||
|
|
||||||
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
||||||
deactivate
|
deactivate
|
||||||
|
|
|
@ -31,6 +31,7 @@ upstream_version=$(ynh_app_upstream_version)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get $app special_domain)
|
domain=$(ynh_app_setting_get $app special_domain)
|
||||||
|
server_name=$(ynh_app_setting_get $app server_name)
|
||||||
path_url=$(ynh_app_setting_get $app special_path)
|
path_url=$(ynh_app_setting_get $app special_path)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
synapse_old_version=$(ynh_app_setting_get $app synapse_version)
|
synapse_old_version=$(ynh_app_setting_get $app synapse_version)
|
||||||
|
@ -126,7 +127,7 @@ then
|
||||||
source $final_path/bin/activate
|
source $final_path/bin/activate
|
||||||
|
|
||||||
# Generate config and keys
|
# Generate config and keys
|
||||||
python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $domain --report-stats=no -c homeserver.yml
|
python -m synapse.app.homeserver --keys-directory /etc/matrix-$app/ --generate-config --generate-keys --server-name $server_name --report-stats=no -c homeserver.yml
|
||||||
|
|
||||||
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
|
||||||
deactivate
|
deactivate
|
||||||
|
|
Loading…
Reference in a new issue