diff --git a/README.md b/README.md index e6ba6d8..d2ecae7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Dendrite is a second-generation Matrix homeserver written in Go. It intends to p **Shipped version:** 0.8.5~ynh1 + ## Disclaimers / important information :warning: The upstream app is still in beta. Tread carefully. diff --git a/README_fr.md b/README_fr.md index 70af96f..e76fa33 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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. -**Version incluse :** 0.8.5~ynh1 +**Version incluse :** 0.8.5~ynh1 + ## Avertissements / informations importantes :warning: The upstream app is still in beta. Tread carefully. diff --git a/conf/nginx.conf b/conf/nginx.conf index d192170..a591ffb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,11 +5,13 @@ location ~ ^/$ { } location /.well-known/matrix/server { + default_type application/json; return 200 '{ "m.server": "__DOMAIN__:443" }'; } location /.well-known/matrix/client { return 200 '{ "m.homeserver": { "base_url": "https://__DOMAIN__" } }'; + more_set_headers "Access-Control-Allow-Origin: *"; } location /_matrix { diff --git a/conf/systemd.service b/conf/systemd.service index 40396ee..861b72d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,8 @@ Type=simple User=__APP__ Group=__APP__ 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 StandardError=inherit diff --git a/scripts/change_url b/scripts/change_url index 2b97884..9fcbc2a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go source /usr/share/yunohost/helpers #================================================= @@ -113,6 +114,9 @@ fi #================================================= ynh_script_progression --message="Updating systemd configuration..." --weight=1 +# Load the Go environment path +ynh_use_go + # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/install b/scripts/install index 2394a3d..402f950 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,15 @@ ynh_app_setting_set --app=$app --key=tls_port --value=$tls_port # Open 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 #================================================= @@ -78,8 +87,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" -adduser $app ssl-cert +ynh_system_user_create --username=$app --home_dir="$final_path" --groups="ssl-cert" #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/remove b/scripts/remove index 090c95c..016801e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go 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 ynh_psql_remove_db --db_user=$db_user --db_name=$db_name +# Remove Go +ynh_remove_go + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index fddb741..86c1883 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,6 +8,7 @@ # 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/ynh_install_go 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 # 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 @@ -114,6 +115,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= 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" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7eb6e9b..66c2985 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,7 +99,7 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_add_nginx_config #================================================= -# UPGRADE DEPENDENCIES +# CREATE DEDICATED USER #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=1