diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..3eeb161 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,5 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) diff --git a/README.md b/README.md index 8cf224e..adb6d12 100644 --- a/README.md +++ b/README.md @@ -1,85 +1,58 @@ -# 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.toml` 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 +# Crab Fit 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/crabfit.svg)](https://dash.yunohost.org/appci/app/crabfit) ![Working status](https://ci-apps.yunohost.org/ci/badges/crabfit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/crabfit.maintain.svg) -*[Lire ce readme en français.](./README_fr.md)* +[![Install Crab Fit with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=crabfit) -> *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.* +*[Read this README in other languages.](./ALL_README.md)* + +> *This package allows you to install Crab Fit 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. +Crab Fit helps you fit your event around everyone's schedules. +Simply create an event above and send the link to everyone that is participating. +Results update live and you will be able to see a heat-map of when everyone is free. -### Features +## 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." +- Click and slide to select multiple time slots at once. +- Editable using a one-time password -**Shipped version:** 1.0~ynh1 +**Shipped version:** 1.0~ynh2 -**Demo:** https://demo.example.com +**Demo:** ## 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 ? +![Screenshot of Crab Fit](./doc/screenshots/main.png) ## 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 Store: +- 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/crabfit_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/crabfit_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 crabfit -u https://github.com/YunoHost-Apps/crabfit_ynh/tree/testing --debug ``` **More info regarding app packaging:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..1c15d8c --- /dev/null +++ b/README_eu.md @@ -0,0 +1,58 @@ + + +# Crab Fit YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/crabfit.svg)](https://dash.yunohost.org/appci/app/crabfit) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/crabfit.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/crabfit.maintain.svg) + +[![Instalatu Crab Fit YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=crabfit) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Crab Fit YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +Crab Fit helps you fit your event around everyone's schedules. +Simply create an event above and send the link to everyone that is participating. +Results update live and you will be able to see a heat-map of when everyone is free. + +## Features + +- Click and slide to select multiple time slots at once. +- Editable using a one-time password + + +**Paketatutako bertsioa:** 1.0~ynh2 + +**Demoa:** + +## Pantaila-argazkiak + +![Crab Fit(r)en pantaila-argazkia](./doc/screenshots/main.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Erabiltzaileen dokumentazio ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/crabfit_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/crabfit_ynh/tree/testing --debug +edo +sudo yunohost app upgrade crabfit -u https://github.com/YunoHost-Apps/crabfit_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 4da6fb7..299e3a4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,73 +1,58 @@ -# Exemple d'app pour YunoHost +# Crab Fit 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/crabfit.svg)](https://dash.yunohost.org/appci/app/crabfit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/crabfit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/crabfit.maintain.svg) -*[Read this readme in english.](./README.md)* +[![Installer Crab Fit avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=crabfit) -> *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.* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -## Vue d'ensemble +> *Ce package vous permet d’installer Crab Fit rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* -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. +## Vue d’ensemble -### Features +Crab Fit vous aide à adapter votre événement aux horaires de chacun·e. +Créez simplement un événement ci-dessus et envoyez le lien à tous les participant·e·s. +Les résultats sont mis à jour en direct et vous pourrez voir une carte thermique montrant quand tout le monde est libre. -- 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." +## Fonctionnalités + +- Glisser votre souris pour sélectionner un interval de temps +- Modifiable après coup à l'aide d'un mot de passe à usage unique -**Version incluse :** 1.0~ynh1 +**Version incluse :** 1.0~ynh2 -**Démo :** https://demo.example.com +**Démo :** -## Captures d'écran +## 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 ? +![Capture d’écran de Crab Fit](./doc/screenshots/main.png) ## 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 : +- YunoHost Store : +- 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/crabfit_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/crabfit_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 crabfit -u https://github.com/YunoHost-Apps/crabfit_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 1b3486f..14ca160 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,4 +1,3 @@ - Crab Fit helps you fit your event around everyone's schedules. Simply create an event above and send the link to everyone that is participating. Results update live and you will be able to see a heat-map of when everyone is free. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 089da1a..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,2 +0,0 @@ -- Needs a dedicated domain -- Temporarily downloads and compile cargo for the backend installation diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index 77f3f44..0000000 --- a/doc/DISCLAIMER_fr.md +++ /dev/null @@ -1,2 +0,0 @@ -- Nécessite un domaine dédié -- Télécharge et compile temporairement un cargo et le backend diff --git a/manifest.toml b/manifest.toml index 0013b2e..ae8770b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,10 +2,10 @@ packaging_format = 2 id = "crabfit" name = "Crab Fit" -description.en = "Enter your availability to find a time that works for everyone! " +description.en = "Enter your availability to find a time that works for everyone" description.fr = "Trouver un temps correspondant à tout le monde en rentrant vos disponibilités" -version = "1.0~ynh1" +version = "1.0~ynh2" maintainers = ["limaanto"] @@ -18,7 +18,7 @@ userdoc = "https://github.com/GRA0007/crab.fit" code = "https://github.com/GRA0007/crab.fit" [integration] -yunohost = ">= 11.1.21" +yunohost = ">= 11.2" architectures = "all" multi_instance = true ldap = false @@ -43,16 +43,22 @@ ram.runtime = "100M" sha256 = "cc87276d26242a90f32f1462319f0cff35c576f6c438cc20e68601f26701b33b" [resources.system_user] + [resources.install_dir] + [resources.permissions] main.url = "/" + api.url = "/api" + api.allowed = "visitors" + api.auth_header = false + api.show_tile = false [resources.ports] main.default = 3000 api.default = 3001 [resources.apt] - packages = "postgresql pkg-config libssl-dev" + packages = "postgresql, pkg-config, libssl-dev" [resources.database] type = "postgresql" diff --git a/scripts/backup b/scripts/backup index afe4818..ebcf3cf 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,11 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -53,9 +48,6 @@ ynh_backup --src_path="/etc/systemd/system/${app}-back.service" #================================================= ynh_print_info --message="Backing up the POSTGRES database..." -### (However, things like Postgres dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - ynh_psql_dump_db --database="$db_name" > db.sql #================================================= diff --git a/scripts/install b/scripts/install index 866385d..f80a0bb 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" + chown -R $app:$app "$install_dir" chmod -R o-rwx "$install_dir" @@ -49,11 +50,11 @@ ynh_script_progression --message="Adding configuration files..." --weight=1 # Replace the default .env.local with our own rm $install_dir/frontend/.env.local -ynh_add_config --template="../conf/front.env" --destination="$install_dir/frontend/.env.local" +ynh_add_config --template="front.env" --destination="$install_dir/frontend/.env.local" chmod 400 "$install_dir/frontend/.env.local" chown $app:$app "$install_dir/frontend/.env.local" -ynh_add_config --template="../conf/back.env" --destination="$install_dir/api/.env" +ynh_add_config --template="back.env" --destination="$install_dir/api/.env" chmod 400 "$install_dir/api/.env" chown $app:$app "$install_dir/api/.env" @@ -61,12 +62,14 @@ chown $app:$app "$install_dir/api/.env" # BUILD BACKEND #================================================= ynh_script_progression --message="Building crabfit backend..." --weight=10 + build_backend #================================================= # BUILD FRONTEND #================================================= ynh_script_progression --message="Building crabfit frontend..." --weight=2 + build_frontend #================================================= diff --git a/scripts/remove b/scripts/remove index b9b5d7c..3de4156 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,8 +16,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script - # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove "${app}-back" @@ -28,6 +26,7 @@ ynh_remove_systemd_config --service="${app}-front" ynh_secure_remove --file="/etc/systemd/system/$app.target" ynh_remove_nginx_config + ynh_remove_logrotate ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index ac8cc74..f5e9568 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs ynh_restore_file --origin_path="$install_dir" + chown -R $app:$app "$install_dir" chmod -R o-rwx "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 2515fab..c713972 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,52 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# - $install_dir -# - $port -# ... - -# In the context of upgrade, -# - resources are automatically provisioned / updated / deleted (depending on existing resources) -# - a safety backup is automatically created by the core and will be restored if the upgrade fails - -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# -# N.B. : the followings setting migrations snippets are provided as *EXAMPLES* -# of what you may want to do in some cases (e.g. a setting was not defined on -# some legacy installs and you therefore want to initiaze stuff during upgrade) -# - -# If db_name doesn't exist, create it -#if [ -z "$db_name" ]; then -# db_name=$(ynh_sanitize_dbid --db_name=$app) -# ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#fi - -# If install_dir doesn't exist, create it -#if [ -z "$install_dir" ]; then -# install_dir=/var/www/$app -# ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -#fi - #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -68,17 +22,13 @@ ynh_systemd_action --service_name="${app}-back" --action="stop" --log_path="/var #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 -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" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" - chown -R $app:$app "$install_dir" - chmod -R o-rwx "$install_dir" - -fi +chown -R $app:$app "$install_dir" +chmod -R o-rwx "$install_dir" ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs @@ -88,13 +38,11 @@ ynh_use_nodejs #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -# This should be a literal copypasta of what happened in the install's "System configuration" section - # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config # Create a dedicated systemd config -ynh_add_config --template="../conf/crabfit.target" --destination="/etc/systemd/system/$app.target" +ynh_add_config --template="crabfit.target" --destination="/etc/systemd/system/$app.target" ynh_add_systemd_config --service="${app}-front" --template="crabfit-front.service" ynh_add_systemd_config --service="${app}-back" --template="crabfit-back.service" @@ -110,42 +58,28 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) - # Replace the default .env.local with our own rm $install_dir/frontend/.env.local -ynh_add_config --template="../conf/front.env" --destination="$install_dir/frontend/.env.local" +ynh_add_config --template="front.env" --destination="$install_dir/frontend/.env.local" chmod 400 "$install_dir/frontend/.env.local" chown $app:$app "$install_dir/frontend/.env.local" -ynh_add_config --template="../conf/back.env" --destination="$install_dir/api/.env" +ynh_add_config --template="back.env" --destination="$install_dir/api/.env" chmod 400 "$install_dir/api/.env" chown $app:$app "$install_dir/api/.env" -### For more complex cases where you want to replace stuff using regexes, -### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) -### When doing so, you also need to manually call ynh_store_file_checksum -### -### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$install_dir/some_config_file" -### ynh_store_file_checksum --file="$install_dir/some_config_file" +#================================================= +# BUILD BACKEND +#================================================= +ynh_script_progression --message="Building crabfit backend..." --weight=10 +build_backend -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - #================================================= - # BUILD BACKEND - #================================================= - ynh_script_progression --message="Building crabfit backend..." --weight=10 - build_backend +#================================================= +# BUILD FRONTEND +#================================================= +ynh_script_progression --message="Building crabfit frontend..." --weight=2 - #================================================= - # BUILD FRONTEND - #================================================= - ynh_script_progression --message="Building crabfit frontend..." --weight=2 - build_frontend -fi +build_frontend #================================================= # START SYSTEMD SERVICE