From 814b6a577cef0feb18d6e5e4855ca8e55e8b0f2c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 16:41:14 +0100 Subject: [PATCH 001/260] =?UTF-8?q?Initial=20release,=20first=20try?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 85 ++++++++++++++ README_fr.md | 73 ++++++++++++ conf/app.src | 7 ++ conf/nginx.conf | 9 ++ manifest.json | 71 ++++++++++++ scripts/_common.sh | 20 ++++ scripts/install | 279 +++++++++++++++++++++++++++++++++++++++++++++ scripts/remove | 138 ++++++++++++++++++++++ 8 files changed, 682 insertions(+) create mode 100644 README.md create mode 100644 README_fr.md create mode 100644 conf/app.src create mode 100644 conf/nginx.conf create mode 100644 manifest.json create mode 100644 scripts/_common.sh create mode 100644 scripts/install create mode 100644 scripts/remove diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bd8682 --- /dev/null +++ b/README.md @@ -0,0 +1,85 @@ +# Packaging an app, starting from this example + +* Copy this app before working on it, using the ['Use this template'](https://github.com/YunoHost/example_ynh/generate) button on the Github repo. +* Edit the `manifest.json` with app specific info. +* Edit the `install`, `upgrade`, `remove`, `backup` and `restore` scripts, and any relevant conf files in `conf/`. + * Using the [script helpers documentation.](https://yunohost.org/packaging_apps_helpers) +* Edit the `change_url` and `config` scripts too, or remove them if you have no use of them +* Add a `LICENSE` file for the package. NB: this LICENSE file is not meant to necessarily be the LICENSE of the upstream app - it is only the LICENSE you want this package's code to published with ;). We recommend to use [the AGPL-3](https://www.gnu.org/licenses/agpl-3.0.txt). +* Edit `doc/DISCLAIMER*.md` +* The `README.md` files are to be automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator + +--- + + +# Example app for YunoHost + +[![Integration level](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Working status](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) +[![Install Example app with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) + +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install Example app quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* + +## Overview + +Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +### Features + +- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; +- Laboris nisi ut aliquip ex ea commodo consequat ; +- Duis aute irure dolor in reprehenderit in voluptate ; +- Velit esse cillum dolore eu fugiat nulla pariatur ; +- Excepteur sint occaecat cupidatat non proident, sunt in culpa." + + +**Shipped version:** 1.0~ynh1 + +**Demo:** https://demo.example.com + +## Screenshots + +![Screenshot of Example app](./doc/screenshots/example.jpg) + +## Disclaimers / important information + +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * requiring a full dedicated domain ? + * architectures not supported ? + * not-working single-sign on or LDAP integration ? + * the app requires an important amount of RAM / disk / .. to install or to work properly + * etc... + +* Other infos that people should be aware of, such as: + * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) + * how to configure / administrate the application if it ain't obvious + * upgrade process / specificities / things to be aware of ? + * security considerations ? + +## Documentation and resources + +* 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/example_ynh/tree/testing). + +To try the testing branch, please proceed like that. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +or +sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +``` + +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..4da6fb7 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,73 @@ + + +# Exemple d'app pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) +[![Installer Example app avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Example app 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.* + +## Vue d'ensemble + +Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +### Features + +- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; +- Laboris nisi ut aliquip ex ea commodo consequat ; +- Duis aute irure dolor in reprehenderit in voluptate ; +- Velit esse cillum dolore eu fugiat nulla pariatur ; +- Excepteur sint occaecat cupidatat non proident, sunt in culpa." + + +**Version incluse :** 1.0~ynh1 + +**Démo :** https://demo.example.com + +## Captures d'écran + +![Capture d'écran de Example app](./doc/screenshots/example.jpg) + +## Avertissements / informations importantes + +* Any known limitations, constrains or stuff not working, such as (but not limited to): + * requiring a full dedicated domain ? + * architectures not supported ? + * not-working single-sign on or LDAP integration ? + * the app requires an important amount of RAM / disk / .. to install or to work properly + * etc... + +* Other infos that people should be aware of, such as: + * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) + * how to configure / administrate the application if it ain't obvious + * upgrade process / specificities / things to be aware of ? + * security considerations ? + +## Documentations et ressources + +* 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/example_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. + +``` bash +sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +ou +sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** diff --git a/conf/app.src b/conf/app.src new file mode 100644 index 0000000..bd81e79 --- /dev/null +++ b/conf/app.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/lapineige/bonfire-app/archive/refs/tags/test.tar.gz +SOURCE_SUM=18284881e09633f79a08ac4c66b35baf45354270084b3952ef440a0ffd1e906b +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..9782b91 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,9 @@ +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { + + # Path to source + alias __FINALPATH__/; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d6346c0 --- /dev/null +++ b/manifest.json @@ -0,0 +1,71 @@ +{ + "name": "Bonfire", + "id": "bonfire", + "packaging_format": 1, + "description": { + "en": "Federated social networking server built on ActivityPub open protocol", + "fr": "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" + }, + "version": "0.1~ynh1", + "url": "https://example.com", + "upstream": { + "license": "GNU Affero General Public License v3.0", + "website": "https://bonfirenetworks.org/", + "demo": "https://playground.bonfire.cafe/", + "admindoc": "https://bonfirenetworks.org/docs/", + "userdoc": "https://bonfirenetworks.org/docs/", + "code": "https://github.com/bonfire-networks/bonfire-app" + }, + "license": "free", + "maintainer": { + "name": "Lapineige", + }, + "requirements": { + "yunohost": ">= 11.0.0" + }, + "multi_instance": true, + "services": [ + "nginx", + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain" + }, + { + "name": "path", + "type": "path", + "example": "/example", + "default": "/" + }, + { + "name": "is_public", + "type": "boolean", + "default": true + }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["fr", "en"], + "default": "fr" + }, + { + "name": "admin", + "type": "user", + "help": { + "en": "Name of the account that will have admin rights on this instance.", + "fr": "Le nom du compte qui aura les droits d'administration sur l'instance." + } + }, + { + "name": "password", + "type": "password", + } + ] + } +} diff --git a/scripts/_common.sh b/scripts/_common.sh new file mode 100644 index 0000000..7148ffa --- /dev/null +++ b/scripts/_common.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app (must be on a single line) +pkg_dependencies="postgresql postgresql-contrib" + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/install b/scripts/install new file mode 100644 index 0000000..90a7717 --- /dev/null +++ b/scripts/install @@ -0,0 +1,279 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# RETRIEVE ARGUMENTS FROM THE MANIFEST +#================================================= + +domain=$YNH_APP_ARG_DOMAIN +path_url=$YNH_APP_ARG_PATH +is_public=$YNH_APP_ARG_IS_PUBLIC +language=$YNH_APP_ARG_LANGUAGE +admin=$YNH_APP_ARG_ADMIN +password=$YNH_APP_ARG_PASSWORD + +### If it's a multi-instance app, meaning it can be installed several times independently +### The id of the app as stated in the manifest is available as $YNH_APP_ID +### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) +### The app instance name is available as $YNH_APP_INSTANCE_NAME +### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample +### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 +### - ynhexample__{N} for the subsequent installations, with N=3,4... +### The app instance name is probably what interests you most, since this is +### guaranteed to be unique. This is a good unique identifier to define installation path, +### db names... +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS +#================================================= +### About --weight and --time +### ynh_script_progression will show to your final users the progression of each scripts. +### In order to do that, --weight will represent the relative time of execution compared to the other steps in the script. +### --time is a packager option, it will show you the execution time since the previous call. +### This option is implied when running in CI_package_check, you can manually add it if you are manually testing the app. +### Use the execution time displayed in the CI report or by adding --time to the command, to estimate the weight of a step. +### A common way to do it is to set a weight equal to the execution time in second +1. +### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. +ynh_script_progression --message="Validating installation parameters..." --weight=1 + +### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". +### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" +final_path=/var/www/$app +test ! -e "$final_path" || ynh_die --message="This path already contains a folder" + +# Register (book) web path +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url + +#================================================= +# STORE SETTINGS FROM MANIFEST +#================================================= +ynh_script_progression --message="Storing installation settings..." --weight=1 + +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=language --value=$language +ynh_app_setting_set --app=$app --key=admin --value=$admin + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# FIND AND OPEN A PORT +#================================================= +ynh_script_progression --message="Finding an available port..." --weight=1 + +### Use these lines if you have to open a port for the application +### `ynh_find_port` will find the first available port starting from the given port. +### If you're not using these lines: +### - Remove the section "CLOSE A PORT" in the remove script + +# Find an available port +port=$(ynh_find_port --port=8095) +ynh_app_setting_set --app=$app --key=port --value=$port + +# Optional: Expose this port publicly +# (N.B.: you only need to do this if the app actually needs to expose the port publicly. +# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) + +# Open the port +# ynh_script_progression --message="Configuring firewall..." --weight=1 +# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. +### Those deb packages will be installed as dependencies of this package. +### If you're not using this helper: +### - Remove the section "REMOVE DEPENDENCIES" in the remove script +### - Remove the variable "pkg_dependencies" in _common.sh +### - As well as the section "REINSTALL DEPENDENCIES" in the restore script +### - And the section "UPGRADE DEPENDENCIES" in the upgrade script + +ynh_install_app_dependencies $pkg_dependencies + +# FIXME: We need a better way to do this +ynh_script_progression --message="Installing extra dependencies…" --weight=1 + +ynh_exec_warn_less curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null +ynh_exec_warn_less echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list +ynh_exec_warn_less apt update +ynh_exec_warn_less apt install just + +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + +#================================================= +# CREATE A POSTGRESQL DATABASE +#================================================= +ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 + +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name +ynh_app_setting_set --app=$app --key=db_name --value=$db_name +ynh_psql_test_if_first_run +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name +ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database=$db_name + +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 + +### `ynh_setup_source` is used to install an app from a zip or tar.gz file, +### downloaded from an upstream source, like a git repository. +### `ynh_setup_source` use the file conf/app.src + +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" + +# FIXME: this should be managed by the core in the future +# Here, as a packager, you may have to tweak the ownerhsip/permissions +# such that the appropriate users (e.g. maybe www-data) can access +# files in some cases. +# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - +# this will be treated as a security issue. +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 + +### `ynh_add_nginx_config` will use the file conf/nginx.conf + +# Create a dedicated NGINX config +ynh_add_nginx_config + +#================================================= +# SPECIFIC SETUP +#================================================= +# Configuration files +#================================================= + +config="$final_path/.config" +env_file="$final_path/.env" + +export MIX_ENV=prod FLAVOUR=classic + +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just config +# generate secrets +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just secrets + +ynh_replace_string --match_string="HOSTNAME=localhost" --replace_string="HOSTNAME=$domain" --target_file="$env_file" +# TODO : mail service ? +ynh_replace_string --match_string="SERVER_PORT=4000" --replace_string="SERVER_PORT^=$port" --target_file="$env_file" +ynh_replace_string --match_string="PUBLIC_PORT=4000" --replace_string="PUBLIC_PORT=443" --target_file="$env_file" +ynh_replace_string --match_string="" --replace_string="" --target_file="$env_file" +# TODO : Configure S3 - with proper Yunohost question during installation + +#================================================= +# Configure the release +#================================================= +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix deps.get --only prod + +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just js-deps-get +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just assets-prepare +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix phx.digest + +# create an elexir release +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release + +#================================================= +# Run the release +#================================================= +release_folder="$final_path/_build/prod/rel/bonfire/" + +# Database created before, let's run the migrations +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" + +# start bonfire as a daemon +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire start daemon" + +#================================================= +# GENERIC FINALIZATION +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 + +### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app. +### Use this helper only if there is effectively a log file for this app. +### If you're not using this helper: +### - Remove the section "BACKUP LOGROTATE" in the backup script +### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script +### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script +### - And the section "SETUP LOGROTATE" in the upgrade script + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +#================================================= +# SETUP FAIL2BAN +#================================================= +ynh_script_progression --message="Configuring Fail2Ban..." --weight=1 + +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" + +#================================================= +# SETUP SSOWAT +#================================================= +ynh_script_progression --message="Configuring permissions..." --weight=1 + +# Make app public if necessary +if [ $is_public -eq 1 ] +then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" +fi + +### N.B. : the following extra permissions only make sense if your app +### does have for example an admin interface or an API. + +# Only the admin can access the admin panel of the app (if the app has an admin panel) +ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin + +# Everyone can access the API part +# We don't want to display the tile in the SSO so we put --show_tile="false" +# And we don't want the YunoHost admin to be able to remove visitors group to this permission, so we put --protected="true" +ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove new file mode 100644 index 0000000..f4c45c6 --- /dev/null +++ b/scripts/remove @@ -0,0 +1,138 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +app=$YNH_APP_INSTANCE_NAME + +domain=$(ynh_app_setting_get --app=$app --key=domain) +port=$(ynh_app_setting_get --app=$app --key=port) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) + + +#================================================= +# REMOVE DEDICATED USER +#================================================= +ynh_script_progression --message="Stop Bonfire..." --weight=1 + +# start bonfire as a daemon +"$release_folder/bin/bonfire stop" + +#================================================= +# STANDARD REMOVE +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + + +#================================================= +# REMOVE THE POSTGRESQL DATABASE +#================================================= +ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 + +# Remove a database if it exists, along with the associated user +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name + +#================================================= +# REMOVE APP MAIN DIR +#================================================= +ynh_script_progression --message="Removing app main directory..." --weight=1 + +# Remove the app directory securely +ynh_secure_remove --file="$final_path" + +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_secure_remove --file="$datadir" +fi + +#================================================= +# REMOVE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 + +# Remove the dedicated NGINX config +ynh_remove_nginx_config + +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + ynh_script_progression --message="Closing port $port..." --weight=1 + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + +#================================================= +# REMOVE FAIL2BAN CONFIGURATION +#================================================= +ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1 + +# Remove the dedicated Fail2Ban config +ynh_remove_fail2ban_config + +#================================================= +# SPECIFIC REMOVE +#================================================= +# REMOVE VARIOUS FILES +#================================================= +ynh_script_progression --message="Removing various files..." --weight=1 + +# Remove a cron file +ynh_secure_remove --file="/etc/cron.d/$app" + +# Remove a directory securely +ynh_secure_remove --file="/etc/$app" + +# Remove the log files +ynh_secure_remove --file="/var/log/$app" + +#================================================= +# GENERIC FINALIZATION +#================================================= +# REMOVE DEDICATED USER +#================================================= + +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 + +# Delete a system user +ynh_system_user_delete --username=$app + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Removal of $app completed" --last From a7f21ba17adaec233bf0ca984c92e15a837c7b53 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 17:14:37 +0100 Subject: [PATCH 002/260] typo --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d6346c0..5c8c995 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,7 @@ }, "license": "free", "maintainer": { - "name": "Lapineige", + "name": "Lapineige" }, "requirements": { "yunohost": ">= 11.0.0" From db0d70a9af18f984db86a92bf96db3a3c96cdc6f Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 17:19:02 +0100 Subject: [PATCH 003/260] typo --- manifest.json | 141 ++++++++++++++++++++++++++------------------------ 1 file changed, 72 insertions(+), 69 deletions(-) diff --git a/manifest.json b/manifest.json index 5c8c995..4b15de8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,71 +1,74 @@ { - "name": "Bonfire", - "id": "bonfire", - "packaging_format": 1, - "description": { - "en": "Federated social networking server built on ActivityPub open protocol", - "fr": "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" - }, - "version": "0.1~ynh1", - "url": "https://example.com", - "upstream": { - "license": "GNU Affero General Public License v3.0", - "website": "https://bonfirenetworks.org/", - "demo": "https://playground.bonfire.cafe/", - "admindoc": "https://bonfirenetworks.org/docs/", - "userdoc": "https://bonfirenetworks.org/docs/", - "code": "https://github.com/bonfire-networks/bonfire-app" - }, - "license": "free", - "maintainer": { - "name": "Lapineige" - }, - "requirements": { - "yunohost": ">= 11.0.0" - }, - "multi_instance": true, - "services": [ - "nginx", - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/example", - "default": "/" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": ["fr", "en"], - "default": "fr" - }, - { - "name": "admin", - "type": "user", - "help": { - "en": "Name of the account that will have admin rights on this instance.", - "fr": "Le nom du compte qui aura les droits d'administration sur l'instance." - } - }, - { - "name": "password", - "type": "password", - } - ] - } + "name": "Bonfire", + "id": "bonfire", + "packaging_format": 1, + "description": { + "en": "Federated social networking server built on ActivityPub open protocol", + "fr": "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" + }, + "version": "0.1~ynh1", + "url": "https://example.com", + "upstream": { + "license": "GNU Affero General Public License v3.0", + "website": "https://bonfirenetworks.org/", + "demo": "https://playground.bonfire.cafe/", + "admindoc": "https://bonfirenetworks.org/docs/", + "userdoc": "https://bonfirenetworks.org/docs/", + "code": "https://github.com/bonfire-networks/bonfire-app" + }, + "license": "free", + "maintainer": { + "name": "Lapineige" + }, + "requirements": { + "yunohost": ">= 11.0.0" + }, + "multi_instance": true, + "services": [ + "nginx" + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain" + }, + { + "name": "path", + "type": "path", + "example": "/example", + "default": "/" + }, + { + "name": "is_public", + "type": "boolean", + "default": true + }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": [ + "fr", + "en" + ], + "default": "fr" + }, + { + "name": "admin", + "type": "user", + "help": { + "en": "Name of the account that will have admin rights on this instance.", + "fr": "Le nom du compte qui aura les droits d'administration sur l'instance." + } + }, + { + "name": "password", + "type": "password" + } + ] + } } From 3b99b35f48a1cc06b36b84c792676d65464dbe53 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 14 Jan 2023 16:19:04 +0000 Subject: [PATCH 004/260] Auto-update README --- README.md | 73 ++++++++++++---------------------------------------- README_fr.md | 61 ++++++++++++------------------------------- 2 files changed, 32 insertions(+), 102 deletions(-) diff --git a/README.md b/README.md index 5bd8682..c19e465 100644 --- a/README.md +++ b/README.md @@ -1,85 +1,44 @@ -# Packaging an app, starting from this example - -* Copy this app before working on it, using the ['Use this template'](https://github.com/YunoHost/example_ynh/generate) button on the Github repo. -* Edit the `manifest.json` with app specific info. -* Edit the `install`, `upgrade`, `remove`, `backup` and `restore` scripts, and any relevant conf files in `conf/`. - * Using the [script helpers documentation.](https://yunohost.org/packaging_apps_helpers) -* Edit the `change_url` and `config` scripts too, or remove them if you have no use of them -* Add a `LICENSE` file for the package. NB: this LICENSE file is not meant to necessarily be the LICENSE of the upstream app - it is only the LICENSE you want this package's code to published with ;). We recommend to use [the AGPL-3](https://www.gnu.org/licenses/agpl-3.0.txt). -* Edit `doc/DISCLAIMER*.md` -* The `README.md` files are to be automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator - ---- -# Example app for YunoHost +# Bonfire for YunoHost -[![Integration level](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Working status](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) -[![Install Example app with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) +[![Integration level](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Working status](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) +[![Install Bonfire with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Example app quickly and simply on a YunoHost server. +> *This package allows you to install Bonfire quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Federated social networking server built on ActivityPub open protocol -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - - -**Shipped version:** 1.0~ynh1 - -**Demo:** https://demo.example.com - -## Screenshots - -![Screenshot of Example app](./doc/screenshots/example.jpg) - -## Disclaimers / important information - -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... - -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? +**Shipped version:** 0.1~ynh1 +**Demo:** https://playground.bonfire.cafe/ ## Documentation and resources -* Official app website: -* Official user documentation: -* Official admin documentation: -* Upstream app code repository: -* YunoHost documentation for this app: -* Report a bug: +* 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/example_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing). To try the testing branch, please proceed like that. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing --debug or -sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app upgrade bonfire -u https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing --debug ``` **More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 4da6fb7..d4c5167 100644 --- a/README_fr.md +++ b/README_fr.md @@ -3,71 +3,42 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app It shall NOT be edited by hand. --> -# Exemple d'app pour YunoHost +# Bonfire pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) -[![Installer Example app avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) +[![Niveau d'intégration](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) +[![Installer Bonfire avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Example app rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d'installer Bonfire 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.* ## Vue d'ensemble -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - - -**Version incluse :** 1.0~ynh1 - -**Démo :** https://demo.example.com - -## Captures d'écran - -![Capture d'écran de Example app](./doc/screenshots/example.jpg) - -## Avertissements / informations importantes - -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... - -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? +**Version incluse :** 0.1~ynh1 +**Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources -* 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 : +* 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/example_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing --debug ou -sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app upgrade bonfire -u https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing --debug ``` **Plus d'infos sur le packaging d'applications :** From f6b7c160da370cbed2888a08a7ad116606a5c4cf Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 17:38:24 +0100 Subject: [PATCH 005/260] Proper external repository use - helpers, not apt --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 90a7717..b44b3f0 100644 --- a/scripts/install +++ b/scripts/install @@ -112,9 +112,7 @@ ynh_install_app_dependencies $pkg_dependencies # FIXME: We need a better way to do this ynh_script_progression --message="Installing extra dependencies…" --weight=1 -ynh_exec_warn_less curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null -ynh_exec_warn_less echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list -ynh_exec_warn_less apt update +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org/feeds/prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" ynh_exec_warn_less apt install just #================================================= From 14b4aae7d341e420c98ec6afa1b5196b4a271d84 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 17:38:42 +0100 Subject: [PATCH 006/260] Remove doubles --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index b44b3f0..3d3878b 100644 --- a/scripts/install +++ b/scripts/install @@ -113,7 +113,6 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Installing extra dependencies…" --weight=1 ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org/feeds/prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" -ynh_exec_warn_less apt install just #================================================= # CREATE DEDICATED USER From 0d756b57e0ec3093c2e7e15b4b7c1cf0d15fa32e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 17:40:01 +0100 Subject: [PATCH 007/260] Just executable rights --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 3d3878b..70c9229 100644 --- a/scripts/install +++ b/scripts/install @@ -178,9 +178,9 @@ env_file="$final_path/.env" export MIX_ENV=prod FLAVOUR=classic -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just config +ynh_exec_warn_less just config # generate secrets -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just secrets +ynh_exec_warn_less just secrets ynh_replace_string --match_string="HOSTNAME=localhost" --replace_string="HOSTNAME=$domain" --target_file="$env_file" # TODO : mail service ? @@ -194,8 +194,8 @@ ynh_replace_string --match_string="" --replace_string="" --target_file="$env_fil #================================================= ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix deps.get --only prod -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just js-deps-get -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just assets-prepare +ynh_exec_warn_less just js-deps-get +ynh_exec_warn_less just assets-prepare ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix phx.digest # create an elexir release From b4681df6d85b0520c50b86886cb292ae0d2308cd Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 18:44:49 +0100 Subject: [PATCH 008/260] fix prebuild-mpr --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 70c9229..1781f67 100644 --- a/scripts/install +++ b/scripts/install @@ -112,7 +112,7 @@ ynh_install_app_dependencies $pkg_dependencies # FIXME: We need a better way to do this ynh_script_progression --message="Installing extra dependencies…" --weight=1 -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org/feeds/prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org/debian-feeds/prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" #================================================= # CREATE DEDICATED USER From aa3c0b7257b6279c4c83b3ffc094afd34c2f89f6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 19:23:54 +0100 Subject: [PATCH 009/260] =?UTF-8?q?another=20try=20with=20prebuilt-mpr?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1781f67..8840e92 100644 --- a/scripts/install +++ b/scripts/install @@ -112,7 +112,7 @@ ynh_install_app_dependencies $pkg_dependencies # FIXME: We need a better way to do this ynh_script_progression --message="Installing extra dependencies…" --weight=1 -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org/debian-feeds/prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" #================================================= # CREATE DEDICATED USER From f60b68e709b41bc0b0ce7cfc3e0f7363b33ba6e8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 14 Jan 2023 19:34:17 +0100 Subject: [PATCH 010/260] =?UTF-8?q?yet=20another=20try=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 8840e92..c955a5e 100644 --- a/scripts/install +++ b/scripts/install @@ -112,7 +112,7 @@ ynh_install_app_dependencies $pkg_dependencies # FIXME: We need a better way to do this ynh_script_progression --message="Installing extra dependencies…" --weight=1 -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" #================================================= # CREATE DEDICATED USER From 3c1591adafdb36d1c65c334074beb3b013407c62 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 12:32:32 +0100 Subject: [PATCH 011/260] v0.4.0-beta.43 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index bd81e79..096ece1 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/lapineige/bonfire-app/archive/refs/tags/test.tar.gz -SOURCE_SUM=18284881e09633f79a08ac4c66b35baf45354270084b3952ef440a0ffd1e906b +SOURCE_URL=https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.4.0-beta.43.tar.gz +SOURCE_SUM=0c1b78f153c67e3b56f91a72a013e854bd87a03fbacdf3846ed1ab10a5d21a0f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From de35ef028b6d25b5ed647dbe1dacf5b3aa2fb7de Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 5 Feb 2023 11:32:34 +0000 Subject: [PATCH 012/260] Auto-update README --- README.md | 2 +- README_fr.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c19e465..87c5c72 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Bonfire for YunoHost -[![Integration level](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Working status](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Working status](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) [![Install Bonfire with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index d4c5167..1017656 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,15 @@ It shall NOT be edited by hand. # Bonfire pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) [![Installer Bonfire avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Bonfire 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.* +> *Ce package vous permet d’installer Bonfire 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.* -## Vue d'ensemble +## Vue d’ensemble Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub @@ -22,10 +22,10 @@ Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPu **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources -* Site officiel de l'app : +* Site officiel de l’app : * Documentation officielle utilisateur : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -41,4 +41,4 @@ ou sudo yunohost app upgrade bonfire -u https://github.com/YunoHost-Apps/bonfire_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From a42f8b6b53b79d54874e7003e09dbcfc99c2fcf6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:06:51 +0100 Subject: [PATCH 013/260] just is not needed --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index c955a5e..76f07e8 100644 --- a/scripts/install +++ b/scripts/install @@ -112,8 +112,6 @@ ynh_install_app_dependencies $pkg_dependencies # FIXME: We need a better way to do this ynh_script_progression --message="Installing extra dependencies…" --weight=1 -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org" --package="just" --key="https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" - #================================================= # CREATE DEDICATED USER #================================================= From bc8de61cc4d6f9db447bb62381a3a00a38bb6125 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:08:05 +0100 Subject: [PATCH 014/260] cleanup --- scripts/install | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 76f07e8..2e0a417 100644 --- a/scripts/install +++ b/scripts/install @@ -99,18 +99,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=1 -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - Remove the variable "pkg_dependencies" in _common.sh -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - ynh_install_app_dependencies $pkg_dependencies -# FIXME: We need a better way to do this -ynh_script_progression --message="Installing extra dependencies…" --weight=1 +# ynh_script_progression --message="Installing extra dependencies…" --weight=1 #================================================= # CREATE DEDICATED USER From f937d30d38690a9595ce38501c8a8bb01211ad7d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:20:36 +0100 Subject: [PATCH 015/260] Generate secrets + add S3 template (for later use) --- scripts/install | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 2e0a417..6166062 100644 --- a/scripts/install +++ b/scripts/install @@ -169,14 +169,21 @@ export MIX_ENV=prod FLAVOUR=classic ynh_exec_warn_less just config # generate secrets -ynh_exec_warn_less just secrets +ynh_replace_string --match_string="SECRET_KEY_BASE=you-should-put-a-secure-string-here" --replace_string="SECRET_KEY_BASE=$(openssl rand -base64 128)" --target_file="$env_file" +ynh_replace_string --match_string="SIGNING_SALT=you-should-put-a-different-secure-string-here" --replace_string="SIGNING_SALT=$(openssl rand -base64 128)" --target_file="$env_file" +ynh_replace_string --match_string="ENCRYPTION_SALT=you-should-put-yet-another-secure-string-here" --replace_string="ENCRYPTION_SALT=$(openssl rand -base64 128)" --target_file="$env_file" +# Configure server ports ynh_replace_string --match_string="HOSTNAME=localhost" --replace_string="HOSTNAME=$domain" --target_file="$env_file" # TODO : mail service ? ynh_replace_string --match_string="SERVER_PORT=4000" --replace_string="SERVER_PORT^=$port" --target_file="$env_file" ynh_replace_string --match_string="PUBLIC_PORT=4000" --replace_string="PUBLIC_PORT=443" --target_file="$env_file" -ynh_replace_string --match_string="" --replace_string="" --target_file="$env_file" + # TODO : Configure S3 - with proper Yunohost question during installation +# UPLOADS_S3_BUCKET= +# UPLOADS_S3_ACCESS_KEY_ID= +# UPLOADS_S3_SECRET_ACCESS_KEY= + #================================================= # Configure the release From ec1889c5bd0819885566cbf4c83eb32c50936c1e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:32:09 +0100 Subject: [PATCH 016/260] Add media upload size parameter --- manifest.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/manifest.json b/manifest.json index 4b15de8..14ff537 100644 --- a/manifest.json +++ b/manifest.json @@ -68,6 +68,27 @@ { "name": "password", "type": "password" + }, + { + "name": "media_upload_size", + "type": "string", + "help": { + "en": "Maximum size of the media uploaded. Can be changed later.", + "fr": "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." + }, + "choices": [ + "1MB", + "2MB", + "5MB", + "10MB", + "15MB", + "20MB", + "35MB", + "50MB", + "100MB", + "150MB" + ], + "default": "20MB" } ] } From aee7ce95a04d314f8758f95a0fb8069a37fa5980 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:35:59 +0100 Subject: [PATCH 017/260] Add media upload size parameter --- scripts/install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6166062..7f96e3d 100644 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,8 @@ language=$YNH_APP_ARG_LANGUAGE admin=$YNH_APP_ARG_ADMIN password=$YNH_APP_ARG_PASSWORD +media_upload_size=$YNH_APP_ARG_MEDIA_UPLOAD_SIZE + ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID ### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) @@ -49,7 +51,7 @@ app=$YNH_APP_INSTANCE_NAME ### This option is implied when running in CI_package_check, you can manually add it if you are manually testing the app. ### Use the execution time displayed in the CI report or by adding --time to the command, to estimate the weight of a step. ### A common way to do it is to set a weight equal to the execution time in second +1. -### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. +### The execution time is given for the durationt since the previous call. So the weight should be applied to this previous call. ynh_script_progression --message="Validating installation parameters..." --weight=1 ### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". @@ -69,6 +71,7 @@ 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=language --value=$language ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=media_upload_size --value=$media_upload_size #================================================= # STANDARD MODIFICATIONS @@ -184,6 +187,8 @@ ynh_replace_string --match_string="PUBLIC_PORT=4000" --replace_string="PUBLIC_PO # UPLOADS_S3_ACCESS_KEY_ID= # UPLOADS_S3_SECRET_ACCESS_KEY= +# max file upload size +UPLOAD_LIMIT="${media_upload_size:0:2}000000" # convert the MB argument in bytes #================================================= # Configure the release From 7d76f8424f6ad71e918d67d1842f9493143ed6eb Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:38:14 +0100 Subject: [PATCH 018/260] packing format v2 : switch from json to toml --- manifest.json | 95 --------------------------------------------------- manifest.toml | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 95 deletions(-) delete mode 100644 manifest.json create mode 100644 manifest.toml diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 14ff537..0000000 --- a/manifest.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "name": "Bonfire", - "id": "bonfire", - "packaging_format": 1, - "description": { - "en": "Federated social networking server built on ActivityPub open protocol", - "fr": "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" - }, - "version": "0.1~ynh1", - "url": "https://example.com", - "upstream": { - "license": "GNU Affero General Public License v3.0", - "website": "https://bonfirenetworks.org/", - "demo": "https://playground.bonfire.cafe/", - "admindoc": "https://bonfirenetworks.org/docs/", - "userdoc": "https://bonfirenetworks.org/docs/", - "code": "https://github.com/bonfire-networks/bonfire-app" - }, - "license": "free", - "maintainer": { - "name": "Lapineige" - }, - "requirements": { - "yunohost": ">= 11.0.0" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/example", - "default": "/" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": [ - "fr", - "en" - ], - "default": "fr" - }, - { - "name": "admin", - "type": "user", - "help": { - "en": "Name of the account that will have admin rights on this instance.", - "fr": "Le nom du compte qui aura les droits d'administration sur l'instance." - } - }, - { - "name": "password", - "type": "password" - }, - { - "name": "media_upload_size", - "type": "string", - "help": { - "en": "Maximum size of the media uploaded. Can be changed later.", - "fr": "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." - }, - "choices": [ - "1MB", - "2MB", - "5MB", - "10MB", - "15MB", - "20MB", - "35MB", - "50MB", - "100MB", - "150MB" - ], - "default": "20MB" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..e716580 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,87 @@ +packaging_format = 2 + +name = "Bonfire" +id = "bonfire" +packaging_format = 1 +version = "0.1~ynh1" +url = "https://example.com" +license = "free" +multi_instance = true +services = [ "nginx" ] + +[description] +en = "Federated social networking server built on ActivityPub open protocol" +fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" + +[upstream] +license = "GNU Affero General Public License v3.0" +website = "https://bonfirenetworks.org/" +demo = "https://playground.bonfire.cafe/" +admindoc = "https://bonfirenetworks.org/docs/" +userdoc = "https://bonfirenetworks.org/docs/" +code = "https://github.com/bonfire-networks/bonfire-app" + +[maintainer] +name = "Lapineige" + +[requirements] +yunohost = ">= 11.0.0" + +[[arguments.install]] +name = "domain" +type = "domain" + +[[arguments.install]] +name = "path" +type = "path" +example = "/example" +default = "/" + +[[arguments.install]] +name = "is_public" +type = "boolean" +default = true + +[[arguments.install]] +name = "language" +type = "string" +choices = [ "fr", "en" ] +default = "fr" + + [arguments.install.ask] + en = "Choose the application language" + fr = "Choisissez la langue de l'application" + +[[arguments.install]] +name = "admin" +type = "user" + + [arguments.install.help] + en = "Name of the account that will have admin rights on this instance." + fr = "Le nom du compte qui aura les droits d'administration sur l'instance." + +[[arguments.install]] +name = "password" +type = "password" + +[[arguments.install]] +name = "media_upload_size" +type = "string" +choices = [ + "1MB", + "2MB", + "5MB", + "10MB", + "15MB", + "20MB", + "35MB", + "50MB", + "100MB", + "150MB" +] +default = "20MB" + + [arguments.install.help] + en = "Maximum size of the media uploaded. Can be changed later." + fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." + From b234ae78ecaa47dac2a921235297f13d41774308 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:38:50 +0100 Subject: [PATCH 019/260] Fix indentation --- manifest.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.toml b/manifest.toml index e716580..e75b510 100644 --- a/manifest.toml +++ b/manifest.toml @@ -48,17 +48,17 @@ type = "string" choices = [ "fr", "en" ] default = "fr" - [arguments.install.ask] - en = "Choose the application language" - fr = "Choisissez la langue de l'application" +[arguments.install.ask] +en = "Choose the application language" +fr = "Choisissez la langue de l'application" [[arguments.install]] name = "admin" type = "user" - [arguments.install.help] - en = "Name of the account that will have admin rights on this instance." - fr = "Le nom du compte qui aura les droits d'administration sur l'instance." +[arguments.install.help] +en = "Name of the account that will have admin rights on this instance." +fr = "Le nom du compte qui aura les droits d'administration sur l'instance." [[arguments.install]] name = "password" @@ -81,7 +81,7 @@ choices = [ ] default = "20MB" - [arguments.install.help] - en = "Maximum size of the media uploaded. Can be changed later." - fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." +[arguments.install.help] +en = "Maximum size of the media uploaded. Can be changed later." +fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." From 178066d20cd83100d31a44a4550bff55668a1756 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:47:18 +0100 Subject: [PATCH 020/260] cleanup packing format --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e75b510..323b232 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,7 +2,6 @@ packaging_format = 2 name = "Bonfire" id = "bonfire" -packaging_format = 1 version = "0.1~ynh1" url = "https://example.com" license = "free" From dde9c56854a59576dd64c99ff5b8176f01c84d6a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 13:59:00 +0100 Subject: [PATCH 021/260] Fix syntax + reordering + fix indentation + packaging v2 features --- manifest.toml | 119 +++++++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/manifest.toml b/manifest.toml index 323b232..8b9049a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -8,6 +8,9 @@ license = "free" multi_instance = true services = [ "nginx" ] + +maintainers = ["Lapineige"] + [description] en = "Federated social networking server built on ActivityPub open protocol" fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" @@ -20,67 +23,75 @@ admindoc = "https://bonfirenetworks.org/docs/" userdoc = "https://bonfirenetworks.org/docs/" code = "https://github.com/bonfire-networks/bonfire-app" -[maintainer] -name = "Lapineige" -[requirements] +[integration] yunohost = ">= 11.0.0" +multi_instance = false -[[arguments.install]] -name = "domain" -type = "domain" +[install] + [install.domain] + type = "domain" + help.en = "The domain name to use. Bonfire will be installed at its root path (/). This can't be changed." + help.fr = "Nom de domaine à utiliser. Bonfire sera installé à sa racine (/). Cela ne pourra pas être changé." -[[arguments.install]] -name = "path" -type = "path" -example = "/example" -default = "/" + [install.is_public] + type = "boolean" + default = true + help.en = "Should that instance be visible to the fediverse ? It is required for federation." + help.fr = "Cette instance doit elle être visible sur le fédiverse? C'est nécessaire pour la fédération." -[[arguments.install]] -name = "is_public" -type = "boolean" -default = true + [install.init_main_permission] + # this is a generic question - ask strings are automatically handled by YunoHost's core + # This won't be saved as setting and will instead be used to initialize the SSOwat permission + type = "group" + default = "visitors" -[[arguments.install]] -name = "language" -type = "string" -choices = [ "fr", "en" ] -default = "fr" + [install.domain] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["fr", "en"] + default = "fr" -[arguments.install.ask] -en = "Choose the application language" -fr = "Choisissez la langue de l'application" -[[arguments.install]] -name = "admin" -type = "user" + [install.admin] + # this is a generic question - ask strings are automatically handled by YunoHost's core + type = "user" -[arguments.install.help] -en = "Name of the account that will have admin rights on this instance." -fr = "Le nom du compte qui aura les droits d'administration sur l'instance." - -[[arguments.install]] -name = "password" -type = "password" - -[[arguments.install]] -name = "media_upload_size" -type = "string" -choices = [ - "1MB", - "2MB", - "5MB", - "10MB", - "15MB", - "20MB", - "35MB", - "50MB", - "100MB", - "150MB" -] -default = "20MB" - -[arguments.install.help] -en = "Maximum size of the media uploaded. Can be changed later." -fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." + [install.password] + # this is a generic question - ask strings are automatically handled by YunoHost's core + # Note that user-provided passwords questions are not automatically saved as setting + help.en = "Use the help field to add an information for the admin about this question." + help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + type = "password" + + [install.media_upload_size] + type = "string" + choices = [ + "1MB", + "2MB", + "5MB", + "10MB", + "15MB", + "20MB", + "35MB", + "50MB", + "100MB", + "150MB" + ] + default = "20MB" + ask.en = "Maximum size of the media uploaded. Can be changed later." + ask.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." +[resources] + [resources.data_dir] + # This will create/remove the data dir as /home/yunohost.app/$app + # and store the corresponding setting $data_dir + #TODO + + [resources.ports] + # This will pick a random port for reverse-proxying and store it as the $port setting + + [resources.database] + # This will automatically provision/deprovison a mysql DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd + type = "postgresql" From f4e655c054e3cd8b2508973f4befc7a025d76c60 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 14:00:06 +0100 Subject: [PATCH 022/260] postgresql generate by packaging v2 --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 7f96e3d..f7ec441 100644 --- a/scripts/install +++ b/scripts/install @@ -122,8 +122,6 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database=$db_name #================================================= From 0b78c83239ee5b94a940780de43e351e087796aa Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 14:06:18 +0100 Subject: [PATCH 023/260] fix domain double + indentation --- manifest.toml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8b9049a..a26f776 100644 --- a/manifest.toml +++ b/manifest.toml @@ -31,14 +31,14 @@ multi_instance = false [install] [install.domain] type = "domain" - help.en = "The domain name to use. Bonfire will be installed at its root path (/). This can't be changed." - help.fr = "Nom de domaine à utiliser. Bonfire sera installé à sa racine (/). Cela ne pourra pas être changé." + ask.en = "The domain name to use. Bonfire will be installed at its root path (/). This can't be changed." + ask.fr = "Nom de domaine à utiliser. Bonfire sera installé à sa racine (/). Cela ne pourra pas être changé." [install.is_public] - type = "boolean" - default = true - help.en = "Should that instance be visible to the fediverse ? It is required for federation." - help.fr = "Cette instance doit elle être visible sur le fédiverse? C'est nécessaire pour la fédération." + type = "boolean" + default = true + help.en = "Should that instance be visible to the fediverse ? It is required for federation." + help.fr = "Cette instance doit elle être visible sur le fédiverse? C'est nécessaire pour la fédération." [install.init_main_permission] # this is a generic question - ask strings are automatically handled by YunoHost's core @@ -46,26 +46,26 @@ multi_instance = false type = "group" default = "visitors" - [install.domain] - ask.en = "Choose the application language" - ask.fr = "Choisissez la langue de l'application" + + [install.language] + .en = "Choose the application language" + .fr = "Choisissez la langue de l'application" type = "string" choices = ["fr", "en"] default = "fr" - - - [install.admin] + + [install.admin] # this is a generic question - ask strings are automatically handled by YunoHost's core type = "user" - [install.password] + [install.password] # this is a generic question - ask strings are automatically handled by YunoHost's core # Note that user-provided passwords questions are not automatically saved as setting help.en = "Use the help field to add an information for the admin about this question." help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." type = "password" - [install.media_upload_size] + [install.media_upload_size] type = "string" choices = [ "1MB", From 24cd73a384db4c95ee51a7e0839f8c74f123153d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 14:10:00 +0100 Subject: [PATCH 024/260] add architecture + TODO minimum requirements --- manifest.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index a26f776..c84254c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,12 +5,18 @@ id = "bonfire" version = "0.1~ynh1" url = "https://example.com" license = "free" -multi_instance = true +multi_instance = false +architectures = "all" + services = [ "nginx" ] - maintainers = ["Lapineige"] +# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... +#disk = "500M" +#ram.build = "500M" +#ram.runtime = "500M" + [description] en = "Federated social networking server built on ActivityPub open protocol" fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" From 0bb6cbddf3dddba14513448c14a543ec4f0849fa Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 14:14:25 +0100 Subject: [PATCH 025/260] typo --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index c84254c..f20d659 100644 --- a/manifest.toml +++ b/manifest.toml @@ -54,8 +54,8 @@ multi_instance = false [install.language] - .en = "Choose the application language" - .fr = "Choisissez la langue de l'application" + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" type = "string" choices = ["fr", "en"] default = "fr" From 4008680c4217fb8ad5af2a2136f4aea55070b787 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 14:17:21 +0100 Subject: [PATCH 026/260] fix ordering --- manifest.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index f20d659..d7cdddb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,8 +5,6 @@ id = "bonfire" version = "0.1~ynh1" url = "https://example.com" license = "free" -multi_instance = false -architectures = "all" services = [ "nginx" ] @@ -33,6 +31,7 @@ code = "https://github.com/bonfire-networks/bonfire-app" [integration] yunohost = ">= 11.0.0" multi_instance = false +architectures = "all" [install] [install.domain] From ab98e76d8b46995ebf7046c70e6bb87045bd997b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 17:10:10 +0100 Subject: [PATCH 027/260] Add missing ldap settings --- manifest.toml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index d7cdddb..9cd5ce1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -11,9 +11,9 @@ services = [ "nginx" ] maintainers = ["Lapineige"] # FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... -#disk = "500M" -#ram.build = "500M" -#ram.runtime = "500M" +disk = "500M" +ram.build = "500M" +ram.runtime = "500M" [description] en = "Federated social networking server built on ActivityPub open protocol" @@ -33,6 +33,13 @@ yunohost = ">= 11.0.0" multi_instance = false architectures = "all" +### LDAP & SSO will be dealt with later, if Bonfire support it. Help wanted :) +# FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +ldap = "false" +# FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +sso = "false" + + [install] [install.domain] type = "domain" @@ -89,7 +96,7 @@ architectures = "all" ask.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." [resources] - [resources.data_dir] + #[resources.data_dir] # This will create/remove the data dir as /home/yunohost.app/$app # and store the corresponding setting $data_dir #TODO From 7be950d7b10e795c4206e7de0ee4df8a9c52ce22 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 17:12:17 +0100 Subject: [PATCH 028/260] disk parameter ordering --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9cd5ce1..d7fdda1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -10,10 +10,6 @@ services = [ "nginx" ] maintainers = ["Lapineige"] -# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... -disk = "500M" -ram.build = "500M" -ram.runtime = "500M" [description] en = "Federated social networking server built on ActivityPub open protocol" @@ -39,6 +35,10 @@ ldap = "false" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. sso = "false" +# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... +disk = "500M" +ram.build = "500M" +ram.runtime = "500M" [install] [install.domain] From de81c8459523a0bc96ddc3c01d62f0fd5f7026d3 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 17:18:11 +0100 Subject: [PATCH 029/260] fix boolean syntax --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index d7fdda1..ca48e6d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -31,9 +31,9 @@ architectures = "all" ### LDAP & SSO will be dealt with later, if Bonfire support it. Help wanted :) # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -ldap = "false" +ldap = false # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -sso = "false" +sso = false # FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... disk = "500M" From c858562ef7b320c6df4dc506dacc373926661101 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 17:40:46 +0100 Subject: [PATCH 030/260] postregrSQL is not there --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index f7ec441..7f96e3d 100644 --- a/scripts/install +++ b/scripts/install @@ -122,6 +122,8 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name +ynh_psql_test_if_first_run +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database=$db_name #================================================= From 357c8058485c7611bca194de152b4a26d627aa8d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 18:05:15 +0100 Subject: [PATCH 031/260] remove data base ressource (this is a test) --- manifest.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index ca48e6d..b68dcd4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -103,7 +103,3 @@ ram.runtime = "500M" [resources.ports] # This will pick a random port for reverse-proxying and store it as the $port setting - - [resources.database] - # This will automatically provision/deprovison a mysql DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd - type = "postgresql" From 343633820d1ab894da762f70d99ffff276896280 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 18:12:12 +0100 Subject: [PATCH 032/260] =?UTF-8?q?Another=20postgresql=20try=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.toml b/manifest.toml index b68dcd4..533c689 100644 --- a/manifest.toml +++ b/manifest.toml @@ -103,3 +103,7 @@ ram.runtime = "500M" [resources.ports] # This will pick a random port for reverse-proxying and store it as the $port setting + + [resources.database] + # This will automatically provision/deprovison a mysql DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd + type = "psql" From 7ad9054ae70e7a1137f9bb5c8b1cde6df949536d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 18:14:48 +0100 Subject: [PATCH 033/260] package v2 : install_dir instead of final_path --- scripts/install | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index 7f96e3d..f01d7c4 100644 --- a/scripts/install +++ b/scripts/install @@ -56,8 +56,7 @@ ynh_script_progression --message="Validating installation parameters..." --weigh ### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -112,7 +111,7 @@ 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" +ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A POSTGRESQL DATABASE @@ -135,9 +134,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ### downloaded from an upstream source, like a git repository. ### `ynh_setup_source` use the file conf/app.src -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" # FIXME: this should be managed by the core in the future # Here, as a packager, you may have to tweak the ownerhsip/permissions @@ -145,9 +144,9 @@ ynh_setup_source --dest_dir="$final_path" # files in some cases. # But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - # this will be treated as a security issue. -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -165,8 +164,8 @@ ynh_add_nginx_config # Configuration files #================================================= -config="$final_path/.config" -env_file="$final_path/.env" +config="$install_dir/.config" +env_file="$install_dir/.env" export MIX_ENV=prod FLAVOUR=classic @@ -205,7 +204,7 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release #================================================= # Run the release #================================================= -release_folder="$final_path/_build/prod/rel/bonfire/" +release_folder="$install_dir/_build/prod/rel/bonfire/" # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" From abcc0a9f5c21df4d175d65b28c01e98161b97f66 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 5 Feb 2023 18:16:16 +0100 Subject: [PATCH 034/260] =?UTF-8?q?That=20was=20postgresql=E2=80=A6=20+=20?= =?UTF-8?q?remove=20Nginx=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 533c689..7119242 100644 --- a/manifest.toml +++ b/manifest.toml @@ -6,8 +6,6 @@ version = "0.1~ynh1" url = "https://example.com" license = "free" -services = [ "nginx" ] - maintainers = ["Lapineige"] @@ -106,4 +104,4 @@ ram.runtime = "500M" [resources.database] # This will automatically provision/deprovison a mysql DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd - type = "psql" + type = "postgresql" From fa303dfd79844f70fddcc40b96b155b4dc4af94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:10:27 +0200 Subject: [PATCH 035/260] Update manifest.toml --- manifest.toml | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7119242..8011479 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ code = "https://github.com/bonfire-networks/bonfire-app" [integration] -yunohost = ">= 11.0.0" +yunohost = ">= 11.1.18" multi_instance = false architectures = "all" @@ -78,30 +78,27 @@ ram.runtime = "500M" [install.media_upload_size] type = "string" choices = [ - "1MB", - "2MB", - "5MB", - "10MB", - "15MB", - "20MB", - "35MB", - "50MB", - "100MB", - "150MB" - ] + "1MB", + "2MB", + "5MB", + "10MB", + "15MB", + "20MB", + "35MB", + "50MB", + "100MB", + "150MB" + ] default = "20MB" ask.en = "Maximum size of the media uploaded. Can be changed later." ask.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." [resources] - #[resources.data_dir] - # This will create/remove the data dir as /home/yunohost.app/$app - # and store the corresponding setting $data_dir - #TODO - + [resources.ports] - # This will pick a random port for reverse-proxying and store it as the $port setting + [resources.apt] + packages = "postgresql" + [resources.database] - # This will automatically provision/deprovison a mysql DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd type = "postgresql" From 80950a50f09bb20d90a30b6f38262add6465ec5e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 30 Apr 2023 10:10:32 +0000 Subject: [PATCH 036/260] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 87c5c72..270770c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Bonfire for YunoHost [![Integration level](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Working status](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) + [![Install Bonfire with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 1017656..4f87b28 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Bonfire pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/bonfire.svg)](https://dash.yunohost.org/appci/app/bonfire) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bonfire.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bonfire.maintain.svg) + [![Installer Bonfire avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bonfire) *[Read this readme in english.](./README.md)* From 81643515ec05943505c77183724643921919d8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:10:58 +0200 Subject: [PATCH 037/260] remove db --- scripts/_common.sh | 3 --- scripts/install | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 7148ffa..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app (must be on a single line) -pkg_dependencies="postgresql postgresql-contrib" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index f01d7c4..d164e57 100644 --- a/scripts/install +++ b/scripts/install @@ -113,18 +113,6 @@ ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$install_dir" -#================================================= -# CREATE A POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 - -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name -ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 9a771cf6423c8da46bd487cae7ccb4faf007b0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:12:14 +0200 Subject: [PATCH 038/260] Create tests.toml --- tests.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests.toml diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..eb73b8d --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default] \ No newline at end of file From 6d10a586a72c5194c0fac133f4b4f1a4ef965249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:14:56 +0200 Subject: [PATCH 039/260] Update manifest.toml --- manifest.toml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8011479..0dd54ed 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,39 +1,28 @@ packaging_format = 2 -name = "Bonfire" id = "bonfire" +name = "Bonfire" +description.en = "Federated social networking server built on ActivityPub open protocol" +description.fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" + version = "0.1~ynh1" -url = "https://example.com" -license = "free" maintainers = ["Lapineige"] - -[description] -en = "Federated social networking server built on ActivityPub open protocol" -fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" - [upstream] -license = "GNU Affero General Public License v3.0" +license = "AGPL-3.0-only" website = "https://bonfirenetworks.org/" demo = "https://playground.bonfire.cafe/" admindoc = "https://bonfirenetworks.org/docs/" userdoc = "https://bonfirenetworks.org/docs/" code = "https://github.com/bonfire-networks/bonfire-app" - [integration] yunohost = ">= 11.1.18" multi_instance = false architectures = "all" - -### LDAP & SSO will be dealt with later, if Bonfire support it. Help wanted :) -# FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. ldap = false -# FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. sso = false - -# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... disk = "500M" ram.build = "500M" ram.runtime = "500M" @@ -51,12 +40,9 @@ ram.runtime = "500M" help.fr = "Cette instance doit elle être visible sur le fédiverse? C'est nécessaire pour la fédération." [install.init_main_permission] - # this is a generic question - ask strings are automatically handled by YunoHost's core - # This won't be saved as setting and will instead be used to initialize the SSOwat permission type = "group" default = "visitors" - [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" @@ -65,12 +51,9 @@ ram.runtime = "500M" default = "fr" [install.admin] - # this is a generic question - ask strings are automatically handled by YunoHost's core type = "user" [install.password] - # this is a generic question - ask strings are automatically handled by YunoHost's core - # Note that user-provided passwords questions are not automatically saved as setting help.en = "Use the help field to add an information for the admin about this question." help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." type = "password" From 9b1bc462fd4298e71310cf0c62b43cf5840a207d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:17:51 +0200 Subject: [PATCH 040/260] cleaning --- conf/app.src | 7 ------- manifest.toml | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 conf/app.src diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 096ece1..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.4.0-beta.43.tar.gz -SOURCE_SUM=0c1b78f153c67e3b56f91a72a013e854bd87a03fbacdf3846ed1ab10a5d21a0f -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/manifest.toml b/manifest.toml index 0dd54ed..e012d2e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -78,8 +78,19 @@ ram.runtime = "500M" [resources] + [resources.sources] + + [resources.sources.main] + url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.4.0-beta.43.tar.gz" + sha256 = "0c1b78f153c67e3b56f91a72a013e854bd87a03fbacdf3846ed1ab10a5d21a0f" + [resources.ports] + + [resources.install_dir] + [resources.permissions] + main.url = "/" + [resources.apt] packages = "postgresql" From 271abda5e8ab714e805d0cdfda0e237b06d8fee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:19:19 +0200 Subject: [PATCH 041/260] Update install --- scripts/install | 118 ------------------------------------------------ 1 file changed, 118 deletions(-) diff --git a/scripts/install b/scripts/install index d164e57..9a4b5e3 100644 --- a/scripts/install +++ b/scripts/install @@ -9,130 +9,14 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD - -media_upload_size=$YNH_APP_ARG_MEDIA_UPLOAD_SIZE - -### If it's a multi-instance app, meaning it can be installed several times independently -### The id of the app as stated in the manifest is available as $YNH_APP_ID -### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) -### The app instance name is available as $YNH_APP_INSTANCE_NAME -### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -### - ynhexample__{N} for the subsequent installations, with N=3,4... -### The app instance name is probably what interests you most, since this is -### guaranteed to be unique. This is a good unique identifier to define installation path, -### db names... -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -### About --weight and --time -### ynh_script_progression will show to your final users the progression of each scripts. -### In order to do that, --weight will represent the relative time of execution compared to the other steps in the script. -### --time is a packager option, it will show you the execution time since the previous call. -### This option is implied when running in CI_package_check, you can manually add it if you are manually testing the app. -### Use the execution time displayed in the CI report or by adding --time to the command, to estimate the weight of a step. -### A common way to do it is to set a weight equal to the execution time in second +1. -### The execution time is given for the durationt since the previous call. So the weight should be applied to this previous call. -ynh_script_progression --message="Validating installation parameters..." --weight=1 - -### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" -test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 - -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=language --value=$language -ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=media_upload_size --value=$media_upload_size - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 - -### Use these lines if you have to open a port for the application -### `ynh_find_port` will find the first available port starting from the given port. -### If you're not using these lines: -### - Remove the section "CLOSE A PORT" in the remove script - -# Find an available port -port=$(ynh_find_port --port=8095) -ynh_app_setting_set --app=$app --key=port --value=$port - -# Optional: Expose this port publicly -# (N.B.: you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - -# Open the port -# ynh_script_progression --message="Configuring firewall..." --weight=1 -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 - -ynh_install_app_dependencies $pkg_dependencies - -# ynh_script_progression --message="Installing extra dependencies…" --weight=1 - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - -ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -141,8 +25,6 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated NGINX config ynh_add_nginx_config From 9898a630599d17da46fa644556199b6b75e58ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:21:29 +0200 Subject: [PATCH 042/260] cleaning --- conf/nginx.conf | 2 +- scripts/install | 59 ++----------------------------------------------- 2 files changed, 3 insertions(+), 58 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9782b91..7937e6b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/; + alias __INSTALL_DIR__/; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/scripts/install b/scripts/install index 9a4b5e3..0478f81 100644 --- a/scripts/install +++ b/scripts/install @@ -62,6 +62,7 @@ UPLOAD_LIMIT="${media_upload_size:0:2}000000" # convert the MB argument in bytes #================================================= # Configure the release #================================================= + ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix deps.get --only prod ynh_exec_warn_less just js-deps-get @@ -74,6 +75,7 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release #================================================= # Run the release #================================================= + release_folder="$install_dir/_build/prod/rel/bonfire/" # Database created before, let's run the migrations @@ -82,63 +84,6 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire e # start bonfire as a daemon ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire start daemon" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app. -### Use this helper only if there is effectively a log file for this app. -### If you're not using this helper: -### - Remove the section "BACKUP LOGROTATE" in the backup script -### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script -### - And the section "SETUP LOGROTATE" in the upgrade script - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# SETUP FAIL2BAN -#================================================= -ynh_script_progression --message="Configuring Fail2Ban..." --weight=1 - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" -fi - -### N.B. : the following extra permissions only make sense if your app -### does have for example an admin interface or an API. - -# Only the admin can access the admin panel of the app (if the app has an admin panel) -ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin - -# Everyone can access the API part -# We don't want to display the tile in the SSO so we put --show_tile="false" -# And we don't want the YunoHost admin to be able to remove visitors group to this permission, so we put --protected="true" -ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 8ad4f53d417d6c937ea9a64e4941594dc46aee1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:24:32 +0200 Subject: [PATCH 043/260] Update remove --- scripts/remove | 106 ------------------------------------------------- 1 file changed, 106 deletions(-) diff --git a/scripts/remove b/scripts/remove index f4c45c6..1ceb10e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,21 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) - - #================================================= # REMOVE DEDICATED USER #================================================= @@ -32,44 +17,6 @@ ynh_script_progression --message="Stop Bonfire..." --weight=1 # start bonfire as a daemon "$release_folder/bin/bonfire stop" -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - - -#================================================= -# REMOVE THE POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 - -# Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -78,59 +25,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1 - -# Remove the dedicated Fail2Ban config -ynh_remove_fail2ban_config - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - -# Remove a cron file -ynh_secure_remove --file="/etc/cron.d/$app" - -# Remove a directory securely -ynh_secure_remove --file="/etc/$app" - -# Remove the log files -ynh_secure_remove --file="/var/log/$app" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= - -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= From 2fa20d36cb459755204e9e5e14857bbdad195b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:25:21 +0200 Subject: [PATCH 044/260] Update manifest.toml --- manifest.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e012d2e..83180e2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -85,7 +85,9 @@ ram.runtime = "500M" sha256 = "0c1b78f153c67e3b56f91a72a013e854bd87a03fbacdf3846ed1ab10a5d21a0f" [resources.ports] - + + [resources.system_user] + [resources.install_dir] [resources.permissions] From 6bc79816cab48f6e31a99a88f152d5f7c26f7f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:26:15 +0200 Subject: [PATCH 045/260] Create DESCRIPTION.md --- doc/DESCRIPTION.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/DESCRIPTION.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..e69de29 From f200a07fd00e34b000adb41645f57fda56945e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:28:09 +0200 Subject: [PATCH 046/260] Update manifest.toml --- manifest.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 83180e2..afeb9ad 100644 --- a/manifest.toml +++ b/manifest.toml @@ -30,8 +30,6 @@ ram.runtime = "500M" [install] [install.domain] type = "domain" - ask.en = "The domain name to use. Bonfire will be installed at its root path (/). This can't be changed." - ask.fr = "Nom de domaine à utiliser. Bonfire sera installé à sa racine (/). Cela ne pourra pas être changé." [install.is_public] type = "boolean" From 6a37065f2cf57af44c55959540a1ece348148e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:30:24 +0200 Subject: [PATCH 047/260] Create backup --- scripts/backup | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/backup diff --git a/scripts/backup b/scripts/backup new file mode 100644 index 0000000..69055c4 --- /dev/null +++ b/scripts/backup @@ -0,0 +1,41 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +source ../settings/scripts/_common.sh +source /usr/share/yunohost/helpers + +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + +#================================================= +# BACKUP THE APP MAIN DIR +#================================================= + +ynh_backup --src_path="$install_dir" + +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= + +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" + +#================================================= +# BACKUP THE POSTGRESQL DATABASE +#================================================= +ynh_print_info --message="Backing up the PostgreSQL database..." + +ynh_psql_dump_db --database="$db_name" > db.sql + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 167748b2c865c14ebf2c822e7d86489b15eeb270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:33:38 +0200 Subject: [PATCH 048/260] fix --- scripts/change_url | 23 ++++++++++++++++++++ scripts/restore | 51 ++++++++++++++++++++++++++++++++++++++++++++ scripts/upgrade | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 scripts/change_url create mode 100644 scripts/restore create mode 100644 scripts/upgrade diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..4ba8cf7 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,23 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/restore b/scripts/restore new file mode 100644 index 0000000..f489d88 --- /dev/null +++ b/scripts/restore @@ -0,0 +1,51 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +source ../settings/scripts/_common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=1 + +ynh_restore_file --origin_path="$install_dir" + +chown -R $app:www-data "$install_dir" + +#================================================= +# RESTORE THE POSTGRESQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 + +ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + +#================================================= +# GENERIC FINALIZATION +#================================================= +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE +#================================================= +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..e31fa34 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,53 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +upgrade_type=$(ynh_check_app_version_changed) + +#================================================= +# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=1 + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" +fi + +chown -R $app:www-data "$install_dir" + +#================================================= +# REAPPLY SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 + +ynh_add_nginx_config + +#================================================= +# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) +#================================================= +# UPDATE A CONFIG FILE +#================================================= +#ynh_script_progression --message="Updating a configuration file..." --weight=1 + +#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" + +#chmod 400 "$install_dir/some_config_file" +#chown $app:$app "$install_dir/some_config_file" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Upgrade of $app completed" --last From 8f0f2fde8290cd77a92c1282c40ee7489270710b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 15:10:42 +0200 Subject: [PATCH 049/260] fix --- conf/.env | 3 +++ scripts/install | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 conf/.env diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..04f60c3 --- /dev/null +++ b/conf/.env @@ -0,0 +1,3 @@ +MIX_ENV=prod +FLAVOUR=classic +HOSTNAME=__DOMAIN__ \ No newline at end of file diff --git a/scripts/install b/scripts/install index 0478f81..d04f539 100644 --- a/scripts/install +++ b/scripts/install @@ -59,6 +59,16 @@ ynh_replace_string --match_string="PUBLIC_PORT=4000" --replace_string="PUBLIC_PO # max file upload size UPLOAD_LIMIT="${media_upload_size:0:2}000000" # convert the MB argument in bytes +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" + +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" + #================================================= # Configure the release #================================================= From e55316dbea1d70346c8f597ff7dae97fdd0d710d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 30 Apr 2023 15:21:49 +0200 Subject: [PATCH 050/260] add .env --- conf/.env | 16 +++++++++++++++- scripts/install | 43 ++++++++++++------------------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/conf/.env b/conf/.env index 04f60c3..b472618 100644 --- a/conf/.env +++ b/conf/.env @@ -1,3 +1,17 @@ MIX_ENV=prod FLAVOUR=classic -HOSTNAME=__DOMAIN__ \ No newline at end of file +HOSTNAME=__DOMAIN__ + +SECRET_KEY_BASE=__SECRET_KEY_BASE__ +SIGNING_SALT=__SIGNING_SALT__ +ENCRYPTION_SALT=__ENCRYPTION_SALT__ + +SERVER_PORT=__PORT__ +PUBLIC_PORT=443 + +# TODO : Configure S3 - with proper Yunohost question during installation +#UPLOADS_S3_BUCKET= +#UPLOADS_S3_ACCESS_KEY_ID= +#UPLOADS_S3_SECRET_ACCESS_KEY= + +#UPLOAD_LIMIT= \ No newline at end of file diff --git a/scripts/install b/scripts/install index d04f539..0c3689f 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,10 @@ source _common.sh source /usr/share/yunohost/helpers +secret_key_base=$(ynh_string_random --length=24) +signing_salt=$(ynh_string_random --length=24) +encryption_salt=$(ynh_string_random --length=24) + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -28,37 +32,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# Configuration files -#================================================= - -config="$install_dir/.config" -env_file="$install_dir/.env" - -export MIX_ENV=prod FLAVOUR=classic - -ynh_exec_warn_less just config -# generate secrets -ynh_replace_string --match_string="SECRET_KEY_BASE=you-should-put-a-secure-string-here" --replace_string="SECRET_KEY_BASE=$(openssl rand -base64 128)" --target_file="$env_file" -ynh_replace_string --match_string="SIGNING_SALT=you-should-put-a-different-secure-string-here" --replace_string="SIGNING_SALT=$(openssl rand -base64 128)" --target_file="$env_file" -ynh_replace_string --match_string="ENCRYPTION_SALT=you-should-put-yet-another-secure-string-here" --replace_string="ENCRYPTION_SALT=$(openssl rand -base64 128)" --target_file="$env_file" - -# Configure server ports -ynh_replace_string --match_string="HOSTNAME=localhost" --replace_string="HOSTNAME=$domain" --target_file="$env_file" -# TODO : mail service ? -ynh_replace_string --match_string="SERVER_PORT=4000" --replace_string="SERVER_PORT^=$port" --target_file="$env_file" -ynh_replace_string --match_string="PUBLIC_PORT=4000" --replace_string="PUBLIC_PORT=443" --target_file="$env_file" - -# TODO : Configure S3 - with proper Yunohost question during installation -# UPLOADS_S3_BUCKET= -# UPLOADS_S3_ACCESS_KEY_ID= -# UPLOADS_S3_SECRET_ACCESS_KEY= - -# max file upload size -UPLOAD_LIMIT="${media_upload_size:0:2}000000" # convert the MB argument in bytes - #================================================= # ADD A CONFIGURATION #================================================= @@ -69,6 +42,14 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" +#================================================= +# SPECIFIC SETUP +#================================================= +# Configuration files +#================================================= + +ynh_exec_warn_less just config + #================================================= # Configure the release #================================================= From 7974160a5ab37f6129ebd6a6e19aa176ee68f6d6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 30 Apr 2023 21:39:51 +0200 Subject: [PATCH 051/260] restore comments + adds description --- manifest.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e012d2e..b406eea 100644 --- a/manifest.toml +++ b/manifest.toml @@ -9,6 +9,10 @@ version = "0.1~ynh1" maintainers = ["Lapineige"] +[description] +en = "Federated social networking server built on ActivityPub open protocol" +fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" + [upstream] license = "AGPL-3.0-only" website = "https://bonfirenetworks.org/" @@ -23,7 +27,8 @@ multi_instance = false architectures = "all" ldap = false sso = false -disk = "500M" +disk = "1000M" +# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G, ... ram.build = "500M" ram.runtime = "500M" From e7842cba02810297a2aff4debc02f881b74df2d5 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 30 Apr 2023 21:40:57 +0200 Subject: [PATCH 052/260] Restore comment (data dir) --- manifest.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifest.toml b/manifest.toml index b406eea..d47c23b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -83,6 +83,11 @@ ram.runtime = "500M" [resources] + #[resources.data_dir] + # This will create/remove the data dir as /home/yunohost.app/$app + # and store the corresponding setting $data_dir + #TODO + [resources.sources] [resources.sources.main] From f6d514fb17a6bad6ad6c25f96f9b1f64b590b003 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 10:50:07 +0200 Subject: [PATCH 053/260] ask -> help --- manifest.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index afeb9ad..17b5892 100644 --- a/manifest.toml +++ b/manifest.toml @@ -30,6 +30,8 @@ ram.runtime = "500M" [install] [install.domain] type = "domain" + help.en = "The domain name to use. Bonfire will be installed at its root path (/). This can't be changed." + help.fr = "Nom de domaine à utiliser. Bonfire sera installé à sa racine (/). Cela ne pourra pas être changé." [install.is_public] type = "boolean" @@ -42,8 +44,8 @@ ram.runtime = "500M" default = "visitors" [install.language] - ask.en = "Choose the application language" - ask.fr = "Choisissez la langue de l'application" + help.en = "Choose the application language" + help.fr = "Choisissez la langue de l'application" type = "string" choices = ["fr", "en"] default = "fr" @@ -71,8 +73,8 @@ ram.runtime = "500M" "150MB" ] default = "20MB" - ask.en = "Maximum size of the media uploaded. Can be changed later." - ask.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." + help.en = "Maximum size of the media uploaded. Can be changed later." + help.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." [resources] From 8f631739557849c239dae9602af22b9191478047 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 17:52:00 +0200 Subject: [PATCH 054/260] Install just --- scripts/install | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/install b/scripts/install index 0c3689f..016ad94 100644 --- a/scripts/install +++ b/scripts/install @@ -48,6 +48,15 @@ chown $app:$app "$install_dir/.env" # Configuration files #================================================= +### Add just dependancy +# TODO : this is unsafe and should be dealt with in a better way. +# There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages + +git clone 'https://mpr.makedeb.org/just' +cd just +makedeb -si +cd .. + ynh_exec_warn_less just config #================================================= From 1f3b7bd1a5c8671412d1d564f94551ece96b1d27 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 17:59:48 +0200 Subject: [PATCH 055/260] add makedeb dependency --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 016ad94..7203aaf 100644 --- a/scripts/install +++ b/scripts/install @@ -48,10 +48,11 @@ chown $app:$app "$install_dir/.env" # Configuration files #================================================= -### Add just dependancy +### Add just dependency # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages +bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just makedeb -si From 90cfbe4d51bb1de609a1c9c280f2d8f340982c23 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 23:24:05 +0200 Subject: [PATCH 056/260] fix makedeb + more logging output --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7203aaf..7b80a31 100644 --- a/scripts/install +++ b/scripts/install @@ -47,17 +47,19 @@ chown $app:$app "$install_dir/.env" #================================================= # Configuration files #================================================= - +ynh_script_progression --message="Managing special dependencies..." --weight=1 ### Add just dependency # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages +export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just makedeb -si cd .. +ynh_script_progression --message="Configuring..." --weight=1 ynh_exec_warn_less just config #================================================= From 6e74191423c4676c9c6d142973605502983b3798 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 23:31:09 +0200 Subject: [PATCH 057/260] another makedeb fix --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 7b80a31..3042998 100644 --- a/scripts/install +++ b/scripts/install @@ -52,6 +52,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages +export TERM=xterm export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' From 0b9e850c714dc55d36533bfd6a20d4a1ee236807 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 1 May 2023 23:37:59 +0200 Subject: [PATCH 058/260] another try --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3042998..b16f31b 100644 --- a/scripts/install +++ b/scripts/install @@ -54,10 +54,10 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 export TERM=xterm export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage -bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement +ynh_exec_as $app -s $SHELL bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just -makedeb -si +makedeb -si cd .. ynh_script_progression --message="Configuring..." --weight=1 From 37d5bf4c5ed2530ed6a5e7ae6a037ccf983ad986 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 10:19:31 +0200 Subject: [PATCH 059/260] another try --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b16f31b..12d4d90 100644 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 export TERM=xterm export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage -ynh_exec_as $app -s $SHELL bash -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement +ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just makedeb -si From b68d5b13db2275fb953c0edf33e29d8c2f5352aa Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 10:26:25 +0200 Subject: [PATCH 060/260] yet another try --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 12d4d90..d0c58d5 100644 --- a/scripts/install +++ b/scripts/install @@ -55,9 +55,9 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 export TERM=xterm export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement -git clone 'https://mpr.makedeb.org/just' -cd just -makedeb -si +ynh_exec_as $app -s $SHELL git clone 'https://mpr.makedeb.org/just' +ynh_exec_as $app -s $SHELL cd just +ynh_exec_as $app -s $SHELL makedeb -si cd .. ynh_script_progression --message="Configuring..." --weight=1 From 2463d303b187a2f68a9e3747b5fd5d2d9b4cfc25 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 10:43:46 +0200 Subject: [PATCH 061/260] fix rights for git command --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index d0c58d5..ce0909e 100644 --- a/scripts/install +++ b/scripts/install @@ -55,8 +55,8 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 export TERM=xterm export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement -ynh_exec_as $app -s $SHELL git clone 'https://mpr.makedeb.org/just' -ynh_exec_as $app -s $SHELL cd just +git clone 'https://mpr.makedeb.org/just' +cd just ynh_exec_as $app -s $SHELL makedeb -si cd .. From 3d41e4c9672935ce08963e451b5af7c4a8ce2efe Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 10:57:46 +0200 Subject: [PATCH 062/260] verbose debugging --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index ce0909e..f50fbe8 100644 --- a/scripts/install +++ b/scripts/install @@ -57,6 +57,8 @@ export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/ ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just +which makedeb +whereis makedeb ynh_exec_as $app -s $SHELL makedeb -si cd .. From c6306080fa6400e9f535dc8defa60c318c10db26 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:04:34 +0200 Subject: [PATCH 063/260] fix typo --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f50fbe8..1df8aa7 100644 --- a/scripts/install +++ b/scripts/install @@ -57,8 +57,8 @@ export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/ ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just -which makedeb -whereis makedeb +echo $(which makedeb) +echo $(whereis makedeb) ynh_exec_as $app -s $SHELL makedeb -si cd .. From 94acbad4ed5608ed0b79e7457941c1ea5f292045 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:11:41 +0200 Subject: [PATCH 064/260] fix logging --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 1df8aa7..16063b7 100644 --- a/scripts/install +++ b/scripts/install @@ -57,8 +57,8 @@ export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/ ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just -echo $(which makedeb) -echo $(whereis makedeb) +echo $(ynh_exec_as $app -s $SHELL -c which makedeb) +echo $(ynh_exec_as $app -s $SHELL -c whereis makedeb) ynh_exec_as $app -s $SHELL makedeb -si cd .. From 003925059e9c278c97d389e20191b19573e51847 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:15:01 +0200 Subject: [PATCH 065/260] typo --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 16063b7..8955a61 100644 --- a/scripts/install +++ b/scripts/install @@ -57,8 +57,8 @@ export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/ ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement git clone 'https://mpr.makedeb.org/just' cd just -echo $(ynh_exec_as $app -s $SHELL -c which makedeb) -echo $(ynh_exec_as $app -s $SHELL -c whereis makedeb) +echo $(ynh_exec_as $app -s $SHELL -c "which makedeb") +echo $(ynh_exec_as $app -s $SHELL -c "whereis makedeb") ynh_exec_as $app -s $SHELL makedeb -si cd .. From 515bd2e04f6050c7449ca57214ab28388bedbcab Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:29:51 +0200 Subject: [PATCH 066/260] use makedeb repo instead --- scripts/install | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 8955a61..6294ba1 100644 --- a/scripts/install +++ b/scripts/install @@ -52,14 +52,15 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages -export TERM=xterm -export MAKEDEB_RELEASE='makedeb' # for non interactive https://docs.makedeb.org/installing/shell-script/#noninteractive-usage -ynh_exec_as $app -s $SHELL -c "$(wget -qO - 'https://shlink.makedeb.org/install')" # -c because -ci is for interractive environnement + +wget -qO - 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null +echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list +apt update +apt install makedeb + git clone 'https://mpr.makedeb.org/just' cd just -echo $(ynh_exec_as $app -s $SHELL -c "which makedeb") -echo $(ynh_exec_as $app -s $SHELL -c "whereis makedeb") -ynh_exec_as $app -s $SHELL makedeb -si +makedeb -si cd .. ynh_script_progression --message="Configuring..." --weight=1 From 1a52147f77b9433c597921bf2e7ecc02c5f173c2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:44:53 +0200 Subject: [PATCH 067/260] use proper ynh helper --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 6294ba1..827fac7 100644 --- a/scripts/install +++ b/scripts/install @@ -53,8 +53,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages -wget -qO - 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null -echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="just" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' apt update apt install makedeb From 79596b3feda5098d529c2618618aa4daa31e2cae Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 11:58:38 +0200 Subject: [PATCH 068/260] Cleaning --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 827fac7..ce541af 100644 --- a/scripts/install +++ b/scripts/install @@ -53,9 +53,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="just" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' -apt update -apt install makedeb +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' git clone 'https://mpr.makedeb.org/just' cd just From 8047adf36b9781c8127bf27a93efb679612ba63c Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:10:27 +0200 Subject: [PATCH 069/260] What about using makedeb MPR instead... --- scripts/install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index ce541af..d9ce851 100644 --- a/scripts/install +++ b/scripts/install @@ -52,13 +52,13 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages +ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr bullseye" --package="just" --key='https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' - -git clone 'https://mpr.makedeb.org/just' -cd just -makedeb -si -cd .. +#ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' +#git clone 'https://mpr.makedeb.org/just' +#cd just +#makedeb -si +#cd .. ynh_script_progression --message="Configuring..." --weight=1 ynh_exec_warn_less just config From 66b3a14857da5c69553f714e776512d4f55018c6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:33:33 +0200 Subject: [PATCH 070/260] no docker --- conf/.env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index b472618..03f5fbf 100644 --- a/conf/.env +++ b/conf/.env @@ -14,4 +14,6 @@ PUBLIC_PORT=443 #UPLOADS_S3_ACCESS_KEY_ID= #UPLOADS_S3_SECRET_ACCESS_KEY= -#UPLOAD_LIMIT= \ No newline at end of file +#UPLOAD_LIMIT= + +WITH_DOCKER=no From 44a4762f6179644c32bdb4ab1452beb327902323 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:34:24 +0200 Subject: [PATCH 071/260] export no docker option --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index d9ce851..0584e7c 100644 --- a/scripts/install +++ b/scripts/install @@ -52,6 +52,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages +# only works for x86, we need to switch to the other option with makedeb package ? ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr bullseye" --package="just" --key='https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' #ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' @@ -61,6 +62,7 @@ ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-m #cd .. ynh_script_progression --message="Configuring..." --weight=1 +export WITH_DOCKER=no # or source .env ? ynh_exec_warn_less just config #================================================= From c15a844a6503f9ae0a89b132f363446a66b6c70a Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:45:09 +0200 Subject: [PATCH 072/260] Update to v0.9.0-beta.10 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 17b5892..f8cfa7e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -81,8 +81,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.4.0-beta.43.tar.gz" - sha256 = "0c1b78f153c67e3b56f91a72a013e854bd87a03fbacdf3846ed1ab10a5d21a0f" + url = "https://github.com/bonfire-networks/bonfire-app/releases/tag/v0.9.0-beta.10.tar.gz" + sha256 = "1d8233abf2d59a5244957043d3449f01cf7fe49974eb40e3a057bda949f71bf8" [resources.ports] From 29e9ac9f2ee97c72b913373129bbd22d7b507600 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:49:16 +0200 Subject: [PATCH 073/260] Add Elixir dependency --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f8cfa7e..976e99b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -94,7 +94,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql" + packages = "postgresql elixir" [resources.database] type = "postgresql" From fc24549615d853d3f63dc4a5c85e1f8e234d98a5 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:54:03 +0200 Subject: [PATCH 074/260] Upgrade to newer installation instructions --- scripts/install | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 0584e7c..08e5a49 100644 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,7 @@ chown $app:$app "$install_dir/.env" #================================================= # SPECIFIC SETUP #================================================= -# Configuration files +# Just dependency #================================================= ynh_script_progression --message="Managing special dependencies..." --weight=1 ### Add just dependency @@ -61,22 +61,15 @@ ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-m #makedeb -si #cd .. -ynh_script_progression --message="Configuring..." --weight=1 +#================================================= +# Building the release +#================================================= +ynh_script_progression --message="Configuring Bonfire release..." --weight=1 + export WITH_DOCKER=no # or source .env ? -ynh_exec_warn_less just config +source "$install_dir/.env" -#================================================= -# Configure the release -#================================================= - -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix deps.get --only prod - -ynh_exec_warn_less just js-deps-get -ynh_exec_warn_less just assets-prepare -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix phx.digest - -# create an elexir release -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build #================================================= # Run the release @@ -85,10 +78,10 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc mix release release_folder="$install_dir/_build/prod/rel/bonfire/" # Database created before, let's run the migrations -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" # start bonfire as a daemon -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$release_folder/bin/bonfire start daemon" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" #================================================= # END OF SCRIPT From 854da4e80dd518bf7f1ed6d5ad22372104c677c2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 12:58:38 +0200 Subject: [PATCH 075/260] fix source url --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 976e99b..864de5d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -81,7 +81,7 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/releases/tag/v0.9.0-beta.10.tar.gz" + url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.0-beta.10.tar.gz" sha256 = "1d8233abf2d59a5244957043d3449f01cf7fe49974eb40e3a057bda949f71bf8" [resources.ports] From 2c3b8b264eacb5bd7a1533fc5359fc0e66f0663a Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:06:34 +0200 Subject: [PATCH 076/260] Fix working directory --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 08e5a49..9ad9f78 100644 --- a/scripts/install +++ b/scripts/install @@ -68,7 +68,7 @@ ynh_script_progression --message="Configuring Bonfire release..." --weight=1 export WITH_DOCKER=no # or source .env ? source "$install_dir/.env" - +cd $install_dir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build #================================================= From 23537dd24e3a4cc7fb009c04ef2f7a4efb19a8c9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:32:45 +0200 Subject: [PATCH 077/260] debugging --- scripts/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9ad9f78..7da47c9 100644 --- a/scripts/install +++ b/scripts/install @@ -75,7 +75,10 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build # Run the release #================================================= -release_folder="$install_dir/_build/prod/rel/bonfire/" +release_folder="$install_dir/_build/prod/rel/bonfire" + +echo $(ls -a $install_dir) +echo $(ls -a $release_folder) # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" From 74216a7b2d139e69137e062f10f19871c3ee5dc8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:39:09 +0200 Subject: [PATCH 078/260] fix logging --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 7da47c9..286b42d 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # only works for x86, we need to switch to the other option with makedeb package ? ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr bullseye" --package="just" --key='https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' -#ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' +#ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' #git clone 'https://mpr.makedeb.org/just' #cd just #makedeb -si @@ -77,8 +77,9 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build release_folder="$install_dir/_build/prod/rel/bonfire" -echo $(ls -a $install_dir) -echo $(ls -a $release_folder) +ynh_exec_warn_less ls -a $install_dir +ynh_exec_warn_less ls -a $install_dir/_build/ +ynh_exec_warn_less ls -a $release_folder # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" From 15c458c9826002e4af7d615216e6be6f20b4a549 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:42:26 +0200 Subject: [PATCH 079/260] MEDIA_UPLOAD_SIZE parameter in .env --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 286b42d..6f6da0f 100644 --- a/scripts/install +++ b/scripts/install @@ -37,6 +37,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 +# max file upload size +MEDIA_UPLOAD_SIZE="${MEDIA_UPLOAD_SIZE:0:2}000000" # convert the MB argument in bytes + ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" From c431d8f062cd54a3fbdecb4e30563de603917d40 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:43:22 +0200 Subject: [PATCH 080/260] MEDIA_UPLOAD_SIZE in .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 03f5fbf..013c24f 100644 --- a/conf/.env +++ b/conf/.env @@ -14,6 +14,6 @@ PUBLIC_PORT=443 #UPLOADS_S3_ACCESS_KEY_ID= #UPLOADS_S3_SECRET_ACCESS_KEY= -#UPLOAD_LIMIT= +UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE WITH_DOCKER=no From e9d33171df039a739536620c7e1d2f35aa73c41e Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:49:56 +0200 Subject: [PATCH 081/260] Fix logging --- scripts/install | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 6f6da0f..f6efa25 100644 --- a/scripts/install +++ b/scripts/install @@ -78,11 +78,10 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build # Run the release #================================================= -release_folder="$install_dir/_build/prod/rel/bonfire" +release_folder="_build/prod/rel/bonfire" -ynh_exec_warn_less ls -a $install_dir -ynh_exec_warn_less ls -a $install_dir/_build/ -ynh_exec_warn_less ls -a $release_folder +ynh_exec_warn ls _* +ynh_exec_warn ls $install_dir/_build/ # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" From 23e83330d9c69fc3c5f1bdf7f86f6e4835dab541 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:57:17 +0200 Subject: [PATCH 082/260] Add just config (again) --- scripts/install | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index f6efa25..d6b2294 100644 --- a/scripts/install +++ b/scripts/install @@ -64,14 +64,17 @@ ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-m #makedeb -si #cd .. +export WITH_DOCKER=no # or source .env ? +source "$install_dir/.env" + +ynh_script_progression --message="Configuring Bonfire release..." --weight=1 +cd $install_dir +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just config + #================================================= # Building the release #================================================= -ynh_script_progression --message="Configuring Bonfire release..." --weight=1 - -export WITH_DOCKER=no # or source .env ? -source "$install_dir/.env" -cd $install_dir +ynh_script_progression --message="Building Bonfire release..." --weight=1 ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build #================================================= @@ -80,9 +83,6 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build release_folder="_build/prod/rel/bonfire" -ynh_exec_warn ls _* -ynh_exec_warn ls $install_dir/_build/ - # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" From a2cbb8282028d09eb5468c4908ec6bc81285d486 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 13:58:15 +0200 Subject: [PATCH 083/260] comment MEDIA_UPLOAD_SIZE for now --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d6b2294..9b5a22d 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 # max file upload size -MEDIA_UPLOAD_SIZE="${MEDIA_UPLOAD_SIZE:0:2}000000" # convert the MB argument in bytes +# TODO : unbound variable ? #MEDIA_UPLOAD_SIZE="${MEDIA_UPLOAD_SIZE:0:2}000000" # convert the MB argument in bytes ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" From 4d54d0b917480c78847879c9550bc13055c48b34 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 14:36:42 +0200 Subject: [PATCH 084/260] better logging --- scripts/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9b5a22d..c864422 100644 --- a/scripts/install +++ b/scripts/install @@ -70,6 +70,8 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just config +ynh_exec_warn grep -m 1 'version:' mix.exs +ynh_exec_warn cat .env #================================================= # Building the release @@ -80,12 +82,13 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build #================================================= # Run the release #================================================= - release_folder="_build/prod/rel/bonfire" +ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_script_progression --message="Starting Bonfire..." --weight=1 # start bonfire as a daemon ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" From 943f95ce750c9a700bcd2b01ae4b49f12a52671b Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 14:48:01 +0200 Subject: [PATCH 085/260] fix media_upload_size --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c864422..99c0da7 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 # max file upload size -# TODO : unbound variable ? #MEDIA_UPLOAD_SIZE="${MEDIA_UPLOAD_SIZE:0:2}000000" # convert the MB argument in bytes +MEDIA_UPLOAD_SIZE="${media_upload_size:0:2}000000" # convert the MB argument in bytes ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" From 47c06a244d363edae243b1cc2408bf3346a53719 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 14:59:53 +0200 Subject: [PATCH 086/260] cleaning + more verbose logging --- scripts/install | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 99c0da7..0cd8697 100644 --- a/scripts/install +++ b/scripts/install @@ -69,15 +69,13 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just config -ynh_exec_warn grep -m 1 'version:' mix.exs -ynh_exec_warn cat .env +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just config #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc just rel-build +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just rel-build #================================================= # Run the release From 3f117e4a84d0c176cd47e13bd83466cd6e46fa85 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 15:32:57 +0200 Subject: [PATCH 087/260] what if just was run by root --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 0cd8697..53ab26b 100644 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,7 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just config +ynh_exec_warn just config #================================================= # Building the release From 2d79bdd0d60487b2143b8e1c163f050bcfbf3af3 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 15:37:58 +0200 Subject: [PATCH 088/260] more verbose logging --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 53ab26b..3397a49 100644 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,7 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn just config +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just config #================================================= # Building the release @@ -84,11 +84,11 @@ release_folder="_build/prod/rel/bonfire" ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 # start bonfire as a daemon -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" #================================================= # END OF SCRIPT From 9d8120b1206682161557b8d452b8a158aa4c3326 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 15:38:27 +0200 Subject: [PATCH 089/260] revert --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3397a49..2c853c1 100644 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,7 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just config +ynh_exec_warn just config #================================================= # Building the release From e35aa26e62fab0527e9cacba4d93bb834936f93c Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 15:52:42 +0200 Subject: [PATCH 090/260] 0.9.0-beta10 correct version name --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 864de5d..0990d3a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Bonfire" description.en = "Federated social networking server built on ActivityPub open protocol" description.fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" -version = "0.1~ynh1" +version = "0.9.0-beta10~ynh1" maintainers = ["Lapineige"] From e17c7d58c7ff4e34e60b46c30af83a279673f959 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 2 May 2023 13:52:45 +0000 Subject: [PATCH 091/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 270770c..78999e9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.1~ynh1 +**Shipped version:** 0.9.0-beta10~ynh1 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 4f87b28..f10ddf8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.1~ynh1 +**Version incluse :** 0.9.0-beta10~ynh1 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 2d725fda9cffac148b47395fdb1a5df7bfb42e62 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 16:18:19 +0200 Subject: [PATCH 092/260] fix syntax for exec_as --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 2c853c1..1495aa2 100644 --- a/scripts/install +++ b/scripts/install @@ -69,13 +69,13 @@ source "$install_dir/.env" ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn just config +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc just rel-build +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just rel-build" #================================================= # Run the release From 3907f38be3bc4f81174b7c500e94809d3f7ff5d6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 16:50:07 +0200 Subject: [PATCH 093/260] better logging --- scripts/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1495aa2..d0d5e31 100644 --- a/scripts/install +++ b/scripts/install @@ -65,17 +65,20 @@ ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-m #cd .. export WITH_DOCKER=no # or source .env ? -source "$install_dir/.env" +source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" +ynh_exec_warn cat .env + #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just rel-build" +ynh_exec_warn ls #================================================= # Run the release From d01d71e1afb5f39e9eac2dcf63851465b2da93d4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 17:52:11 +0200 Subject: [PATCH 094/260] try to start + account creation logging --- scripts/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d0d5e31..18a5b23 100644 --- a/scripts/install +++ b/scripts/install @@ -90,11 +90,15 @@ ynh_script_progression --message="Running database migrations..." --weight=1 ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start" + # start bonfire as a daemon +ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of $app completed" --weight=1 +ynh_script_progression --message="Now you need to sign-up, the first account will automatically be admin." --last From 47952b313df8624f6ecb9af5d0dd30a57f42b031 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 17:53:49 +0200 Subject: [PATCH 095/260] add websocket redirect --- conf/nginx.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7937e6b..a742919 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,3 +7,12 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + +location /live/websocket { + proxy_pass http://127.0.0.1:__PORT__; + + # these configurations are necessary to proxy WebSocket requests + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} From bc65e8fa3a51e40864c8613b13e585a1931d77a2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 17:56:56 +0200 Subject: [PATCH 096/260] Change root dir https://github.com/bonfire-networks/bonfire-app/commit/3b99906170be9fcb56c3d5faa7e7d9882fa1efe8 > If you've built from source, you should point the nginx root directory to be `_build/prod/rel/bonfire/lib/bonfire-0.1.0-*/priv/static` --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index a742919..ea36772 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/; + alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.1.0-*/priv/static; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 4478d89c0923532bbe801e872f419cebbe368de2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 23:24:09 +0200 Subject: [PATCH 097/260] Media upload size + trying with just as root --- scripts/install | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 18a5b23..bf26b94 100644 --- a/scripts/install +++ b/scripts/install @@ -37,14 +37,15 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -# max file upload size -MEDIA_UPLOAD_SIZE="${media_upload_size:0:2}000000" # convert the MB argument in bytes - ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" +# max file upload size +MEDIA_UPLOAD_SIZE="${media_upload_size:0:2}000000" # convert the MB argument in bytes +ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$(MEDIA_UPLOAD_SIZE)" --target_file="$install_dir/.env" + #================================================= # SPECIFIC SETUP #================================================= @@ -69,7 +70,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" +ynh_exec_warn just config ynh_exec_warn cat .env From bd61d6d32b8e34c8745a31ca267ba4b569ebc905 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 23:43:56 +0200 Subject: [PATCH 098/260] cleaning + execute just as root --- scripts/install | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index bf26b94..c0f3fb0 100644 --- a/scripts/install +++ b/scripts/install @@ -70,16 +70,15 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +ynh_exec_warn cat .env ynh_exec_warn just config - ynh_exec_warn cat .env #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just rel-build" -ynh_exec_warn ls +ynh_exec_warn just rel-build #================================================= # Run the release @@ -88,14 +87,14 @@ release_folder="_build/prod/rel/bonfire" ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_exec_warn just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()' ynh_script_progression --message="Starting Bonfire..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start" +ynh_exec_warn just cmd $release_folder/bin/bonfire start # start bonfire as a daemon ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" +ynh_exec_warn ynh_exec_as just cmd $release_folder/bin/bonfire start daemon #================================================= # END OF SCRIPT From 28b34e9702de11e8c0f12d6b868f2c1ac9887534 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 2 May 2023 23:45:57 +0200 Subject: [PATCH 099/260] typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c0f3fb0..5d91f78 100644 --- a/scripts/install +++ b/scripts/install @@ -44,7 +44,7 @@ chown $app:$app "$install_dir/.env" # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size:0:2}000000" # convert the MB argument in bytes -ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$(MEDIA_UPLOAD_SIZE)" --target_file="$install_dir/.env" +ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" #================================================= # SPECIFIC SETUP From 5f5ee5646177e6c40a5cb70794eec4715eca4ba1 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 00:03:21 +0200 Subject: [PATCH 100/260] Add Elixir (13) repository --- scripts/install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 5d91f78..95917cc 100644 --- a/scripts/install +++ b/scripts/install @@ -48,6 +48,12 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= # SPECIFIC SETUP +#================================================= +# Elixir 13 dependency +#================================================= +# Bulleyes comes with v1.10 instead of v1.13 that is required +ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' + #================================================= # Just dependency #================================================= From c1ac1f4b15d22d7567b92c13e02c53160e896388 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 00:23:52 +0200 Subject: [PATCH 101/260] hex dependency --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 95917cc..71c1950 100644 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn cat .env -ynh_exec_warn just config +ynh_exec_warn mix local.hex --force just config # install Hex in non-interractive way ynh_exec_warn cat .env #================================================= @@ -100,7 +100,7 @@ ynh_exec_warn just cmd $release_folder/bin/bonfire start # start bonfire as a daemon ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn ynh_exec_as just cmd $release_folder/bin/bonfire start daemon +ynh_exec_warn just cmd $release_folder/bin/bonfire start daemon #================================================= # END OF SCRIPT From ad3e87eca1ec84b04ede586a992a313096f7c620 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 00:50:11 +0200 Subject: [PATCH 102/260] needs erlang-dev for Hex dependency --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 71c1950..657d5ae 100644 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,8 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str # Elixir 13 dependency #================================================= # Bulleyes comes with v1.10 instead of v1.13 that is required -ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' +ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir erlang-dev" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' +# exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files #================================================= # Just dependency From 465e1cbf064f1c21eb27d9abf6cf9b2c13092ea6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 00:59:36 +0200 Subject: [PATCH 103/260] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 657d5ae..fe7f707 100644 --- a/scripts/install +++ b/scripts/install @@ -52,8 +52,8 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str # Elixir 13 dependency #================================================= # Bulleyes comes with v1.10 instead of v1.13 that is required -ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir erlang-dev" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' -# exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files +ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' +# exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo #================================================= # Just dependency From 100dc01a264c3d6a21ab9a9fcf4fcafce97fa1c4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 01:00:10 +0200 Subject: [PATCH 104/260] add erlang-dev --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 0990d3a..3f08a06 100644 --- a/manifest.toml +++ b/manifest.toml @@ -94,7 +94,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir" + packages = "postgresql elixir erlang-dev" [resources.database] type = "postgresql" From 1afc71275f47e40ad4ebc6aa39ae160240b10930 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 01:11:17 +0200 Subject: [PATCH 105/260] add erlang-parsetools (Mix.Error) Could not compile "src/link_text_parser.yrl" because the application "parsetools" could not be found. This may happen if your package manager broke Erlang into multiple packages and may be fixed by installing the missing "erlang-dev" and "erlang-parsetools" packages --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 3f08a06..9c15e9f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -94,7 +94,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev" + packages = "postgresql elixir erlang-dev erlang-parsetools" [resources.database] type = "postgresql" From 9cc1abe8a20d622f19462f3f39956c3ef32afa41 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 09:22:13 +0200 Subject: [PATCH 106/260] Update to latest main branch commit --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9c15e9f..9ad27e0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Bonfire" description.en = "Federated social networking server built on ActivityPub open protocol" description.fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" -version = "0.9.0-beta10~ynh1" +version = "0.9.0-beta10~ynh2" maintainers = ["Lapineige"] @@ -81,8 +81,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.0-beta.10.tar.gz" - sha256 = "1d8233abf2d59a5244957043d3449f01cf7fe49974eb40e3a057bda949f71bf8" + url = "https://github.com/bonfire-networks/bonfire-app/archive/e2f382587f2cf14d5f469216dc72bea0064f667b.tar.gz" + sha256 = "de932fd77f8b721191554df0c0e4aeae6b2f222c7c9ea087fa1ddec8d35e3193" [resources.ports] From c7cb7f037e7114b60cb706742009647b36918c73 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 3 May 2023 07:22:18 +0000 Subject: [PATCH 107/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78999e9..54c51d2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.0-beta10~ynh1 +**Shipped version:** 0.9.0-beta10~ynh2 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index f10ddf8..830d763 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.0-beta10~ynh1 +**Version incluse :** 0.9.0-beta10~ynh2 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 8189b0a0d6fb153d9cc64c4eaab2abcce9405f9d Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 09:23:21 +0200 Subject: [PATCH 108/260] cleanup logging + add more --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index fe7f707..2e55116 100644 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,6 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn cat .env ynh_exec_warn mix local.hex --force just config # install Hex in non-interractive way ynh_exec_warn cat .env @@ -87,6 +86,8 @@ ynh_exec_warn cat .env ynh_script_progression --message="Building Bonfire release..." --weight=1 ynh_exec_warn just rel-build +ynh_exec_warn ls _build + #================================================= # Run the release #================================================= From 107c7ccc78b1b663d95abb45ca088292d87d01e0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 09:38:36 +0200 Subject: [PATCH 109/260] More realistic RAM values + more media options --- manifest.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9ad27e0..7dc6f6c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,8 +23,8 @@ multi_instance = false architectures = "all" ldap = false sso = false -disk = "500M" -ram.build = "500M" +disk = "1000M" +ram.build = "300M" ram.runtime = "500M" [install] @@ -69,10 +69,11 @@ ram.runtime = "500M" "20MB", "35MB", "50MB", + "70MB", "100MB", "150MB" ] - default = "20MB" + default = "35MB" help.en = "Maximum size of the media uploaded. Can be changed later." help.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." From 4621c97ae7aece52811372acb03e04020960ccf7 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 09:40:03 +0200 Subject: [PATCH 110/260] No change URL - doesn't make sense for such an app --- scripts/change_url | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url deleted file mode 100644 index 4ba8cf7..0000000 --- a/scripts/change_url +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 - -ynh_change_url_nginx_config - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Change of URL completed for $app" --last From 43c05810dfea9898a7db967628df2a6481eea75a Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 09:43:15 +0200 Subject: [PATCH 111/260] HOME variable --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 2e55116..dc73613 100644 --- a/scripts/install +++ b/scripts/install @@ -77,6 +77,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +HOME=$install_dir ynh_exec_warn mix local.hex --force just config # install Hex in non-interractive way ynh_exec_warn cat .env From 68cd947b060169805ea8dfb3d03f5e7e15804aab Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 10:09:47 +0200 Subject: [PATCH 112/260] Execute just as Bonfire (again) --- scripts/install | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index dc73613..af6e9b6 100644 --- a/scripts/install +++ b/scripts/install @@ -77,15 +77,14 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -HOME=$install_dir -ynh_exec_warn mix local.hex --force just config # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force just config" # install Hex in non-interractive way ynh_exec_warn cat .env #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn just rel-build +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just rel-build" ynh_exec_warn ls _build @@ -96,14 +95,14 @@ release_folder="_build/prod/rel/bonfire" ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations -ynh_exec_warn just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()' +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc ""just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 -ynh_exec_warn just cmd $release_folder/bin/bonfire start +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start" # start bonfire as a daemon ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn just cmd $release_folder/bin/bonfire start daemon +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" #================================================= # END OF SCRIPT From aff78893c287e95ab6cd7220f4a13049f35cf447 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 10:19:39 +0200 Subject: [PATCH 113/260] typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index af6e9b6..b9c112a 100644 --- a/scripts/install +++ b/scripts/install @@ -95,7 +95,7 @@ release_folder="_build/prod/rel/bonfire" ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc ""just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start" From 9870d5426136be75b1ee07061a2102f5e87ac86e Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 11:36:07 +0200 Subject: [PATCH 114/260] fix double --- manifest.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8c27436..171f1cb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,6 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -description.en = "Federated social networking server built on ActivityPub open protocol" -description.fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub" version = "0.9.0-beta10~ynh2" From d6d4548cacbf18bb732983b561aba0c63f6ddcc3 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 11:54:12 +0200 Subject: [PATCH 115/260] add yarn/npm --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 171f1cb..2a0efb2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools" + packages = "postgresql elixir erlang-dev erlang-parsetools yarn npm" [resources.database] type = "postgresql" From 2974d0ec68a732bd1e7025b3c201f27e4c6df678 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 14:05:51 +0200 Subject: [PATCH 116/260] build as root --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b9c112a..534cb90 100644 --- a/scripts/install +++ b/scripts/install @@ -84,7 +84,7 @@ ynh_exec_warn cat .env # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just rel-build" +ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules ynh_exec_warn ls _build From ae4fc56755fb6eee380cbe3c1328a78c919be55f Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 14:17:04 +0200 Subject: [PATCH 117/260] terminfo debug --- scripts/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index 534cb90..30e8011 100644 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,10 @@ ynh_exec_warn cat .env # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 +ynh_exec_warn $(env | grep TERM) +ynh_exec_warn wheris terminfo +export TERM=linux +export TERMINFO=/etc/terminfo ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules ynh_exec_warn ls _build From 5f0060abef8d36048c4582653f373c088da30514 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 14:38:23 +0200 Subject: [PATCH 118/260] adjust logging --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 30e8011..5f3f230 100644 --- a/scripts/install +++ b/scripts/install @@ -78,15 +78,15 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force just config" # install Hex in non-interractive way -ynh_exec_warn cat .env +ynh_exec_warn_less cat .env #================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn $(env | grep TERM) -ynh_exec_warn wheris terminfo -export TERM=linux +ynh_exec_warn env +ynh_exec_warn ls -l /etc/terminfo +export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules From 544d7ceaaf43defa786818859d0f2c95ed467b2c Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 15:08:22 +0200 Subject: [PATCH 119/260] Install correct yarn version > ERROR: There are no scenarios; must have at least one. https://stackoverflow.com/questions/53471063/yarn-error-there-are-no-scenarios-must-have-at-least-one --- scripts/install | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5f3f230..8f2c1dd 100644 --- a/scripts/install +++ b/scripts/install @@ -51,14 +51,21 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= # Elixir 13 dependency #================================================= +ynh_script_progression --message="Managing special dependencies..." --weight=1 # Bulleyes comes with v1.10 instead of v1.13 that is required ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo +#================================================= +# Yarn dependency (correct version) +#================================================= + +ynh_install_extra_app_dependencies --repo="https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key='https://dl.yarnpkg.com/debian/pubkey.gpg' + #================================================= # Just dependency #================================================= -ynh_script_progression --message="Managing special dependencies..." --weight=1 + ### Add just dependency # TODO : this is unsafe and should be dealt with in a better way. # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages From 57e50c015acd06959dcac17c59799c1ab74ba54d Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 15:09:00 +0200 Subject: [PATCH 120/260] remove yarn and npm (bad version) --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2a0efb2..171f1cb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools yarn npm" + packages = "postgresql elixir erlang-dev erlang-parsetools" [resources.database] type = "postgresql" From 9e8b88caf9a6d6ed0ed72c810de4c05896b58c65 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 15:15:15 +0200 Subject: [PATCH 121/260] bring back npm --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 171f1cb..62290a2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools" + packages = "postgresql elixir erlang-dev erlang-parsetools npm" [resources.database] type = "postgresql" From fd01be5331dd6c7598701c2b67e73146d42016d6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 15:15:54 +0200 Subject: [PATCH 122/260] remove some logging --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 8f2c1dd..89645d8 100644 --- a/scripts/install +++ b/scripts/install @@ -91,8 +91,6 @@ ynh_exec_warn_less cat .env # Building the release #================================================= ynh_script_progression --message="Building Bonfire release..." --weight=1 -ynh_exec_warn env -ynh_exec_warn ls -l /etc/terminfo export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules From 9e60baaab6c6f48242e50f865c59ec030beb0394 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 18:27:23 +0200 Subject: [PATCH 123/260] remove npm global install --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 62290a2..171f1cb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools npm" + packages = "postgresql elixir erlang-dev erlang-parsetools" [resources.database] type = "postgresql" From c16b1e1a532c2a3e86465da5f26fa562a22e7edf Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 18:31:22 +0200 Subject: [PATCH 124/260] use ynh_npm --- scripts/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 89645d8..ad4b3d4 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,9 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_install_nodejs +ynh_use_nodejs + secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) encryption_salt=$(ynh_string_random --length=24) @@ -93,7 +96,8 @@ ynh_exec_warn_less cat .env ynh_script_progression --message="Building Bonfire release..." --weight=1 export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo -ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules +ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "just rel-build" +#ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules ynh_exec_warn ls _build From b0aa28b414f2c0dc9c8d3525c020c5a5aa48acac Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 21:48:38 +0200 Subject: [PATCH 125/260] set a nodejs version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Random one… --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ad4b3d4..bfbd526 100644 --- a/scripts/install +++ b/scripts/install @@ -9,7 +9,7 @@ source _common.sh source /usr/share/yunohost/helpers -ynh_install_nodejs +ynh_install_nodejs -nodejs_version=16.13.0 ynh_use_nodejs secret_key_base=$(ynh_string_random --length=24) From 44f04a2a0f4f0fe4b80929670184fff37713cde8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 3 May 2023 21:55:34 +0200 Subject: [PATCH 126/260] typo + comment --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bfbd526..2fd2055 100644 --- a/scripts/install +++ b/scripts/install @@ -9,7 +9,7 @@ source _common.sh source /usr/share/yunohost/helpers -ynh_install_nodejs -nodejs_version=16.13.0 +ynh_install_nodejs --nodejs_version=16.13.0 # TODO : need to decide of a better version ynh_use_nodejs secret_key_base=$(ynh_string_random --length=24) From e7c4119e7a7ed61335bc1f4f78aad93275b28a36 Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 4 May 2023 09:09:18 +0200 Subject: [PATCH 127/260] split mix and just commands --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 2fd2055..918d2db 100644 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,8 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force just config" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" ynh_exec_warn_less cat .env #================================================= From 2b375f5ab98d612275974c6fe3b69f009365721f Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 4 May 2023 09:10:17 +0200 Subject: [PATCH 128/260] bring back npm --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 171f1cb..62290a2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools" + packages = "postgresql elixir erlang-dev erlang-parsetools npm" [resources.database] type = "postgresql" From 4acd10d82a0f75c4589456a4ab3bb2634fec8538 Mon Sep 17 00:00:00 2001 From: lapineige Date: Thu, 4 May 2023 12:14:55 +0200 Subject: [PATCH 129/260] fix syntax CI is stuck https://ci-apps-dev.yunohost.org/ci/job/7102 --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 918d2db..e6a552c 100644 --- a/scripts/install +++ b/scripts/install @@ -87,8 +87,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" # install Hex in non-interractive way -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force && just config" # install Hex in non-interractive way ynh_exec_warn_less cat .env #================================================= From 612eb43bbf397d50443f134276ebcd24fd25189b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 6 May 2023 23:01:13 +0200 Subject: [PATCH 130/260] =?UTF-8?q?what=20if=20it's=20root=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e6a552c..829f4a6 100644 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force && just config" # install Hex in non-interractive way +ynh_exec_warn "mix local.hex --force && just config" # install Hex in non-interractive way ynh_exec_warn_less cat .env #================================================= From 300ff59464179c220e40e93609e9cee30fe60ce0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 6 May 2023 23:42:50 +0200 Subject: [PATCH 131/260] revert --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 829f4a6..b25f23c 100644 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,7 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn "mix local.hex --force && just config" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force && just config" # install Hex in non-interractive way ynh_exec_warn_less cat .env #================================================= From 2d4d0014a2876ba2aa3f71a11500db7dfd859784 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 6 May 2023 23:55:04 +0200 Subject: [PATCH 132/260] split again --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b25f23c..f6af629 100644 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,8 @@ source $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force && just config" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" # install Hex in non-interractive way ynh_exec_warn_less cat .env #================================================= From ad958346d8a8f799bd6dc1d699b69c2712e8ed95 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 11 Aug 2023 11:06:06 +0200 Subject: [PATCH 133/260] 0.9.6 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 62290a2..3d62e42 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.0-beta10~ynh2" +version = "0.9.6-beta~ynh1" maintainers = ["Lapineige"] @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/e2f382587f2cf14d5f469216dc72bea0064f667b.tar.gz" - sha256 = "de932fd77f8b721191554df0c0e4aeae6b2f222c7c9ea087fa1ddec8d35e3193" + url = "https://github.com/bonfire-networks/bonfire-app/archive/d5a159a576937e71d71db4d0ceda840b3d303f5d.tar.gz" + sha256 = "0f31287b7005f6f58ebeff8cae98cea8c442f08d0cd410da67c37b19513697f2" [resources.ports] From 9d570390c4577561dd52a5f0a63560ac8d3fe7d9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 11 Aug 2023 09:06:09 +0000 Subject: [PATCH 134/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54c51d2..eee514e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.0-beta10~ynh2 +**Shipped version:** 0.9.6-beta~ynh1 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 830d763..5a252a1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.0-beta10~ynh2 +**Version incluse :** 0.9.6-beta~ynh1 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From dd9c870dfa1ba0ac845d6063c7646269a5957d88 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 11 Aug 2023 11:15:19 +0200 Subject: [PATCH 135/260] clearer version name --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 3d62e42..087e140 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.6-beta~ynh1" +version = "0.9.6-classic-beta.2~ynh1" maintainers = ["Lapineige"] From 5ceb82877a5eea47eea68f11da1a970c33154807 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 11 Aug 2023 09:15:22 +0000 Subject: [PATCH 136/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eee514e..8576ab5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.6-beta~ynh1 +**Shipped version:** 0.9.6-classic-beta.2~ynh1 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 5a252a1..ac2a9c6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.6-beta~ynh1 +**Version incluse :** 0.9.6-classic-beta.2~ynh1 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 0c7064d376702c3bd741cccbbfc0661715aff7fb Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 12:54:59 +0200 Subject: [PATCH 137/260] Update elixir version to v1.15 https://github.com/bonfire-networks/bonfire-app/commit/20707e8fa07e8ccd3e4a3a9c2ad549b378f8f508 https://github.com/bonfire-networks/bonfire-app/blob/main/docs/DEPLOY.md#dependencies --- scripts/install | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index f6af629..f107f8d 100644 --- a/scripts/install +++ b/scripts/install @@ -52,11 +52,16 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= # SPECIFIC SETUP #================================================= -# Elixir 13 dependency +# Elixir 15 dependency #================================================= ynh_script_progression --message="Managing special dependencies..." --weight=1 -# Bulleyes comes with v1.10 instead of v1.13 that is required -ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' +# Bulleyes comes with v1.10 instead of v1.15 that is required +# ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' +# v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now +add-apt-repository ppa:rabbitmq/rabbitmq-erlang -y # erlang 26 +apt update +apt install elixir # v1.15 + # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo #================================================= From 5812be156646fa512d766b211082b689c689f9ec Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:00:26 +0200 Subject: [PATCH 138/260] debug --- scripts/install | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f107f8d..44d871c 100644 --- a/scripts/install +++ b/scripts/install @@ -87,13 +87,24 @@ ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-m #makedeb -si #cd .. -export WITH_DOCKER=no # or source .env ? +# export WITH_DOCKER=no # or source .env ? # Using this for now source $install_dir/.env +# TODO Debug +ynh_exec_warn_less echo 'Debug install dir ENV file' +ynh_exec_warn_less cat $install_dir/.env +ynh_exec_warn_less echo 'Debug local ENV file' +ynh_exec_warn_less cat .env + ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" # install Hex in non-interractive way + +# TODO Debug +ynh_exec_warn_less echo 'Debug install dir ENV file' +ynh_exec_warn_less cat $install_dir/.env +ynh_exec_warn_less echo 'Debug local ENV file' ynh_exec_warn_less cat .env #================================================= From eb126eb7f9aead33e8a43d2af38aee1de14aa99f Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:08:17 +0200 Subject: [PATCH 139/260] fix media_upload_size extraction --- scripts/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 44d871c..b67e314 100644 --- a/scripts/install +++ b/scripts/install @@ -46,7 +46,10 @@ chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" # max file upload size -MEDIA_UPLOAD_SIZE="${media_upload_size:0:2}000000" # convert the MB argument in bytes +MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" + +"${media_upload_size:0:2}000000" # convert the MB argument in bytes +STRING="5MB,10MB"; echo ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" #================================================= From 64c11ca35f55d76362cc7cc563964041877047a5 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:12:52 +0200 Subject: [PATCH 140/260] fix elixir 1.15 syntax --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b67e314..61d4c94 100644 --- a/scripts/install +++ b/scripts/install @@ -61,9 +61,9 @@ ynh_script_progression --message="Managing special dependencies..." --weight=1 # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now -add-apt-repository ppa:rabbitmq/rabbitmq-erlang -y # erlang 26 -apt update -apt install elixir # v1.15 + +ynh_install_extra_app_dependencies --repo="https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu/ jammy main" --package="elixir-lang" --key='https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc' +# erlang 26, for elixir v1.15 # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo From 4eecff3c107afd3f6d222150e3678ff18c5e8afa Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:16:23 +0200 Subject: [PATCH 141/260] cleaning --- scripts/install | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install b/scripts/install index 61d4c94..d1e39e8 100644 --- a/scripts/install +++ b/scripts/install @@ -47,9 +47,6 @@ chown $app:$app "$install_dir/.env" # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" - -"${media_upload_size:0:2}000000" # convert the MB argument in bytes -STRING="5MB,10MB"; echo ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" #================================================= From c289becbe58e5e7592a67ab67c6a81ebf0942ff1 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:31:26 +0200 Subject: [PATCH 142/260] migrating to proper packaging v2 for app extra --- scripts/install | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/scripts/install b/scripts/install index d1e39e8..42dc190 100644 --- a/scripts/install +++ b/scripts/install @@ -52,40 +52,7 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= # SPECIFIC SETUP #================================================= -# Elixir 15 dependency -#================================================= -ynh_script_progression --message="Managing special dependencies..." --weight=1 -# Bulleyes comes with v1.10 instead of v1.15 that is required -# ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' -# v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now -ynh_install_extra_app_dependencies --repo="https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu/ jammy main" --package="elixir-lang" --key='https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc' -# erlang 26, for elixir v1.15 - -# exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo - -#================================================= -# Yarn dependency (correct version) -#================================================= - -ynh_install_extra_app_dependencies --repo="https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key='https://dl.yarnpkg.com/debian/pubkey.gpg' - -#================================================= -# Just dependency -#================================================= - -### Add just dependency -# TODO : this is unsafe and should be dealt with in a better way. -# There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages - -# only works for x86, we need to switch to the other option with makedeb package ? -ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org prebuilt-mpr bullseye" --package="just" --key='https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' - -#ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="https://proget.makedeb.org makedeb main" --package="makedeb" --key='https://proget.makedeb.org/debian-feeds/makedeb.pub' -#git clone 'https://mpr.makedeb.org/just' -#cd just -#makedeb -si -#cd .. # export WITH_DOCKER=no # or source .env ? # Using this for now source $install_dir/.env From 5dc00275c3f4cfd81b95f594debc3f1d20d400cb Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:37:26 +0200 Subject: [PATCH 143/260] migrating to proper packaging v2 for app extra --- manifest.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/manifest.toml b/manifest.toml index 087e140..50546e5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,5 +104,31 @@ ram.runtime = "500M" [resources.apt] packages = "postgresql elixir erlang-dev erlang-parsetools npm" + ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) + + ### Yarn dependency (correct version) + extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" + extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" + extras.yarn.packages = ["yarn"] + + ### Elixir 15 dependency + ynh_script_progression --message="Managing special dependencies..." --weight=1 + # Bulleyes comes with v1.10 instead of v1.15 that is required + # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' + # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now + # erlang 26, for elixir v1.15 + extras.elixir.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" + extras.elixir.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" + extras.elixir.packages = ["elixir-lang"] + # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo + + ### just dependency + # TODO : this is unsafe and should be dealt with in a better way. + # There is currently no proper way to install it simply on Debian 11 https://github.com/casey/just#packages + # only works for x86, we need to switch to the other option with makedeb package ? + extras.just.repo = "deb https://proget.makedeb.org prebuilt-mpr bullseye" + extras.just.key = "https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" + extras.just.packages = ["just"] + [resources.database] type = "postgresql" From 6ff6f7ca48ce32b198b927421621033bcc29fbeb Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:42:48 +0200 Subject: [PATCH 144/260] cleaning --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 50546e5..b74c843 100644 --- a/manifest.toml +++ b/manifest.toml @@ -112,7 +112,6 @@ ram.runtime = "500M" extras.yarn.packages = ["yarn"] ### Elixir 15 dependency - ynh_script_progression --message="Managing special dependencies..." --weight=1 # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now From cf94851461f1e67a18f737bf05828c32a1709820 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:50:13 +0200 Subject: [PATCH 145/260] ask instead of help --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index b74c843..d4565a2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,8 +46,8 @@ ram.runtime = "500M" default = "visitors" [install.language] - help.en = "Choose the application language" - help.fr = "Choisissez la langue de l'application" + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" type = "string" choices = ["fr", "en"] default = "fr" @@ -76,8 +76,8 @@ ram.runtime = "500M" "150MB" ] default = "35MB" - help.en = "Maximum size of the media uploaded. Can be changed later." - help.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." + ask.en = "Maximum size of the media uploaded. Can be changed later." + ask.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." [resources] From c889f5498f96b82c8b9d7ed7374216502c6d5419 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 13:51:34 +0200 Subject: [PATCH 146/260] use correct type --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index d4565a2..4d63dd6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "500M" type = "password" [install.media_upload_size] - type = "string" + type = "select" choices = [ "1MB", "2MB", From 92b12274a301384430335ff9296c95240884ad32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 13:52:50 +0200 Subject: [PATCH 147/260] Fix linter --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index b74c843..5f66c1d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,8 +46,8 @@ ram.runtime = "500M" default = "visitors" [install.language] - help.en = "Choose the application language" - help.fr = "Choisissez la langue de l'application" + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" type = "string" choices = ["fr", "en"] default = "fr" @@ -61,6 +61,8 @@ ram.runtime = "500M" type = "password" [install.media_upload_size] + ask.en = "Choose the maximum size of the media uploaded. Can be changed later." + ask.fr = "Choisissez la taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." type = "string" choices = [ "1MB", @@ -76,8 +78,6 @@ ram.runtime = "500M" "150MB" ] default = "35MB" - help.en = "Maximum size of the media uploaded. Can be changed later." - help.fr = "Taille maximale des médias mis en ligne. Peut-être modifié ultérieurement." [resources] From 34976895e0360305434850569cc856e9e6503e8b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 14:01:15 +0200 Subject: [PATCH 148/260] use elixir --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 83e7ea1..b6bd323 100644 --- a/manifest.toml +++ b/manifest.toml @@ -118,7 +118,7 @@ ram.runtime = "500M" # erlang 26, for elixir v1.15 extras.elixir.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" extras.elixir.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - extras.elixir.packages = ["elixir-lang"] + extras.elixir.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### just dependency From 9245c8fc106c4173980598afa4e9c5ede3528ba2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 17:10:24 +0200 Subject: [PATCH 149/260] remove doubles in dependancy --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b6bd323..0e754b9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "500M" main.url = "/" [resources.apt] - packages = "postgresql elixir erlang-dev erlang-parsetools npm" + packages = "postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 8ff5beb7020b7e1693eb075b282866e2ad5d6fca Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 12 Aug 2023 17:23:57 +0200 Subject: [PATCH 150/260] test for elixir --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 0e754b9..4de59a0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -118,7 +118,7 @@ ram.runtime = "500M" # erlang 26, for elixir v1.15 extras.elixir.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" extras.elixir.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - extras.elixir.packages = ["elixir"] + extras.elixir.packages = ["elixir-lang"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### just dependency From 7bee532625af5cd0b25258f97faea9fe4b36f19c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 10:49:36 +0200 Subject: [PATCH 151/260] 0.9.6-beta.3 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4de59a0..8b4830c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.6-classic-beta.2~ynh1" +version = "0.9.6~ynh3" maintainers = ["Lapineige"] @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/d5a159a576937e71d71db4d0ceda840b3d303f5d.tar.gz" - sha256 = "0f31287b7005f6f58ebeff8cae98cea8c442f08d0cd410da67c37b19513697f2" + url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.6-beta.3.tar.gz" + sha256 = "9ba0701bf7c4f30b155b2b18119744c1e7efb49cbf67fe3084675a964196d4a9" [resources.ports] From 080819d33b1e17b37dac83f3f89ab96c24610783 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 13 Aug 2023 08:49:39 +0000 Subject: [PATCH 152/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8576ab5..3e15def 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.6-classic-beta.2~ynh1 +**Shipped version:** 0.9.6~ynh3 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index ac2a9c6..877802d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.6-classic-beta.2~ynh1 +**Version incluse :** 0.9.6~ynh3 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 3bfb02f788605331bc5126f213e5f0487966674c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 10:54:30 +0200 Subject: [PATCH 153/260] Elixir 13 --- manifest.toml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8b4830c..727860c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -110,15 +110,20 @@ ram.runtime = "500M" extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" extras.yarn.packages = ["yarn"] - + + + ### Elixir 13 dependency - instead of v15 for now + extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" + extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" + extras.elixir13.packages = ["elixir-lang"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now # erlang 26, for elixir v1.15 - extras.elixir.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" - extras.elixir.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - extras.elixir.packages = ["elixir-lang"] + #extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" + #extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" + #extras.elixir15.packages = ["elixir-lang"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### just dependency From cc140296e9bdae7d713a5bec425034e0dd604869 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 10:59:18 +0200 Subject: [PATCH 154/260] fix elixir package name --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 727860c..d0cf301 100644 --- a/manifest.toml +++ b/manifest.toml @@ -115,7 +115,7 @@ ram.runtime = "500M" ### Elixir 13 dependency - instead of v15 for now extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" - extras.elixir13.packages = ["elixir-lang"] + extras.elixir13.packages = ["elixir"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' From f98f47177bc70c697ba85f77f05e8c7b6ea345dc Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 11:15:41 +0200 Subject: [PATCH 155/260] debug --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 42dc190..54d5a27 100644 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,8 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str source $install_dir/.env # TODO Debug +ynh_exec_warn_less pwd +ynh_exec_warn_less ls -al ynh_exec_warn_less echo 'Debug install dir ENV file' ynh_exec_warn_less cat $install_dir/.env ynh_exec_warn_less echo 'Debug local ENV file' From 92361263c6ebd5c3bd97351f7e44dea260d03774 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 11:21:45 +0200 Subject: [PATCH 156/260] debug --- scripts/install | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 54d5a27..b842a61 100644 --- a/scripts/install +++ b/scripts/install @@ -58,12 +58,8 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str source $install_dir/.env # TODO Debug -ynh_exec_warn_less pwd -ynh_exec_warn_less ls -al ynh_exec_warn_less echo 'Debug install dir ENV file' ynh_exec_warn_less cat $install_dir/.env -ynh_exec_warn_less echo 'Debug local ENV file' -ynh_exec_warn_less cat .env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir @@ -73,8 +69,6 @@ ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" # install Hex in non- # TODO Debug ynh_exec_warn_less echo 'Debug install dir ENV file' ynh_exec_warn_less cat $install_dir/.env -ynh_exec_warn_less echo 'Debug local ENV file' -ynh_exec_warn_less cat .env #================================================= # Building the release @@ -85,6 +79,7 @@ export TERMINFO=/etc/terminfo ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "just rel-build" #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules +ynh_exec_warn ls -a ynh_exec_warn ls _build #================================================= From fbe0f94ffcde4cd148fd9a256771a0d2a6082a59 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 11:37:24 +0200 Subject: [PATCH 157/260] don't use docker --- scripts/install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index b842a61..3213613 100644 --- a/scripts/install +++ b/scripts/install @@ -53,22 +53,22 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str # SPECIFIC SETUP #================================================= - -# export WITH_DOCKER=no # or source .env ? # Using this for now source $install_dir/.env +export WITH_DOCKER=no # or source .env ? # Using this for now # TODO Debug -ynh_exec_warn_less echo 'Debug install dir ENV file' -ynh_exec_warn_less cat $install_dir/.env +ynh_exec_warn echo 'Debug install dir ENV file' +ynh_exec_warn cat $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just mix bonfire.deps .update" # TODO Debug -ynh_exec_warn_less echo 'Debug install dir ENV file' -ynh_exec_warn_less cat $install_dir/.env +ynh_exec_warn echo 'Debug install dir ENV file' +ynh_exec_warn cat $install_dir/.env #================================================= # Building the release From 5485c155a6f4215301dab70bf88a76e0bdea4955 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 11:42:25 +0200 Subject: [PATCH 158/260] fix WITH_DOCKER syntax --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3213613..aaca8d5 100644 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= source $install_dir/.env -export WITH_DOCKER=no # or source .env ? # Using this for now +export WITH_DOCKER="no" # or source .env ? # Using this for now # TODO Debug ynh_exec_warn echo 'Debug install dir ENV file' From c535aba287dca9cfaedf75df91854b242ce8d631 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 12:00:00 +0200 Subject: [PATCH 159/260] debug and cleaning --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index aaca8d5..a4ef3c9 100644 --- a/scripts/install +++ b/scripts/install @@ -58,13 +58,14 @@ export WITH_DOCKER="no" # or source .env ? # Using this for now # TODO Debug ynh_exec_warn echo 'Debug install dir ENV file' +ynh_exec_warn ls ./config/prod/ ynh_exec_warn cat $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" # install Hex in non-interractive way -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just mix bonfire.deps .update" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just mix bonfire.deps .update" # TODO Debug ynh_exec_warn echo 'Debug install dir ENV file' From 63ebd1ab976ff900f97613524c30176498751a4b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 12:11:01 +0200 Subject: [PATCH 160/260] =?UTF-8?q?don't=20use=20docker=20for=20real?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index a4ef3c9..4766c6c 100644 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str #================================================= source $install_dir/.env -export WITH_DOCKER="no" # or source .env ? # Using this for now +export WITH_DOCKER=no # or source .env ? # Using this for now # TODO Debug ynh_exec_warn echo 'Debug install dir ENV file' @@ -63,9 +63,9 @@ ynh_exec_warn cat $install_dir/.env ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "mix local.hex --force" # install Hex in non-interractive way -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just config" -#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just mix bonfire.deps .update" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config" +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" # TODO Debug ynh_exec_warn echo 'Debug install dir ENV file' @@ -77,7 +77,7 @@ ynh_exec_warn cat $install_dir/.env ynh_script_progression --message="Building Bonfire release..." --weight=1 export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo -ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "just rel-build" +ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules ynh_exec_warn ls -a @@ -90,14 +90,14 @@ release_folder="_build/prod/rel/bonfire" ynh_script_progression --message="Running database migrations..." --weight=1 # Database created before, let's run the migrations -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" # start bonfire as a daemon ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "just cmd $release_folder/bin/bonfire start daemon" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start daemon" #================================================= # END OF SCRIPT From b3f6882bf34fe5e21274623398cc30dcf80022d6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 12:39:22 +0200 Subject: [PATCH 161/260] upgrade to latest release : add just-config-basic --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index d0cf301..58b68cd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.6-beta.3.tar.gz" - sha256 = "9ba0701bf7c4f30b155b2b18119744c1e7efb49cbf67fe3084675a964196d4a9" + url = "https://github.com/bonfire-networks/bonfire-app/archive/1ee3a102e6ab28e2de663c44ffa0434f46181ba9.tar.gz" + sha256 = "592681c19b59217632eda7dd7e8cd70dc0ce1f7088c6f59f95189fc8c76f48f6" [resources.ports] From 8739cce79fa43d416f8231d1004cf5462b02ed27 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 12:40:56 +0200 Subject: [PATCH 162/260] generate secrets / use docker / .env fix --- scripts/install | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 4766c6c..c0ccda5 100644 --- a/scripts/install +++ b/scripts/install @@ -49,6 +49,14 @@ chown $app:$app "$install_dir/.env" MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" +# Secret keys +SECRET_KEY_BASE=$(ynh_string_random) +SIGNING_SALT=$(ynh_string_random) +ENCRYPTION_SALT=$(ynh_string_random) +ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$SECRET_KEY_BASE" --target_file="$install_dir/.env" +ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$SIGNING_SALT" --target_file="$install_dir/.env" +ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$ENCRYPTION_SALT" --target_file="$install_dir/.env" + #================================================= # SPECIFIC SETUP #================================================= @@ -56,15 +64,10 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str source $install_dir/.env export WITH_DOCKER=no # or source .env ? # Using this for now -# TODO Debug -ynh_exec_warn echo 'Debug install dir ENV file' -ynh_exec_warn ls ./config/prod/ -ynh_exec_warn cat $install_dir/.env - ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" # TODO Debug From 03b1c53c1857aad46b211c05f8b38106e0865cca Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 13:05:57 +0200 Subject: [PATCH 163/260] no npm global install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index c0ccda5..5af05d8 100644 --- a/scripts/install +++ b/scripts/install @@ -80,6 +80,8 @@ ynh_exec_warn cat $install_dir/.env ynh_script_progression --message="Building Bonfire release..." --weight=1 export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo +### DONT USE GLOBAL NPM INSTALL +ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules From 0a2296e5f06d8b2b0116791497ede4fdea66b775 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 13:13:29 +0200 Subject: [PATCH 164/260] bump version https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1676323128 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 58b68cd..b3d76a2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/1ee3a102e6ab28e2de663c44ffa0434f46181ba9.tar.gz" - sha256 = "592681c19b59217632eda7dd7e8cd70dc0ce1f7088c6f59f95189fc8c76f48f6" + url = "https://github.com/bonfire-networks/bonfire-app/archive/9641f1e3eb7a303d17759acbe497e54c70cbe4db.tar.gz" + sha256 = "8fade09ebb9f9cace9f8b4bec75ccc3d4a31f65d2240525cdf0c36939e38cbf8" [resources.ports] From ea971ad959901e013b93e0b33501858c06cd4075 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 13:24:08 +0200 Subject: [PATCH 165/260] use yunohost mail config --- manifest.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b3d76a2..790ed5b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -95,7 +95,8 @@ ram.runtime = "500M" [resources.ports] [resources.system_user] - + allow_email = true + [resources.install_dir] [resources.permissions] From 12007dc6735b3f9922d431397b57803cf7efa76e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 13:28:41 +0200 Subject: [PATCH 166/260] complete env file --- conf/.env | 82 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/conf/.env b/conf/.env index 013c24f..fa36513 100644 --- a/conf/.env +++ b/conf/.env @@ -1,19 +1,85 @@ MIX_ENV=prod FLAVOUR=classic -HOSTNAME=__DOMAIN__ +WITH_DOCKER=no + +## OTHER CONFIG ## +# server domain name: +HOSTNAME=__DOMAIN__ +# server port: +SERVER_PORT=__PORT__ +# port your visitors will access (typically 80 or 443, will be different than SERVER_PORT only if using a reverse proxy) +PUBLIC_PORT=443 +# what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets section +MAIL_BACKEND=sendmail +# hostname and port of meili search index +SEARCH_MEILI_INSTANCE=http://localhost:7700 +# require an email address to be invited before being able to sign up +INVITE_ONLY=true + +# uncomment in order to NOT automatically change the database schema when you upgrade the app +# DISABLE_DB_AUTOMIGRATION=true +# max file upload size (default is 20 meg) +UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE +# ==================================== +# You should not have to edit any of the following ones: +POSTGRES_HOST=localhost +LANG=en_US.UTF-8 +LANGUAGE=en_US.UTF-8 +REPLACE_OS_VARS=true +LIVEVIEW_ENABLED=true +POSTGRES_USER=postgres +POSTGRES_DB=bonfire_db +ACME_AGREE=true +SHOW_DEBUG_IN_DEV=true +# PLUG_SERVER=bandit +## SECRETS ## +# make sure you change everything to your own secrets! +# and do not check this into git or any public host + +# for sessions/cookies, you can generate strings for these by running: just secrets SECRET_KEY_BASE=__SECRET_KEY_BASE__ SIGNING_SALT=__SIGNING_SALT__ ENCRYPTION_SALT=__ENCRYPTION_SALT__ -SERVER_PORT=__PORT__ -PUBLIC_PORT=443 +# database access +POSTGRES_PASSWORD=put_a_secure_db_pw_here + +# password for the search index +MEILI_MASTER_KEY=put-a-key-to-protect-the-search-index-here + +## TODO +# email deliverym if you use mailgun.com, edit with your domain and API key +MAIL_DOMAIN=__DOMAIN__ +MAIL_USERNAME=__APP__ +MAIL_KEY=__MAIL_PWD__ +MAIL_FROM=__APP__@__DOMAIN__ # TODO : Configure S3 - with proper Yunohost question during installation -#UPLOADS_S3_BUCKET= -#UPLOADS_S3_ACCESS_KEY_ID= -#UPLOADS_S3_SECRET_ACCESS_KEY= +# Uploads +# UPLOADS_S3_BUCKET= +# UPLOADS_S3_ACCESS_KEY_ID= +# UPLOADS_S3_SECRET_ACCESS_KEY= -UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE +# telemetry API keys +# SENTRY_DSN= +OTEL_ENABLED=0 +# OTEL_HONEYCOMB_API_KEY= +# OTEL_LIGHTSEP_API_KEY= -WITH_DOCKER=no +# default admin user if you generate seed data +SEEDS_USER=root + +# backend stuff +ERLANG_COOKIE=bonfire_cookie + +# Bonfire extensions configs +WEB_PUSH_SUBJECT=mailto:__APP__@__DOMAIN__ +WEB_PUSH_PUBLIC_KEY= +WEB_PUSH_PRIVATE_KEY= +GEOLOCATE_OPENCAGEDATA= +MAPBOX_API_KEY=pk.eyJ1IjoibWF5ZWwiLCJhIjoiY2tlMmxzNXF5MGFpaDJ0bzR2M29id2EzOCJ9.QsmjD-zypsE0_wonLGCYlA +GITHUB_TOKEN= +TX_TOKEN= + +## END OF SECRETS ## From 531c7ce1546c3bff890e7e6897efbbf93b4e7d6a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 14:02:24 +0200 Subject: [PATCH 167/260] cleaning --- scripts/install | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/install b/scripts/install index 5af05d8..9f6c334 100644 --- a/scripts/install +++ b/scripts/install @@ -70,10 +70,6 @@ ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --for ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" -# TODO Debug -ynh_exec_warn echo 'Debug install dir ENV file' -ynh_exec_warn cat $install_dir/.env - #================================================= # Building the release #================================================= @@ -85,9 +81,6 @@ ynh_replace_string --match_string="npm install --global" --replace_string="npm i ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules -ynh_exec_warn ls -a -ynh_exec_warn ls _build - #================================================= # Run the release #================================================= From e8846181714175476121bd5e56ae51ce9c250b58 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 14:04:10 +0200 Subject: [PATCH 168/260] https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1676335197 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 790ed5b..60edb75 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/9641f1e3eb7a303d17759acbe497e54c70cbe4db.tar.gz" - sha256 = "8fade09ebb9f9cace9f8b4bec75ccc3d4a31f65d2240525cdf0c36939e38cbf8" + url = "https://github.com/bonfire-networks/bonfire-app/archive/e1ed9da298906d554aee1a56f6290eb2feefc7b1.tar.gz" + sha256 = "18547d839a89f80662cc25416def2d57548183c0afde6c1f2b3e12a0ae89da9c" [resources.ports] From 276cfe8d7b68ee048813f2ce8e5a687f21b1577f Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 16:48:15 +0200 Subject: [PATCH 169/260] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 60edb75..1b13945 100644 --- a/manifest.toml +++ b/manifest.toml @@ -25,7 +25,7 @@ multi_instance = false architectures = "all" ldap = false sso = false -disk = "1000M" +disk = "2000M" ram.build = "300M" ram.runtime = "500M" From 8efc7deaf8bb4bc9a6016c52c08f0f58ee82f1c7 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 16:55:56 +0200 Subject: [PATCH 170/260] Update manifest.toml https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1676344807 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 1b13945..70a3a08 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/e1ed9da298906d554aee1a56f6290eb2feefc7b1.tar.gz" - sha256 = "18547d839a89f80662cc25416def2d57548183c0afde6c1f2b3e12a0ae89da9c" + url = "https://github.com/bonfire-networks/bonfire-app/archive/d898a7659bfaf47298998dc4f43b378508eee00e.tar.gz" + sha256 = "0fb2058365f035591833287f91faf43de5aac553db53be314143437f756ae224" [resources.ports] From 245e7040bbdbe71f94e95238f1fb19171b1c1eda Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 17:24:08 +0200 Subject: [PATCH 171/260] add more dependencies --- manifest.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 70a3a08..f546830 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,8 +102,12 @@ ram.runtime = "500M" [resources.permissions] main.url = "/" + [resources.database] + # This will automatically provision/deprovison a MySQL DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd + type = "postgresql" + [resources.apt] - packages = "postgresql npm" + packages = "erlang-dev erlang-parsetools postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From ae0da01b5a97d790653e9bd7117010c6c653937e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 17:27:47 +0200 Subject: [PATCH 172/260] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f546830..021b84e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -107,7 +107,7 @@ ram.runtime = "500M" type = "postgresql" [resources.apt] - packages = "erlang-dev erlang-parsetools postgresql npm" + packages = "erlang-dev erlang-parsetools npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From b3fefefbe722da6be04ae9fc4aa4007281ff4891 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 17:28:32 +0200 Subject: [PATCH 173/260] cleaning --- manifest.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 021b84e..9a51938 100644 --- a/manifest.toml +++ b/manifest.toml @@ -107,7 +107,7 @@ ram.runtime = "500M" type = "postgresql" [resources.apt] - packages = "erlang-dev erlang-parsetools npm" + packages = "erlang-dev erlang-parsetools postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) @@ -139,5 +139,3 @@ ram.runtime = "500M" extras.just.key = "https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" extras.just.packages = ["just"] - [resources.database] - type = "postgresql" From e776da7337e9248afecae02631af7702de20a040 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 17:29:17 +0200 Subject: [PATCH 174/260] install DB after the package --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9a51938..5030607 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,9 +102,6 @@ ram.runtime = "500M" [resources.permissions] main.url = "/" - [resources.database] - # This will automatically provision/deprovison a MySQL DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd - type = "postgresql" [resources.apt] packages = "erlang-dev erlang-parsetools postgresql npm" @@ -139,3 +136,6 @@ ram.runtime = "500M" extras.just.key = "https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub" extras.just.packages = ["just"] + + [resources.database] + type = "postgresql" From 8d0e87654ca8318a627a895c55161f662b8c8162 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 17:48:32 +0200 Subject: [PATCH 175/260] cleaning + checksum for .env --- scripts/install | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 9f6c334..4364f1b 100644 --- a/scripts/install +++ b/scripts/install @@ -12,10 +12,6 @@ source /usr/share/yunohost/helpers ynh_install_nodejs --nodejs_version=16.13.0 # TODO : need to decide of a better version ynh_use_nodejs -secret_key_base=$(ynh_string_random --length=24) -signing_salt=$(ynh_string_random --length=24) -encryption_salt=$(ynh_string_random --length=24) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -50,12 +46,13 @@ MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" # Secret keys -SECRET_KEY_BASE=$(ynh_string_random) -SIGNING_SALT=$(ynh_string_random) -ENCRYPTION_SALT=$(ynh_string_random) -ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$SECRET_KEY_BASE" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$SIGNING_SALT" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$ENCRYPTION_SALT" --target_file="$install_dir/.env" +secret_key_base=$(ynh_string_random --length=24) +signing_salt=$(ynh_string_random --length=24) +encryption_salt=$(ynh_string_random --length=24) +ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" +ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" +ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$encryption_salt" --target_file="$install_dir/.env" +ynh_store_file_checksum --file="$install_dir/.env" #================================================= # SPECIFIC SETUP From 924b84224cd480bf65234fd91364c800b89ce452 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:15:19 +0200 Subject: [PATCH 176/260] debug --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 4364f1b..1d171ef 100644 --- a/scripts/install +++ b/scripts/install @@ -49,6 +49,7 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) encryption_salt=$(ynh_string_random --length=24) +ynh_warn "echo $encryption_salt" ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$encryption_salt" --target_file="$install_dir/.env" From ba24a45c00270d44767c362cdeac1a3e8b583f04 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:20:58 +0200 Subject: [PATCH 177/260] add erlang-os-mon --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5030607..4758d5e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools postgresql npm" + packages = "erlang-dev erlang-parsetools erlang-os-mon postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From a2f56e7fbacb1075eb1d0af30e88c123aa59b142 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:35:58 +0200 Subject: [PATCH 178/260] debug --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1d171ef..f4aefab 100644 --- a/scripts/install +++ b/scripts/install @@ -49,7 +49,7 @@ ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_str secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) encryption_salt=$(ynh_string_random --length=24) -ynh_warn "echo $encryption_salt" +ynh_print_warn "hello world $encryption_salt" ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$encryption_salt" --target_file="$install_dir/.env" From 418e286b094f88365a04c33547f30245756f654a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:39:37 +0200 Subject: [PATCH 179/260] debug 2 --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f4aefab..fde076a 100644 --- a/scripts/install +++ b/scripts/install @@ -46,10 +46,10 @@ MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" # Secret keys +encryption_salt=$(ynh_string_random --length=24) secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) -encryption_salt=$(ynh_string_random --length=24) -ynh_print_warn "hello world $encryption_salt" +ynh_print_warn --message="hello world $encryption_salt" ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$encryption_salt" --target_file="$install_dir/.env" From fbb5c6ca405d75265b95197199e67647b69a7cc0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:47:14 +0200 Subject: [PATCH 180/260] debug 3 --- scripts/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index fde076a..1fa0933 100644 --- a/scripts/install +++ b/scripts/install @@ -46,13 +46,14 @@ MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" # Secret keys -encryption_salt=$(ynh_string_random --length=24) +ynh_print_warn --message="hello world $some_encryption_salt" secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) +some_encryption_salt=$(ynh_string_random --length=24) ynh_print_warn --message="hello world $encryption_salt" ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$encryption_salt" --target_file="$install_dir/.env" +ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$some_encryption_salt" --target_file="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env" #================================================= From 6296633927b31c7cef495012a7891d7b97dc6a4a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:49:08 +0200 Subject: [PATCH 181/260] removing doubles + reordering --- scripts/install | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index 1fa0933..b9cf9ce 100644 --- a/scripts/install +++ b/scripts/install @@ -34,28 +34,21 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" - -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" +secret_key_base=$(ynh_string_random --length=24) +signing_salt=$(ynh_string_random --length=24) +_encryption_salt=$(ynh_string_random --length=24) # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" -ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" -# Secret keys -ynh_print_warn --message="hello world $some_encryption_salt" -secret_key_base=$(ynh_string_random --length=24) -signing_salt=$(ynh_string_random --length=24) -some_encryption_salt=$(ynh_string_random --length=24) -ynh_print_warn --message="hello world $encryption_salt" -ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$some_encryption_salt" --target_file="$install_dir/.env" +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" + #================================================= # SPECIFIC SETUP #================================================= From 092b2799a17c0c2629f3d04755787a718f436675 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:51:47 +0200 Subject: [PATCH 182/260] typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b9cf9ce..2135de3 100644 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ ynh_add_nginx_config #================================================= secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) -_encryption_salt=$(ynh_string_random --length=24) +encryption_salt=$(ynh_string_random --length=24) # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" From 996d64ab576b0f11c7b2389d08533cba92b7c957 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 20:23:22 +0200 Subject: [PATCH 183/260] erlang-tools --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 4758d5e..e8f0315 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon postgresql npm" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 3a5d5a08f555eded786bb17993ea98cc2a865358 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 14 Aug 2023 00:54:49 +0200 Subject: [PATCH 184/260] erlang-xmerl --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e8f0315..cc7bc07 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools postgresql npm" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 59f390628df14fc843043690b1a3adcc6ff7f9bb Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 14 Aug 2023 15:00:22 +0200 Subject: [PATCH 185/260] Update .env --- conf/.env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index fa36513..d2a06dd 100644 --- a/conf/.env +++ b/conf/.env @@ -29,7 +29,7 @@ LANGUAGE=en_US.UTF-8 REPLACE_OS_VARS=true LIVEVIEW_ENABLED=true POSTGRES_USER=postgres -POSTGRES_DB=bonfire_db +POSTGRES_DB=__APP__ ACME_AGREE=true SHOW_DEBUG_IN_DEV=true # PLUG_SERVER=bandit @@ -43,10 +43,10 @@ SIGNING_SALT=__SIGNING_SALT__ ENCRYPTION_SALT=__ENCRYPTION_SALT__ # database access -POSTGRES_PASSWORD=put_a_secure_db_pw_here +POSTGRES_PASSWORD=__DB_PWD__ # password for the search index -MEILI_MASTER_KEY=put-a-key-to-protect-the-search-index-here +MEILI_MASTER_KEY=__MEILI_MASTER_KEY__ ## TODO # email deliverym if you use mailgun.com, edit with your domain and API key From 7b4a5e90b3b12b2ec0e286dfe5cbd377ab21dbc9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 14 Aug 2023 15:01:32 +0200 Subject: [PATCH 186/260] meili key + documentation --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 2135de3..d1f36dc 100644 --- a/scripts/install +++ b/scripts/install @@ -34,10 +34,12 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= +## Generate secrets and other config values secret_key_base=$(ynh_string_random --length=24) signing_salt=$(ynh_string_random --length=24) encryption_salt=$(ynh_string_random --length=24) - +# search +meili_master_key=$(ynh_string_random --length=24) # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" From e7ffb39b8606cb2cb215dec9230b85105608788a Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 00:02:40 +0200 Subject: [PATCH 187/260] node-postcss --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index cc7bc07..247c86a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 68ea51a8e51adf9debf17d4b935037bbb0b3c81f Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 10:25:59 +0200 Subject: [PATCH 188/260] fix postgres user --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index d2a06dd..cf052a1 100644 --- a/conf/.env +++ b/conf/.env @@ -28,7 +28,7 @@ LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 REPLACE_OS_VARS=true LIVEVIEW_ENABLED=true -POSTGRES_USER=postgres +POSTGRES_USER=__APP__ POSTGRES_DB=__APP__ ACME_AGREE=true SHOW_DEBUG_IN_DEV=true From 6fac6a0276e118b617870ea64db8632b55714ca8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 11:42:50 +0200 Subject: [PATCH 189/260] don't run the migration https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1678664426 --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index d1f36dc..daf33de 100644 --- a/scripts/install +++ b/scripts/install @@ -80,9 +80,10 @@ ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no #================================================= release_folder="_build/prod/rel/bonfire" -ynh_script_progression --message="Running database migrations..." --weight=1 -# Database created before, let's run the migrations -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +### Not running the migration, they are done on startup anyway +#ynh_script_progression --message="Running database migrations..." --weight=1 +## Database created before, let's run the migrations +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" ynh_script_progression --message="Starting Bonfire..." --weight=1 ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" From 365c7fec0b7bd7debf5db87716865e2c261c3086 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 11:58:19 +0200 Subject: [PATCH 190/260] =?UTF-8?q?Here=20we=20go=20for=20a=20proper=20dae?= =?UTF-8?q?mon=20service=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/remove | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 1ceb10e..271d9ff 100644 --- a/scripts/remove +++ b/scripts/remove @@ -17,14 +17,28 @@ ynh_script_progression --message="Stop Bonfire..." --weight=1 # start bonfire as a daemon "$release_folder/bin/bonfire stop" + + #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 + +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status $app >/dev/null +then + ynh_script_progression --message="Removing $app service integration..." --weight=1 + yunohost service remove $app +fi + +ynh_remove_systemd_config ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config +ynh_remove_logrotate + #================================================= # END OF SCRIPT #================================================= From e6317737112f91dd1aed24c88e46218149a1657c Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 11:58:43 +0200 Subject: [PATCH 191/260] typos --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 271d9ff..7fb73ea 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,9 +12,9 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Stop Bonfire..." --weight=1 +ynh_script_progression --message="Stoping Bonfire..." --weight=1 -# start bonfire as a daemon +# stop bonfire daemon "$release_folder/bin/bonfire stop" From a28db3c21278a56d1e1dcd400d587315db3f4533 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:00:01 +0200 Subject: [PATCH 192/260] remove log file --- scripts/remove | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove b/scripts/remove index 7fb73ea..35decdd 100644 --- a/scripts/remove +++ b/scripts/remove @@ -38,6 +38,7 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- ynh_remove_nginx_config ynh_remove_logrotate +ynh_secure_remove --file="/var/log/$app" #================================================= # END OF SCRIPT From 08352c1cbb79df02ea761c5602b72b8e0ba38851 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:03:17 +0200 Subject: [PATCH 193/260] =?UTF-8?q?Here=20we=20go=20for=20a=20proper=20dae?= =?UTF-8?q?mon=20service=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/systemd.service | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 conf/systemd.service diff --git a/conf/systemd.service b/conf/systemd.service new file mode 100644 index 0000000..abbbc3e --- /dev/null +++ b/conf/systemd.service @@ -0,0 +1,50 @@ +[Unit] +Description=Bonfire daemon +After=network.target + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=_WITH_DOCKER=no _INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon +StandardOutput=append:/var/log/__APP__/__APP__.log +StandardError=inherit + +# Sandboxing options to harden security +# Depending on specificities of your service/app, you may need to tweak these +# .. but this should be a good baseline +# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectClock=yes +ProtectHostname=yes +ProtectProc=invisible +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallArchitectures=native +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged + +# Denying access to capabilities that should not be relevant for webapps +# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html +CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG + +[Install] +WantedBy=multi-user.target + From 9e80a1787088fa6e7cdb1ca5a6542510c3eb0192 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:03:28 +0200 Subject: [PATCH 194/260] =?UTF-8?q?Here=20we=20go=20for=20a=20proper=20dae?= =?UTF-8?q?mon=20service=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index daf33de..18f5760 100644 --- a/scripts/install +++ b/scripts/install @@ -76,7 +76,7 @@ ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules #================================================= -# Run the release +# START SYSTEMD SERVICE - Run the release #================================================= release_folder="_build/prod/rel/bonfire" @@ -85,12 +85,19 @@ release_folder="_build/prod/rel/bonfire" ## Database created before, let's run the migrations #ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" -ynh_script_progression --message="Starting Bonfire..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" +#ynh_script_progression --message="Starting Bonfire..." --weight=1 +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" -# start bonfire as a daemon -ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start daemon" +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" + + +ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT From 7152c51e97714ef2d1a1900ca23ef319a6461548 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:23:49 +0200 Subject: [PATCH 195/260] remove debug --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 18f5760..9ca8cd6 100644 --- a/scripts/install +++ b/scripts/install @@ -60,9 +60,9 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" -#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" #================================================= # Building the release @@ -72,8 +72,8 @@ export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" -ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" -#ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules +ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" +#ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules #================================================= # START SYSTEMD SERVICE - Run the release @@ -83,10 +83,10 @@ release_folder="_build/prod/rel/bonfire" ### Not running the migration, they are done on startup anyway #ynh_script_progression --message="Running database migrations..." --weight=1 ## Database created before, let's run the migrations -#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" #ynh_script_progression --message="Starting Bonfire..." --weight=1 -#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" # Create a dedicated systemd config ynh_add_systemd_config From 18adf816f9af27fb7db3f5741d8dfc5bec6c6c25 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:35:23 +0200 Subject: [PATCH 196/260] typo --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index abbbc3e..4a87df9 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=_WITH_DOCKER=no _INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon +ExecStart=WITH_DOCKER=no _INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit From 56155c40c297271858d69d460c9fd2c544d5fadc Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:35:58 +0200 Subject: [PATCH 197/260] typo --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 4a87df9..666c4e8 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=WITH_DOCKER=no _INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon +ExecStart=WITH_DOCKER=no __INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit From c9cd6d07d5cf0e07b3ac16b06fb73b8b9aa15fad Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:37:11 +0200 Subject: [PATCH 198/260] wrong command path --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 666c4e8..5633bbe 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=WITH_DOCKER=no __INSTALL_DIR__/just cmd _build/prod/rel/bonfire/bin/bonfire start daemon +ExecStart=WITH_DOCKER=no just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit From a3d9717d1843f8517a719fce341314612e407485 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:04:43 +0000 Subject: [PATCH 199/260] bump version to 0.9.6 beta 23 https://github.com/bonfire-networks/bonfire-app/releases/tag/v0.9.6-beta.23 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 247c86a..046ea50 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.6~ynh3" +version = "0.9.6~ynh4" maintainers = ["Lapineige"] @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/d898a7659bfaf47298998dc4f43b378508eee00e.tar.gz" - sha256 = "0fb2058365f035591833287f91faf43de5aac553db53be314143437f756ae224" + url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.6-beta.23.tar.gz" + sha256 = "8a7ae1db683bf0f286d7cc0b7ac9ac8c9cb2c6963ae6e34d44836b0945c1872a" [resources.ports] From 1b613fc514818ce02f993d2dd3e9e9caf4410bb5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 17 Jan 2024 14:04:46 +0000 Subject: [PATCH 200/260] Auto-update README --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e15def..58c7a5d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.6~ynh3 +**Shipped version:** 0.9.6~ynh4 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources @@ -27,7 +27,7 @@ Federated social networking server built on ActivityPub open protocol * Official user documentation: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 877802d..137c766 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.6~ynh3 +**Version incluse :** 0.9.6~ynh4 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources @@ -27,7 +27,7 @@ Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPu * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From 411ed4933b8710b5265f37baeaca50204ac04b7a Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:15:27 +0000 Subject: [PATCH 201/260] go back elixir15 / erlang 26 --- manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 046ea50..617ab7b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -115,17 +115,17 @@ ram.runtime = "500M" ### Elixir 13 dependency - instead of v15 for now - extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" - extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" - extras.elixir13.packages = ["elixir"] + #extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" + #extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" + #extras.elixir13.packages = ["elixir"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now # erlang 26, for elixir v1.15 - #extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" - #extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - #extras.elixir15.packages = ["elixir-lang"] + extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" + extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" + extras.elixir15.packages = ["elixir-lang"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### just dependency From a1632cf403a140741f6d9a4c60bbfad037e487a4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:21:39 +0000 Subject: [PATCH 202/260] fix package name --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 617ab7b..6914bcc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -125,7 +125,7 @@ ram.runtime = "500M" # erlang 26, for elixir v1.15 extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - extras.elixir15.packages = ["elixir-lang"] + extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### just dependency From ba3ab0988509aaa4979e291dcf1e1845fc9bbb2a Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:39:49 +0000 Subject: [PATCH 203/260] Let's try with mise... `rtx install` from https://github.com/bonfire-networks/bonfire-app/blob/v0.9.6-beta.23/docs/DEPLOY.md#dependencies is now mise https://mise.jdx.dev/rtx.html https://mise.jdx.dev/getting-started.html#apt --- manifest.toml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6914bcc..b070694 100644 --- a/manifest.toml +++ b/manifest.toml @@ -123,10 +123,14 @@ ram.runtime = "500M" # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' # v15 is not available in default repo. RabbitMQ repo should be used (https://elixir-lang.org/install.html). No debian simple syntax. TODO later, using the simple syntax for now # erlang 26, for elixir v1.15 - extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" - extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" - extras.elixir15.packages = ["elixir"] + #extras.elixir15.repo = "deb https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang/ubuntu jammy main" + #extras.elixir15.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb279943d2a549531e144b875f77f1eda57ebb1cc" + #extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo + ### Elixir 15 with mise + extras.mise.repo = "deb arch=amd64 https://mise.jdx.dev/deb stable main" + extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" + extras.mise.packages = ["mise"] ### just dependency # TODO : this is unsafe and should be dealt with in a better way. From cad850c31d0b9f72ea51e1e35c650ae6022c0731 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:41:50 +0000 Subject: [PATCH 204/260] Let's try with mise... --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 9ca8cd6..24f37dc 100644 --- a/scripts/install +++ b/scripts/install @@ -60,6 +60,7 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From 99ff835d76349d4d7a417733768ec9e64eb58a14 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 14:48:54 +0000 Subject: [PATCH 205/260] remove arch --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b070694..9956009 100644 --- a/manifest.toml +++ b/manifest.toml @@ -128,7 +128,7 @@ ram.runtime = "500M" #extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### Elixir 15 with mise - extras.mise.repo = "deb arch=amd64 https://mise.jdx.dev/deb stable main" + extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" extras.mise.packages = ["mise"] From 908dd472e6476607e9ee127188ba0f590300539d Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 17 Jan 2024 15:05:00 +0000 Subject: [PATCH 206/260] verbose error --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 24f37dc..c36a3f1 100644 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,7 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise --verbose install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From d781f05f6bfb4e9bd51981209f606439962adba8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 11:20:21 +0100 Subject: [PATCH 207/260] add node-postcss-cli https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1900091380 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 9956009..897b847 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss node-postcss-cli" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 0356d84a606bcc07307032284d6ba9de39559310 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 18:53:43 +0100 Subject: [PATCH 208/260] remove node-postcss-cli --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 897b847..9956009 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss node-postcss-cli" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From 863291712b7969bbd579d1cd24caa3ded52046de Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 18:54:34 +0100 Subject: [PATCH 209/260] back to normal Elixir 13 --- manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9956009..8892f5d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -115,9 +115,9 @@ ram.runtime = "500M" ### Elixir 13 dependency - instead of v15 for now - #extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" - #extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" - #extras.elixir13.packages = ["elixir"] + extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" + extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" + extras.elixir13.packages = ["elixir"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' @@ -128,9 +128,9 @@ ram.runtime = "500M" #extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### Elixir 15 with mise - extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" - extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" - extras.mise.packages = ["mise"] + #extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" + #extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" + #extras.mise.packages = ["mise"] ### just dependency # TODO : this is unsafe and should be dealt with in a better way. From bdf93331a1aa1bf7bf21a8b08ae2713a38a89227 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 19:02:38 +0100 Subject: [PATCH 210/260] remove mise --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index c36a3f1..9ca8cd6 100644 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,6 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise --verbose install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From 179aed916978e9daaea099c9d752de2aba5f9112 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 23:11:17 +0100 Subject: [PATCH 211/260] update to latest commit https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1901181952 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8892f5d..6e45a1f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.6~ynh4" +version = "0.9.6~ynh5" maintainers = ["Lapineige"] @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/refs/tags/v0.9.6-beta.23.tar.gz" - sha256 = "8a7ae1db683bf0f286d7cc0b7ac9ac8c9cb2c6963ae6e34d44836b0945c1872a" + url = "https://github.com/bonfire-networks/bonfire-app/archive/6203b19aa385e4aec4cfe5b14a069d301647430b.tar.gz" + sha256 = "04a2c941ddd2935d5d86c6ca0bbd9a87166c1c07e79813af92b8741714996461" [resources.ports] From 7051d77d0f6f05d2e582c9bfed038bb562ea35c5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 19 Jan 2024 22:11:20 +0000 Subject: [PATCH 212/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 58c7a5d..8fb592f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.6~ynh4 +**Shipped version:** 0.9.6~ynh5 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 137c766..a5063c8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.6~ynh4 +**Version incluse :** 0.9.6~ynh5 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 72b5322854404cbcb750436c8c99971f60c28984 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 19 Jan 2024 23:44:12 +0100 Subject: [PATCH 213/260] install npx --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 9ca8cd6..3112162 100644 --- a/scripts/install +++ b/scripts/install @@ -72,6 +72,7 @@ export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no NODE_ENV=production $ynh_npm install npx" ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules From 4abcaa9d5b693d7121cb252f90400b5fb9526a28 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 15:34:18 +0100 Subject: [PATCH 214/260] use ynh_npm for npx + debug --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3112162..0d619ba 100644 --- a/scripts/install +++ b/scripts/install @@ -72,7 +72,8 @@ export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no NODE_ENV=production $ynh_npm install npx" +ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" +ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "cat $install_dir/justfile" ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules From 6813b5ac3655fe17437f1e377b1c281870ad660d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 15:51:44 +0100 Subject: [PATCH 215/260] comment debug --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 0d619ba..1a2405a 100644 --- a/scripts/install +++ b/scripts/install @@ -72,8 +72,8 @@ export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" -ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" -ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "cat $install_dir/justfile" +#ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" +#ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "cat $install_dir/justfile" ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" #ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules From 10dd8fe42dd501ef3fa107e462890734c4b1a922 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 15:52:21 +0100 Subject: [PATCH 216/260] Update manifest.toml https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1902116392 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6e45a1f..1a30463 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/6203b19aa385e4aec4cfe5b14a069d301647430b.tar.gz" - sha256 = "04a2c941ddd2935d5d86c6ca0bbd9a87166c1c07e79813af92b8741714996461" + url = "https://github.com/bonfire-networks/bonfire-app/archive/4d322e393580afebafd1574e2d9427ef09ff7aab.tar.gz" + sha256 = "6cc322cdb01fa326c05e59edfe0da41134eee3d0df71a3bb9fb124a629e8a59f" [resources.ports] From c5844eb6fdc76d1c297fd81e8bb65cc4553bdaae Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 16:19:31 +0100 Subject: [PATCH 217/260] use nodejs 16 --- scripts/_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..b818f0f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +nodejs_version=16 + #================================================= # PERSONAL HELPERS #================================================= From b4468b22226d29d7232b119a574b0f8811128c03 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 16:27:05 +0100 Subject: [PATCH 218/260] node JS 18 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b818f0f..9195d57 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=16 +nodejs_version=18 #================================================= # PERSONAL HELPERS From 6fb266bf74b58739cdecd78cca06d2c8de7f42ef Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 16:27:40 +0100 Subject: [PATCH 219/260] use nodejs version from _common.sh --- scripts/install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1a2405a..079e4de 100644 --- a/scripts/install +++ b/scripts/install @@ -9,7 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -ynh_install_nodejs --nodejs_version=16.13.0 # TODO : need to decide of a better version +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing nodejs..." + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs #================================================= From 64dc026917e43a40bce655a11c43bcad675ba9b5 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 17:13:57 +0100 Subject: [PATCH 220/260] $ynh_node_load_PATH misplaced --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 079e4de..d3f5b3f 100644 --- a/scripts/install +++ b/scripts/install @@ -78,8 +78,8 @@ export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" #ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" -#ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "cat $install_dir/justfile" -ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no just rel-build" +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "$ynh_node_load_PATH cat $install_dir/justfile" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just rel-build" #ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules #================================================= From 7464914709126f906c0ef7c858b0d1af96587615 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 17:55:51 +0100 Subject: [PATCH 221/260] Update manifest.toml https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1902169550 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 1a30463..96995c2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/4d322e393580afebafd1574e2d9427ef09ff7aab.tar.gz" - sha256 = "6cc322cdb01fa326c05e59edfe0da41134eee3d0df71a3bb9fb124a629e8a59f" + url = "https://github.com/bonfire-networks/bonfire-app/archive/ccaef9764e6dd74bc260d5e308f9fad04954f18b.tar.gz" + sha256 = "c83756bc01d81d6a2db6f0b0c816e6147d79ebbfbf244da660bb40840bc28b06" [resources.ports] From d2a0231f34e6c2683321e35e3880d4a9c36ab57c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 18:51:23 +0100 Subject: [PATCH 222/260] Avoid Elixir 15 https://github.com/YunoHost-Apps/bonfire_ynh/pull/2#issuecomment-1902192355 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 96995c2..8d3bb23 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/ccaef9764e6dd74bc260d5e308f9fad04954f18b.tar.gz" - sha256 = "c83756bc01d81d6a2db6f0b0c816e6147d79ebbfbf244da660bb40840bc28b06" + url = "https://github.com/bonfire-networks/bonfire-app/archive/7a43fd2202c6c442813cce944ba867419fee786e.tar.gz" + sha256 = "617a7469a3bafe632d104e99f21ae4026b8c9bb545c662ecb8d3413bc02b3ab9" [resources.ports] From 0dc7c9e7afce6487fea776259db9279c875cfc1d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:01:50 +0100 Subject: [PATCH 223/260] debug : erlang version --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index d3f5b3f..81651a5 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,7 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "erl -s halt" ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From d8d4f9fbe9028be335f7e18ede68bb9ed8e42d2c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:25:44 +0100 Subject: [PATCH 224/260] remove debug --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 81651a5..d3f5b3f 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,6 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "erl -s halt" ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From 2cf302341e6c2f7b910c90a489e007e4cd438417 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:29:19 +0100 Subject: [PATCH 225/260] let's try mise again --- manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8d3bb23..0a9c6b8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -115,9 +115,9 @@ ram.runtime = "500M" ### Elixir 13 dependency - instead of v15 for now - extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" - extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" - extras.elixir13.packages = ["elixir"] + #extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" + #extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" + #extras.elixir13.packages = ["elixir"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' @@ -128,9 +128,9 @@ ram.runtime = "500M" #extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### Elixir 15 with mise - #extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" - #extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" - #extras.mise.packages = ["mise"] + extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" + extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" + extras.mise.packages = ["mise"] ### just dependency # TODO : this is unsafe and should be dealt with in a better way. From 28784be3fdc9754f7b0c4ea102f72d47a6f59bd3 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:31:40 +0100 Subject: [PATCH 226/260] add mise + erlang pluging --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index d3f5b3f..4c75171 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,8 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From 9ce0a27a74be6455851d4106b31b53ac7bef4076 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:33:13 +0100 Subject: [PATCH 227/260] compatibility with Erlang 1.13 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 0a9c6b8..ded664f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/7a43fd2202c6c442813cce944ba867419fee786e.tar.gz" - sha256 = "617a7469a3bafe632d104e99f21ae4026b8c9bb545c662ecb8d3413bc02b3ab9" + url = "https://github.com/bonfire-networks/bonfire-app/archive/b3aae6292790e79a891cc9e93ecbda1400035f1d.tar.gz" + sha256 = "6bcb435160ebee6e23d29fda17c1603ad8bcf015f54ef6c960e430242bc07bd5" [resources.ports] From 75f37a383fd3732d632823e09f69219f6ade1eb8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:33:50 +0100 Subject: [PATCH 228/260] back to normal Elixir 13 --- manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index ded664f..03d1e8c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -115,9 +115,9 @@ ram.runtime = "500M" ### Elixir 13 dependency - instead of v15 for now - #extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" - #extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" - #extras.elixir13.packages = ["elixir"] + extras.elixir13.repo = "deb https://packages.erlang-solutions.com/debian bullseye contrib" + extras.elixir13.key = "https://packages.erlang-solutions.com/debian/erlang_solutions.asc" + extras.elixir13.packages = ["elixir"] ### Elixir 15 dependency # Bulleyes comes with v1.10 instead of v1.15 that is required # ynh_install_extra_app_dependencies --repo="https://packages.erlang-solutions.com/debian bullseye contrib" --package="elixir-lang" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc' @@ -128,9 +128,9 @@ ram.runtime = "500M" #extras.elixir15.packages = ["elixir"] # exlang-dev -> https://github.com/elixir-lang/ex_doc/pull/1442/files # Debian default package is newer (enough), don't use this custom repo ### Elixir 15 with mise - extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" - extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" - extras.mise.packages = ["mise"] + #extras.mise.repo = "deb https://mise.jdx.dev/deb stable main" + #extras.mise.key = "https://mise.jdx.dev/gpg-key.pub" + #extras.mise.packages = ["mise"] ### just dependency # TODO : this is unsafe and should be dealt with in a better way. From 30b41cba8a5b7915f835b2279e918cafab0f3372 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 20 Jan 2024 23:34:11 +0100 Subject: [PATCH 229/260] back to normal Elixir 13 --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4c75171..bb7473a 100644 --- a/scripts/install +++ b/scripts/install @@ -65,8 +65,8 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" From adc4310aefb33bad08a33c58f9850beb8a71ae6f Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 09:39:09 +0100 Subject: [PATCH 230/260] debug justfile content --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index bb7473a..b3a3892 100644 --- a/scripts/install +++ b/scripts/install @@ -81,6 +81,7 @@ export TERMINFO=/etc/terminfo ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" #ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" #ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "$ynh_node_load_PATH cat $install_dir/justfile" +ynh_exec_warn sed -n 595,610p $install_dir/justfile ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just rel-build" #ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules From 3cdcde28e0c1cf27d9a6384a42365f81ba87b13a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 12:08:03 +0100 Subject: [PATCH 231/260] use node_load_path + check node version --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b3a3892..468c7f7 100644 --- a/scripts/install +++ b/scripts/install @@ -65,11 +65,12 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "node -v" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no mix local.hex --force" # install Hex in non-interractive way -ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just config-basic" -#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just mix bonfire.deps .update" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH mix local.hex --force" # install Hex in non-interractive way +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just config-basic" +#ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just mix bonfire.deps .update" #================================================= # Building the release From be359970063102818c90431a74a18877407c2729 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 12:14:03 +0100 Subject: [PATCH 232/260] debug ynh_node version --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 468c7f7..eeba3cc 100644 --- a/scripts/install +++ b/scripts/install @@ -66,6 +66,7 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "node -v" +ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "$ynh_node -v" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH mix local.hex --force" # install Hex in non-interractive way From a6b9a7c090c50212888f57f4fa2631ac28873a15 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 12:30:45 +0100 Subject: [PATCH 233/260] remove some debug --- scripts/install | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/install b/scripts/install index eeba3cc..c5d74b5 100644 --- a/scripts/install +++ b/scripts/install @@ -65,8 +65,6 @@ export WITH_DOCKER=no # or source .env ? # Using this for now ynh_script_progression --message="Configuring Bonfire release..." --weight=1 cd $install_dir -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "node -v" -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "$ynh_node -v" #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise plugin add erlang https://github.com/asdf-vm/asdf-erlang.git" # add erlang as source #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "mise install" # install Elixir ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH mix local.hex --force" # install Hex in non-interractive way @@ -81,11 +79,7 @@ export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" -#ynh_replace_string --match_string="npx" --replace_string="$ynh_npm exec --" --target_file="$install_dir/justfile" -#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "$ynh_node_load_PATH cat $install_dir/justfile" -ynh_exec_warn sed -n 595,610p $install_dir/justfile ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just rel-build" -#ynh_exec_warn_less just rel-build # node needs (root) access to /usr/local/lib/node_modules #================================================= # START SYSTEMD SERVICE - Run the release From c8363b2d7c965594c3cd93ec9b83a673cdfdc78d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 12:49:02 +0100 Subject: [PATCH 234/260] use proper YNH NODE --- conf/systemd.service | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 5633bbe..d825c0a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,10 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=WITH_DOCKER=no just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon +Environment=NODE_ENV=production +Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=WITH_DOCKER=no __YNH_NODE__ just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit From 951449f5ef63cf1793edb44cff6e6e28bfb9d1a6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 12:49:46 +0100 Subject: [PATCH 235/260] Update systemd.service --- conf/systemd.service | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index d825c0a..d00e583 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment=NODE_ENV=production -Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config Environment="__YNH_NODE_LOAD_PATH__" ExecStart=WITH_DOCKER=no __YNH_NODE__ just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log From f27a135aac67beba3ecf12f3c62f382f7c085b45 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 13:24:41 +0100 Subject: [PATCH 236/260] add RAM usage info (build) --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 03d1e8c..6a5ae93 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,7 +26,7 @@ architectures = "all" ldap = false sso = false disk = "2000M" -ram.build = "300M" +ram.build = "1500M" ram.runtime = "500M" [install] From 43714541cc701bd0d66c0b2744d120822d7ae307 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 13:30:27 +0100 Subject: [PATCH 237/260] warning about building time --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c5d74b5..46f4890 100644 --- a/scripts/install +++ b/scripts/install @@ -74,7 +74,7 @@ ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load #================================================= # Building the release #================================================= -ynh_script_progression --message="Building Bonfire release..." --weight=1 +ynh_script_progression --message="Building Bonfire release... (This will take a long time)" --weight=1 export TERM=linux # why is that not defined ? export TERMINFO=/etc/terminfo ### DONT USE GLOBAL NPM INSTALL From 246d7229677c944ea7fce6fe5e91d58af1884aea Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 13:40:08 +0100 Subject: [PATCH 238/260] v0.9.8-beta 26 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 6a5ae93..cf07f6e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.6~ynh5" +version = "0.9.8~ynh1" maintainers = ["Lapineige"] From f43e4ea30d288dd3ba894ef801e08e72352506c3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 21 Jan 2024 12:40:11 +0000 Subject: [PATCH 239/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8fb592f..9d8eb0d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.6~ynh5 +**Shipped version:** 0.9.8~ynh1 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index a5063c8..2392c40 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.6~ynh5 +**Version incluse :** 0.9.8~ynh1 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 9905140b3c3c2d16bef701ba6b26c731f9f0cd5b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 13:45:55 +0100 Subject: [PATCH 240/260] add inotify-tools --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index cf07f6e..fbf0714 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss inotify-tools" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From c8f1fe98a00cfa6387377524cec848494d65e5d0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 13:54:55 +0100 Subject: [PATCH 241/260] inotify-tools is not needed https://github.com/YunoHost-Apps/bonfire_ynh/pull/2/#issuecomment-1902618107 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index fbf0714..cf07f6e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -104,7 +104,7 @@ ram.runtime = "500M" [resources.apt] - packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss inotify-tools" + packages = "erlang-dev erlang-parsetools erlang-os-mon erlang-tools erlang-xmerl postgresql npm node-postcss" ##### (this part is optional and corresponds to the legacy ynh_install_extra_app_dependencies helper) From af47664bbd6e9dc745e8bbeee957fbaeb59f4e47 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 14:20:26 +0100 Subject: [PATCH 242/260] build again on upgrade --- scripts/upgrade | 55 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e31fa34..53e1d3d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,6 +11,13 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." + +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" + #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= @@ -27,24 +34,54 @@ fi chown -R $app:www-data "$install_dir" +================================================= +# Building the release #================================================= -# REAPPLY SYSTEM CONFIGURATIONS -#================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 - -ynh_add_nginx_config +ynh_script_progression --message="Building Bonfire release... (This will take a long time)" --weight=1 +export TERM=linux # why is that not defined ? +export TERMINFO=/etc/terminfo +### DONT USE GLOBAL NPM INSTALL +ynh_replace_string --match_string="npm install --global" --replace_string="npm install" --target_file="$install_dir/justfile" +ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no $ynh_node_load_PATH just rel-build" #================================================= # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= # UPDATE A CONFIG FILE #================================================= -#ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression --message="Updating a configuration file... (this will remove any manual change you could have made before)" --weight=1 -#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" +ynh_add_config --template=".env" --destination="$install_dir/.env" -#chmod 400 "$install_dir/some_config_file" -#chown $app:$app "$install_dir/some_config_file" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" + +#================================================= +# REAPPLY SYSTEM CONFIGURATIONS + Run the service +#================================================= +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +# Create a dedicated systemd config +ynh_add_systemd_config + +mkdir -p "/var/log/$app" +chown -R $app:$app "/var/log/$app" + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" + +ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT From 63e2431564aa3c54b36c41a9d3656cc71fbe5d4b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 14:26:32 +0100 Subject: [PATCH 243/260] use version in Nginx conf https://github.com/bonfire-networks/bonfire-app/commit/43a2bc2595bea4a41a3e6ed2661f30c526cd014d version source : https://github.com/bonfire-networks/bonfire-app/blob/b3aae6292790e79a891cc9e93ecbda1400035f1d/mix.exs#L99 --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ea36772..e159532 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.1.0-*/priv/static; + alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.9.8-beta.26/priv/static; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 31898b4486ad7a266f58becda9fd73d6f42e0a41 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 14:28:18 +0100 Subject: [PATCH 244/260] lastest commit --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index cf07f6e..a16dad7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "bonfire" name = "Bonfire" -version = "0.9.8~ynh1" +version = "0.9.8-beta.26~ynh2" maintainers = ["Lapineige"] @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/b3aae6292790e79a891cc9e93ecbda1400035f1d.tar.gz" - sha256 = "6bcb435160ebee6e23d29fda17c1603ad8bcf015f54ef6c960e430242bc07bd5" + url = "https://github.com/bonfire-networks/bonfire-app/archive/43a2bc2595bea4a41a3e6ed2661f30c526cd014d.tar.gz" + sha256 = "bc0697ce49d9316a9990a684d403aa1e5bf050ce04e5d12f296a4424a18568b9" [resources.ports] From 57e2f74d654007503188922cf7160a41c195a5dd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 21 Jan 2024 13:28:21 +0000 Subject: [PATCH 245/260] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d8eb0d..040bf1e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated social networking server built on ActivityPub open protocol -**Shipped version:** 0.9.8~ynh1 +**Shipped version:** 0.9.8-beta.26~ynh2 **Demo:** https://playground.bonfire.cafe/ ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 2392c40..32e4c56 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub -**Version incluse :** 0.9.8~ynh1 +**Version incluse :** 0.9.8-beta.26~ynh2 **Démo :** https://playground.bonfire.cafe/ ## Documentations et ressources From 7b5f9dae7eeea03d1184a5b6fdca429edc88c696 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 14:32:31 +0100 Subject: [PATCH 246/260] latest commit https://github.com/YunoHost-Apps/bonfire_ynh/pull/2/#issuecomment-1902630340 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index a16dad7..f803f86 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,8 +89,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/bonfire-networks/bonfire-app/archive/43a2bc2595bea4a41a3e6ed2661f30c526cd014d.tar.gz" - sha256 = "bc0697ce49d9316a9990a684d403aa1e5bf050ce04e5d12f296a4424a18568b9" + url = "https://github.com/bonfire-networks/bonfire-app/archive/289ad2d8b57a2ce9a7ce609f000b1ac5d887e7a0.tar.gz" + sha256 = "5b79032647f9fd95465692d1de48839359dfa532a72c727f76bf03a1b68e8cdd" [resources.ports] From 4807d0303329f83e70e8355d182cc4ef8042a170 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 14:51:32 +0100 Subject: [PATCH 247/260] add flavour --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e159532..9860611 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.9.8-beta.26/priv/static; + alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.9.8-classic-beta.26/priv/static; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From fabbaff4cc78000815e97f77ce90c434c6bab104 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 15:18:43 +0100 Subject: [PATCH 248/260] fix syntax --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index cf052a1..826bd69 100644 --- a/conf/.env +++ b/conf/.env @@ -20,7 +20,7 @@ INVITE_ONLY=true # uncomment in order to NOT automatically change the database schema when you upgrade the app # DISABLE_DB_AUTOMIGRATION=true # max file upload size (default is 20 meg) -UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE +UPLOAD_LIMIT=__MEDIA_UPLOAD_SIZE__ # ==================================== # You should not have to edit any of the following ones: POSTGRES_HOST=localhost From 305112232935757c309048c33460b37c58166801 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 15:33:14 +0100 Subject: [PATCH 249/260] increase secret key length --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 46f4890..0f705d8 100644 --- a/scripts/install +++ b/scripts/install @@ -40,11 +40,11 @@ ynh_add_nginx_config # ADD A CONFIGURATION #================================================= ## Generate secrets and other config values -secret_key_base=$(ynh_string_random --length=24) -signing_salt=$(ynh_string_random --length=24) -encryption_salt=$(ynh_string_random --length=24) +secret_key_base=$(ynh_string_random --length=50) +signing_salt=$(ynh_string_random --length=50) +encryption_salt=$(ynh_string_random --length=50) # search -meili_master_key=$(ynh_string_random --length=24) +meili_master_key=$(ynh_string_random --length=50) # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" From 06430864a9aceb8fee3c1689b1ea5779aec9243f Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 15:52:48 +0100 Subject: [PATCH 250/260] use smtp, not sendmail (not compatible) https://github.com/YunoHost-Apps/bonfire_ynh/pull/2/#issuecomment-1902661376 --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 826bd69..203b99c 100644 --- a/conf/.env +++ b/conf/.env @@ -11,7 +11,7 @@ SERVER_PORT=__PORT__ # port your visitors will access (typically 80 or 443, will be different than SERVER_PORT only if using a reverse proxy) PUBLIC_PORT=443 # what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets section -MAIL_BACKEND=sendmail +MAIL_BACKEND=smtp # hostname and port of meili search index SEARCH_MEILI_INSTANCE=http://localhost:7700 # require an email address to be invited before being able to sign up From d296bbcf411547940714e122839463bf7fa74fc6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:17:20 +0100 Subject: [PATCH 251/260] proper mail config --- conf/.env | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/conf/.env b/conf/.env index 203b99c..0c1fcbd 100644 --- a/conf/.env +++ b/conf/.env @@ -10,8 +10,6 @@ HOSTNAME=__DOMAIN__ SERVER_PORT=__PORT__ # port your visitors will access (typically 80 or 443, will be different than SERVER_PORT only if using a reverse proxy) PUBLIC_PORT=443 -# what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets section -MAIL_BACKEND=smtp # hostname and port of meili search index SEARCH_MEILI_INSTANCE=http://localhost:7700 # require an email address to be invited before being able to sign up @@ -48,12 +46,13 @@ POSTGRES_PASSWORD=__DB_PWD__ # password for the search index MEILI_MASTER_KEY=__MEILI_MASTER_KEY__ -## TODO -# email deliverym if you use mailgun.com, edit with your domain and API key +# what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets section +MAIL_BACKEND=smtp MAIL_DOMAIN=__DOMAIN__ -MAIL_USERNAME=__APP__ -MAIL_KEY=__MAIL_PWD__ -MAIL_FROM=__APP__@__DOMAIN__ +MAIL_PASSWORD=__MAIL_PWD__ +MAIL_USER=__APP__ +MAIL_SERVER=__DOMAIN__ +MAIL_PORT=587 # TODO : Configure S3 - with proper Yunohost question during installation # Uploads From 24e499e357f32f5087222598ec7a55ad38cee3d9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:29:47 +0100 Subject: [PATCH 252/260] restore systemd --- scripts/restore | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index f489d88..e60c564 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,12 +29,28 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./d #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +systemctl enable $app.service --quiet + +mkdir -p "/var/log/$app" +chown -R $app:$app "/var/log/$app" +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + +yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + +ynh_systemd_action --service_name=nginx --action=reload + #================================================= # GENERIC FINALIZATION #================================================= From 4a6148e20ae4ad0ce5e5f2ae0d94a4bd2c76e012 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:37:26 +0100 Subject: [PATCH 253/260] check if service is started correctly --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 0f705d8..69c0252 100644 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,7 @@ yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$a ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 # Start a systemd service -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="[info] Running Bonfire.Web.Endpoint" #================================================= # END OF SCRIPT From 8f1ff516534c70d162d6bf33f839366fcbfb45ea Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:37:54 +0100 Subject: [PATCH 254/260] check if service is started correctly --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 53e1d3d..b5a91c3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$a ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 # Start a systemd service -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="[info] Running Bonfire.Web.Endpoint" #================================================= # END OF SCRIPT From db02fe0de7fa9198c40c420dc8cad81e814ef53b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:38:00 +0100 Subject: [PATCH 255/260] check if service is started correctly --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index e60c564..868ff95 100644 --- a/scripts/restore +++ b/scripts/restore @@ -47,7 +47,7 @@ yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$a #================================================= ynh_script_progression --message="Starting Bonfire daemon 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="[info] Running Bonfire.Web.Endpoint" ynh_systemd_action --service_name=nginx --action=reload From 4a325a50318e46cb16df1c8ec346f3d1674a7047 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 16:56:36 +0100 Subject: [PATCH 256/260] create log folder --- scripts/install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 69c0252..13d202b 100644 --- a/scripts/install +++ b/scripts/install @@ -94,12 +94,17 @@ release_folder="_build/prod/rel/bonfire" #ynh_script_progression --message="Starting Bonfire..." --weight=1 #ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" +mkdir -p "/var/log/$app" +chown -R $app:$app "/var/log/$app" + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + # Create a dedicated systemd config ynh_add_systemd_config yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" - ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 # Start a systemd service From ad2338cbf39fe1b2cf1c73c26530a0ff4015aa94 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 17:01:08 +0100 Subject: [PATCH 257/260] Update nginx.conf https://github.com/YunoHost-Apps/bonfire_ynh/pull/2/#issuecomment-1902678872 --- conf/nginx.conf | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9860611..7f1ce15 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,18 +1,27 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location @app_upstream { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $http_host; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass http://127.0.0.1:__PORT__; + proxy_redirect off; + proxy_read_timeout 240s; +} + location __PATH__/ { - # Path to source - alias __INSTALL_DIR__/_build/prod/rel/bonfire/lib/bonfire-0.9.8-classic-beta.26/priv/static; + root /var/www/bonfire/_build/prod/rel/bonfire/lib/bonfire-0.9.8-classic-beta.26/priv/static; + + index index.html; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; -} -location /live/websocket { - proxy_pass http://127.0.0.1:__PORT__; - - # these configurations are necessary to proxy WebSocket requests - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; + + try_files $uri $uri.html $uri/index.html $uri/ @app_upstream; + } From 07292b240657a75fda258af0f5d13fd9bffef4a9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 17:05:18 +0100 Subject: [PATCH 258/260] fix systemd --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index d00e583..67de51f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment=NODE_ENV=production Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=WITH_DOCKER=no __YNH_NODE__ just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon +ExecStart=just cmd __INSTALL_DIR__/_build/prod/rel/bonfire/bin/bonfire start daemon StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit From 613ee0c6902fbb09f0eeb4df1219cf13e8ca32bf Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 21 Jan 2024 17:31:28 +0100 Subject: [PATCH 259/260] Update nginx.conf From linter - In nginx.conf : please don't use $http_host but $host instead. C.f. https://github.com/yandex/gixy/blob/master/docs/en/plugins/hostspoofing.md --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7f1ce15..2670423 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ location @app_upstream { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $http_host; + proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; From e8052611e81786f76e928d295d4254838437eb73 Mon Sep 17 00:00:00 2001 From: lapineige Date: Mon, 22 Jan 2024 22:11:14 +0100 Subject: [PATCH 260/260] typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b5a91c3..66c276c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,7 @@ fi chown -R $app:www-data "$install_dir" -================================================= +#================================================= # Building the release #================================================= ynh_script_progression --message="Building Bonfire release... (This will take a long time)" --weight=1