mirror of
https://github.com/YunoHost-Apps/dendrite_ynh.git
synced 2024-09-03 18:25:58 +02:00
Merge pull request #14 from YunoHost-Apps/fix-go-arch
This commit is contained in:
commit
df0b5d70bc
9 changed files with 29 additions and 6 deletions
|
@ -25,6 +25,7 @@ Dendrite is a second-generation Matrix homeserver written in Go. It intends to p
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.8.5~ynh1
|
**Shipped version:** 0.8.5~ynh1
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
||||||
:warning: The upstream app is still in beta. Tread carefully.
|
:warning: The upstream app is still in beta. Tread carefully.
|
||||||
|
|
|
@ -24,7 +24,8 @@ Dendrite is a second-generation Matrix homeserver written in Go. It intends to p
|
||||||
- Scalable: can run on multiple machines and eventually scale to massive homeserver deployments.
|
- Scalable: can run on multiple machines and eventually scale to massive homeserver deployments.
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.8.5~ynh1
|
**Version incluse :** 0.8.5~ynh1
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
:warning: The upstream app is still in beta. Tread carefully.
|
:warning: The upstream app is still in beta. Tread carefully.
|
||||||
|
|
|
@ -5,11 +5,13 @@ location ~ ^/$ {
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/matrix/server {
|
location /.well-known/matrix/server {
|
||||||
|
default_type application/json;
|
||||||
return 200 '{ "m.server": "__DOMAIN__:443" }';
|
return 200 '{ "m.server": "__DOMAIN__:443" }';
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/matrix/client {
|
location /.well-known/matrix/client {
|
||||||
return 200 '{ "m.homeserver": { "base_url": "https://__DOMAIN__" } }';
|
return 200 '{ "m.homeserver": { "base_url": "https://__DOMAIN__" } }';
|
||||||
|
more_set_headers "Access-Control-Allow-Origin: *";
|
||||||
}
|
}
|
||||||
|
|
||||||
location /_matrix {
|
location /_matrix {
|
||||||
|
|
|
@ -7,7 +7,8 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__FINALPATH__/
|
||||||
ExecStart=__FINALPATH__/./bin/dendrite-monolith-server --tls-cert=/etc/yunohost/certs/__DOMAIN__/crt.pem --tls-key=/etc/yunohost/certs/__DOMAIN__/key.pem --config=dendrite.yaml --http-bind-address=:__PORT__ --https-bind-address=:__TLS_PORT__
|
Environment="__YNH_GO_LOAD_PATH__"
|
||||||
|
ExecStart=__FINALPATH__/bin/dendrite-monolith-server --tls-cert=/etc/yunohost/certs/__DOMAIN__/crt.pem --tls-key=/etc/yunohost/certs/__DOMAIN__/key.pem --config=dendrite.yaml --http-bind-address=:__PORT__ --https-bind-address=:__TLS_PORT__
|
||||||
StandardOutput=append:/var/log/__APP__/__APP__.log
|
StandardOutput=append:/var/log/__APP__/__APP__.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
|
source ynh_install_go
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -113,6 +114,9 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating systemd configuration..." --weight=1
|
ynh_script_progression --message="Updating systemd configuration..." --weight=1
|
||||||
|
|
||||||
|
# Load the Go environment path
|
||||||
|
ynh_use_go
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,15 @@ ynh_app_setting_set --app=$app --key=tls_port --value=$tls_port
|
||||||
# Open TLS port
|
# Open TLS port
|
||||||
ynh_exec_warn_less yunohost firewall allow TCP $tls_port
|
ynh_exec_warn_less yunohost firewall allow TCP $tls_port
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
|
|
||||||
|
# Create a system user
|
||||||
|
# It needs to be created before using the ynh_install_go helper
|
||||||
|
ynh_system_user_create --username=$app --use_shell --groups="ssl-cert"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -78,8 +87,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path" --groups="ssl-cert"
|
||||||
adduser $app ssl-cert
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A POSTGRESQL DATABASE
|
# CREATE A POSTGRESQL DATABASE
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
|
source ynh_install_go
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -60,6 +61,9 @@ ynh_script_progression --message="Removing the PostgreSQL database" --weight=2
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
|
# Remove Go
|
||||||
|
ynh_remove_go
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
|
source ../settings/scripts/ynh_install_go
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -58,7 +59,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path" --groups="ssl-cert"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
|
@ -114,6 +115,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
|
ynh_use_go
|
||||||
yunohost service add $app --description="Dendrite Matrix homeserver" --log="/var/log/$app/Monolith.log" --needs_exposed_ports "$tls_port"
|
yunohost service add $app --description="Dendrite Matrix homeserver" --log="/var/log/$app/Monolith.log" --needs_exposed_ports "$tls_port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -99,7 +99,7 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue