mirror of
https://github.com/YunoHost-Apps/synapse-admin_ynh.git
synced 2024-09-03 20:26:34 +02:00
Merge pull request #13 from YunoHost-Apps/fix
This commit is contained in:
commit
602215d88e
11 changed files with 82 additions and 60 deletions
18
README.md
18
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
# Synapse Admin for YunoHost
|
# Synapse Admin for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/synapse-admin)  
|
[](https://dash.yunohost.org/appci/app/synapse-admin)  
|
||||||
[](https://install-app.yunohost.org/?app=synapse-admin)
|
[](https://install-app.yunohost.org/?app=synapse-admin)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
@ -20,27 +20,27 @@ Admin UI for Synapse
|
||||||
**Shipped version:** 0.8.5~ynh1
|
**Shipped version:** 0.8.5~ynh1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Official app website: https://github.com/Awesome-Technologies/synapse-admin
|
* Official app website: <https://github.com/Awesome-Technologies/synapse-admin>
|
||||||
* Upstream app code repository: https://github.com/Awesome-Technologies/synapse-admin
|
* Upstream app code repository: <https://github.com/Awesome-Technologies/synapse-admin>
|
||||||
* YunoHost documentation for this app: https://yunohost.org/app_synapse-admin
|
* YunoHost documentation for this app: <https://yunohost.org/app_synapse-admin>
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/synapse-admin_ynh/issues
|
* Report a bug: <https://github.com/YunoHost-Apps/synapse-admin_ynh/issues>
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade synapse-admin -u https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
sudo yunohost app upgrade synapse-admin -u https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||||
|
|
26
README_fr.md
26
README_fr.md
|
@ -1,10 +1,14 @@
|
||||||
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
# Synapse Admin pour YunoHost
|
# Synapse Admin pour YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/synapse-admin)  
|
[](https://dash.yunohost.org/appci/app/synapse-admin)  
|
||||||
[](https://install-app.yunohost.org/?app=synapse-admin)
|
[](https://install-app.yunohost.org/?app=synapse-admin)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
|
||||||
|
|
||||||
> *Ce package vous permet d'installer Synapse Admin rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Synapse Admin rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||||
|
@ -13,30 +17,30 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
|
|
||||||
Admin UI pour Synapse
|
Admin UI pour Synapse
|
||||||
|
|
||||||
**Version incluse :** 0.8.5~ynh1
|
**Version incluse :** 0.8.5~ynh1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
* Site officiel de l'app : https://github.com/Awesome-Technologies/synapse-admin
|
* Site officiel de l'app : <https://github.com/Awesome-Technologies/synapse-admin>
|
||||||
* Dépôt de code officiel de l'app : https://github.com/Awesome-Technologies/synapse-admin
|
* Dépôt de code officiel de l'app : <https://github.com/Awesome-Technologies/synapse-admin>
|
||||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_synapse-admin
|
* Documentation YunoHost pour cette app : <https://yunohost.org/app_synapse-admin>
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/synapse-admin_ynh/issues
|
* Signaler un bug : <https://github.com/YunoHost-Apps/synapse-admin_ynh/issues>
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing).
|
||||||
|
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade synapse-admin -u https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
sudo yunohost app upgrade synapse-admin -u https://github.com/YunoHost-Apps/synapse-admin_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
;; Test complet
|
;; Test complet
|
||||||
|
; pre-install
|
||||||
|
sudo yunohost tools update apps
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/tree/823f98a8cbe108ad4cc0e38e280a83401dca2b9f -a "domain=sub.domain.tld&server_name=$server_name&is_free_registration=$is_free_registration&jitsi_server=$jitsi_server" --force
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld"
|
domain="domain.tld"
|
||||||
|
synapse_app="synapse"
|
||||||
synapse_domain="sub.domain.tld"
|
synapse_domain="sub.domain.tld"
|
||||||
path="/path"
|
|
||||||
admin="john"
|
|
||||||
is_public=1
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
|
|
8
conf/endpoint.nginx.conf
Normal file
8
conf/endpoint.nginx.conf
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
location /_synapse/admin {
|
||||||
|
proxy_pass http://localhost:__SYNAPSE_PORT__;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
client_max_body_size 100M;
|
||||||
|
}
|
|
@ -15,31 +15,3 @@ location / {
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/acme-challenge {
|
|
||||||
proxy_pass http://127.0.0.1:8009;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /.well-known/matrix/server {
|
|
||||||
return 200 '{ "m.server": "__SYNAPSE_DOMAIN__:443" }';
|
|
||||||
}
|
|
||||||
|
|
||||||
location /.well-known/matrix/client {
|
|
||||||
return 200 '{ "m.homeserver": { "base_url": "https://__SYNAPSE_DOMAIN__" } }';
|
|
||||||
}
|
|
||||||
|
|
||||||
location /_matrix {
|
|
||||||
proxy_pass http://127.0.0.1:8008;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_read_timeout 600;
|
|
||||||
client_max_body_size 100M;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /_synapse/admin {
|
|
||||||
proxy_pass http://127.0.0.1:8008;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_read_timeout 600;
|
|
||||||
client_max_body_size 100M;
|
|
||||||
}
|
|
||||||
|
|
|
@ -31,14 +31,17 @@
|
||||||
"type": "domain"
|
"type": "domain"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "synapse_domain",
|
"name": "synapse_app",
|
||||||
"type": "domain",
|
"type": "string",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "The domain of your Synapse server",
|
"en": "Input the Synapse app ID you wish to connect to.",
|
||||||
"fr": "Le domain de votre serveur Synapse"
|
"fr": "Entrez l'ID de l'app Synapse à laquelle vous souhaitez vous connecter."
|
||||||
},
|
},
|
||||||
"example": "synapse.example.com",
|
"help": {
|
||||||
"default": ""
|
"en": "Leave the default value if you have only one Synapse server installed.",
|
||||||
|
"fr": "Laissez la valeur par défaut si vous n'avez installé qu'un seul serveur Synapse."
|
||||||
|
},
|
||||||
|
"default": "synapse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -25,6 +25,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)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
|
synapse_app=$(ynh_app_setting_get --app=$app --key=synapse_app)
|
||||||
|
synapse_domain=$(ynh_app_setting_get --app=$app --key=synapse_domain)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -42,6 +44,7 @@ ynh_backup --src_path="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
ynh_backup --src_path="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
|
|
|
@ -23,7 +23,9 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
synapse_domain=$YNH_APP_ARG_SYNAPSE_DOMAIN
|
synapse_app=$YNH_APP_ARG_SYNAPSE_APP
|
||||||
|
synapse_domain=$(ynh_app_setting_get --app=$synapse_app --key=domain)
|
||||||
|
synapse_port=$(ynh_app_setting_get --app=$synapse_app --key=synapse_port)
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -45,7 +47,9 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
|
ynh_app_setting_set --app=$app --key=synapse_app --value=$synapse_app
|
||||||
ynh_app_setting_set --app=$app --key=synapse_domain --value=$synapse_domain
|
ynh_app_setting_set --app=$app --key=synapse_domain --value=$synapse_domain
|
||||||
|
ynh_app_setting_set --app=$app --key=synapse_port --value=$synapse_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -98,6 +102,9 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
# Create NGINX config to access /_synapse/admin endpoint
|
||||||
|
ynh_add_config --template="endpoint.nginx.conf" --destination="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#==============================================
|
#==============================================
|
||||||
|
|
|
@ -19,6 +19,8 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
synapse_app=$(ynh_app_setting_get --app=$app --key=synapse_app)
|
||||||
|
synapse_domain=$(ynh_app_setting_get --app=$synapse_app --key=synapse_domain)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -70,9 +72,13 @@ ynh_secure_remove --file="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
|
# Remove NGINX config that enabled /_synapse/admin endpoint
|
||||||
|
ynh_secure_remove --file="/etc/nginx/conf.d/${synapse_domain}.d/synapse-admin.conf"
|
||||||
|
ynh_secure_remove --file="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
synapse_domain=$(ynh_app_setting_get --app=$app --key=synapse_domain)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -42,6 +43,7 @@ test ! -d $final_path || ynh_die --message="There is already a directory: $final
|
||||||
ynh_script_progression --message="Restoring the NGINX configuration..."
|
ynh_script_progression --message="Restoring the NGINX configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
|
|
|
@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
synapse_domain=$(ynh_app_setting_get --app=$app --key=synapse_domain)
|
synapse_app=$(ynh_app_setting_get --app=$app --key=synapse_app)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -58,6 +58,18 @@ if ynh_legacy_permissions_exists; then
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If synapse_app doesn't exist, create it and assume it is `synapse`
|
||||||
|
if [ -z "$synapse_app" ]; then
|
||||||
|
synapse_app="synapse"
|
||||||
|
ynh_app_setting_set --app=$app --key=synapse_app --value=$synapse_app
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reload and store Synapse's settings, in case of they changed
|
||||||
|
synapse_domain=$(ynh_app_setting_get --app=$synapse_app --key=domain)
|
||||||
|
synapse_port=$(ynh_app_setting_get --app=$synapse_app --key=synapse_port)
|
||||||
|
ynh_app_setting_set --app=$app --key=synapse_domain --value=$synapse_domain
|
||||||
|
ynh_app_setting_set --app=$app --key=synapse_port --value=$synapse_port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -98,6 +110,9 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
# Create NGINX config to access /_synapse/admin endpoint
|
||||||
|
ynh_add_config --template="endpoint.nginx.conf" --destination="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue