diff --git a/README.md b/README.md index fb4ac67..acb5023 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Scuttlebutt Room for YunoHost -[![Integration level](https://dash.yunohost.org/integration/ssbroom.svg)](https://dash.yunohost.org/appci/app/ssbroom) ![](https://ci-apps.yunohost.org/ci/badges/ssbroom.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ssbroom.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/ssbroom.svg)](https://dash.yunohost.org/appci/app/ssbroom) ![Working status](https://ci-apps.yunohost.org/ci/badges/ssbroom.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/ssbroom.maintain.svg) [![Install Scuttlebutt Room with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ssbroom) *[Lire ce readme en français.](./README_fr.md)* @@ -30,13 +30,13 @@ For a comprehensive introduction to rooms 2.0, watch [this video](https://www.yo - HTTP Invites - Alias management -**Shipped version:** 2.0.6~ynh3 +**Shipped version:** 2.0.6~ynh4 **Demo:** https://hermies.club/ ## Screenshots -![](./doc/screenshots/ssbroom-screenshot.png) +![Screenshot of Scuttlebutt Room](./doc/screenshots/ssbroom-screenshot.png) ## Disclaimers / important information @@ -45,22 +45,23 @@ For a comprehensive introduction to rooms 2.0, watch [this video](https://www.yo * ssb rooms work best when the app is in public mode. ssb-room has its own user and authentication system, and doesn't need yunohost SSO ## Documentation and resources -* Official app website: https://github.com/ssb-ngi-pointer/go-ssb-room -* Official user documentation: https://github.com/ssb-ngi-pointer/go-ssb-room/blob/master/README.md -* Official admin documentation: https://github.com/ssb-ngi-pointer/go-ssb-room/blob/master/README.md -* Upstream app code repository: https://github.com/ssb-ngi-pointer/go-ssb-room -* YunoHost documentation for this app: https://yunohost.org/app_ssbroom -* Report a bug: https://github.com/YunoHost-Apps/ssbroom_ynh/issues +* Official app website: +* Official user documentation: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing --debug or sudo yunohost app upgrade ssbroom -u https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index cf614b4..32811da 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Scuttlebutt Room pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/ssbroom.svg)](https://dash.yunohost.org/appci/app/ssbroom) ![](https://ci-apps.yunohost.org/ci/badges/ssbroom.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ssbroom.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/ssbroom.svg)](https://dash.yunohost.org/appci/app/ssbroom) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/ssbroom.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/ssbroom.maintain.svg) [![Installer Scuttlebutt Room avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ssbroom) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Scuttlebutt Room 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.* @@ -26,13 +30,13 @@ For a comprehensive introduction to rooms 2.0, watch [this video](https://www.yo - HTTP Invites - Alias management -**Version incluse :** 2.0.6~ynh3 +**Version incluse :** 2.0.6~ynh4 **Démo :** https://hermies.club/ ## Captures d'écran -![](./doc/screenshots/ssbroom-screenshot.png) +![Capture d'écran de Scuttlebutt Room](./doc/screenshots/ssbroom-screenshot.png) ## Avertissements / informations importantes @@ -41,22 +45,23 @@ For a comprehensive introduction to rooms 2.0, watch [this video](https://www.yo * ssb rooms work best when the app is in public mode. ssb-room has its own user and authentication system, and doesn't need yunohost SSO ## Documentations et ressources -* Site officiel de l'app : https://github.com/ssb-ngi-pointer/go-ssb-room -* Documentation officielle utilisateur : https://github.com/ssb-ngi-pointer/go-ssb-room/blob/master/README.md -* Documentation officielle de l'admin : https://github.com/ssb-ngi-pointer/go-ssb-room/blob/master/README.md -* Dépôt de code officiel de l'app : https://github.com/ssb-ngi-pointer/go-ssb-room -* Documentation YunoHost pour cette app : https://yunohost.org/app_ssbroom -* Signaler un bug : https://github.com/YunoHost-Apps/ssbroom_ynh/issues +* Site officiel de l'app : +* Documentation officielle utilisateur : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing --debug ou sudo yunohost app upgrade ssbroom -u https://github.com/YunoHost-Apps/ssbroom_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** diff --git a/check_process b/check_process index bfdd5c8..2736616 100644 --- a/check_process +++ b/check_process @@ -1,13 +1,9 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path" - admin="john" - language="fr" is_public=1 - password="1Strong-Password" ssb_admin_id="@5Pt3dKy2HTJ0mWuS78oIiklIX0gBz6BTfEnXsbvke9c=.ed25519" - port="666" + password="1Strong-Password" ; Checks pkg_linter=1 setup_sub_dir=0 @@ -16,6 +12,12 @@ setup_private=1 setup_public=1 upgrade=1 + # 2.0.6~ynh3 + upgrade=1 from_commit=c759c5f400660031676a0f92d5c5ffcc68bd6da9 backup_restore=1 multi_instance=1 + port_already_use=0 change_url=1 +;;; Options +Email= +Notification=none diff --git a/conf/nginx.conf b/conf/nginx.conf index da0252d..a0b8a31 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,6 @@ +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_set_header Accept-Encoding ""; try_files $uri @proxy; diff --git a/conf/systemd.service b/conf/systemd.service index 2456797..8973d36 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__DATADIR__ +WorkingDirectory=__FINALPATH__/ ExecStart=__FINALPATH__/server -repo __DATADIR__/ -lishttp localhost:__PORT__ -https-domain __DOMAIN__ -lismux :__SSBPORT__ -aliases-as-subdomains false StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/manifest.json b/manifest.json index 4399451..26185ee 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "Secure Scuttlebutt room server implemented in Go" }, - "version": "2.0.6~ynh3", + "version": "2.0.6~ynh4", "url": "https://github.com/ssb-ngi-pointer/go-ssb-room", "upstream": { "license": "free", @@ -21,18 +21,25 @@ "email": "max@mfowler.info" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ "nginx" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" + }, + { + "name": "is_public", + "type": "boolean", + "default": true, + "help": { + "en": "If false, ssbroom will only be usable by yunohost users." + } }, { "name": "ssb_admin_id", @@ -45,14 +52,6 @@ }, "example": "@5Pt3dKy2HTJ0mWuS78oIiklIX0gBz6BTfEnXsbvke9c=.ed25519" }, - { - "name": "is_public", - "type": "boolean", - "default": true, - "help": { - "en": "If false, ssbroom will only be usable by yunohost users." - } - }, { "name": "password", "type": "password", diff --git a/scripts/_common.sh b/scripts/_common.sh index 24254a6..e3a9683 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -20,22 +20,3 @@ description="Secure Scuttlebutt room server implemented in Go" #================================================= # FUTURE OFFICIAL HELPERS #================================================= - - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="amd64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="386" - elif [ -n "$(uname -m | grep armv7)" ]; then - architecture="arm7" - elif [ -n "$(uname -m | grep armv6)" ]; then - architecture="arm6" - else - architecture="unknown" - fi - echo $architecture -} \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index 01326c1..67278fd 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -37,11 +36,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/change_url b/scripts/change_url index ac0de97..f6b8b78 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -37,6 +37,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" @@ -110,7 +111,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="event=serving" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 6814af3..74411c8 100755 --- a/scripts/install +++ b/scripts/install @@ -14,8 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -29,7 +28,7 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC ssb_admin_id=$YNH_APP_ARG_SSB_ADMIN_ID password=$YNH_APP_ARG_PASSWORD -architecture=$(ynh_detect_arch) + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -93,9 +92,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" +ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" -# permissions chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -105,7 +103,7 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -# add nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -118,7 +116,6 @@ ynh_app_setting_set --app=$app --key=datadir --value=$datadir mkdir -p $datadir -# permissions chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" @@ -127,6 +124,7 @@ chown -R $app:www-data "$datadir" # CREATE FIRST ADMIN USER #================================================= ynh_script_progression --message="Creating first ssbroom admin user" --weight=1 + ynh_exec_as $app /usr/bin/expect<