From 5d4a12ed54c5b0b37058b178fe5cb0e9a7d4d000 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 20 Apr 2021 22:54:01 +0200 Subject: [PATCH 1/9] Fix badges --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d642fa..1111e00 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ The data is private because it is stored by default on your machine (InnoDB and #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 0676489..98a29ad 100644 --- a/README_fr.md +++ b/README_fr.md @@ -40,8 +40,8 @@ Comment configurer cette application : via le panneau d'administration, un fichi #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) ## Limitations From 1784a52b949ba966cf52d9e5a9840bc8253ab216 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 11 May 2021 03:00:22 +0200 Subject: [PATCH 2/9] [autopatch] Update issue and PR templates --- issue_template.md | 55 ---------------------------------------- pull_request_template.md | 16 ------------ 2 files changed, 71 deletions(-) delete mode 100644 issue_template.md delete mode 100644 pull_request_template.md diff --git a/issue_template.md b/issue_template.md deleted file mode 100644 index 1cea0eb..0000000 --- a/issue_template.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: Bug report -about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. - ---- - -**How to post a meaningful bug report** -1. *Read this whole template first.* -2. *Make sure you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - - *In doubt, ask here and we will figure it out together.* -3. *Delete these italic comments as you write over them below, and remove this guide.* ---- - -### Describe the bug - -*A clear and concise description of what the bug is.* - -### Context - -- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* -- YunoHost version: x.x.x -- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* - - If yes, please explain: -- Using, or trying to install package version/branch: -- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* - -### Steps to reproduce - -- *If you performed a command from the CLI, the command itself is enough. For example:* - ```sh - sudo yunohost app install encryptic - ``` -- *If you used the webadmin, please perform the equivalent command from the CLI first.* -- *If the error occurs in your browser, explain what you did:* - 1. *Go to '...'* - 2. *Click on '...'* - 3. *Scroll down to '...'* - 4. *See error* - -### Expected behavior - -*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* - -### Logs - -*When an operation fails, YunoHost provides a simple way to share the logs.* -- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* -- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* - -*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* - -*If applicable and useful, add screenshots to help explain your problem.* diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how do you fix that problem* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 36a2aaa6eedbaccc3340ab0efb33facd243633f2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 11 May 2021 13:05:50 +0200 Subject: [PATCH 3/9] Add templates --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ README.md | 2 +- README_fr.md | 2 +- 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/README.md b/README.md index 1111e00..0705570 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allows you to install Encryptic 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.* +If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview Encryptic (fork of Laverna) is an anonymous system, encrypted and without registration required, it is accessible via a web browser (without software installation). diff --git a/README_fr.md b/README_fr.md index 98a29ad..5030368 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,7 +6,7 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer Encryptic rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.* ## Vue d'ensemble Encryptic est un système anonyme, crypté et sans inscription requise, il est accessible via un navigateur web (sans installation de logiciel). From f922ed22f94eefe3ae9c0bd482876c4cb9821861 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 30 Aug 2021 14:00:00 +0200 Subject: [PATCH 4/9] fix --- manifest.json | 2 +- scripts/restore | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 290a51c..95351ba 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">> 4.1.7" + "yunohost": ">> 4.2.4" }, "multi_instance": true, "services": [ diff --git a/scripts/restore b/scripts/restore index 0730dd8..2da27f7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,8 +30,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " From 3c1326d374e94f6c969c9078aeeddd8d0a452038 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 30 Aug 2021 14:03:45 +0200 Subject: [PATCH 5/9] Add templates --- doc/DESCRIPTION.md | 12 ++++++++++++ {sources => doc/screenshots}/encryptic.png | Bin manifest.json | 11 +++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 doc/DESCRIPTION.md rename {sources => doc/screenshots}/encryptic.png (100%) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..d750b90 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,12 @@ +Encryptic (fork of Laverna) is an anonymous system, encrypted and without registration required, it is accessible via a web browser (without software installation). +The data is private because it is stored by default on your machine (InnoDB and localstorage), it is a setting in the settings that will allow you to synchronize it via the cloud on your various devices. + +### Features + +- Markdown editor based on Pagedown +- Synchronization with cloud storage via Dropbox or RemoteStorage +- Multiple editing modes: normal, preview, and distraction free +- Offline access to your notes +- WYSIWYG control buttons +- Syntax highlighting, MathJax support +- Robust keyboard shortcuts diff --git a/sources/encryptic.png b/doc/screenshots/encryptic.png similarity index 100% rename from sources/encryptic.png rename to doc/screenshots/encryptic.png diff --git a/manifest.json b/manifest.json index 95351ba..ec93c05 100644 --- a/manifest.json +++ b/manifest.json @@ -3,11 +3,18 @@ "id": "encryptic", "packaging_format": 1, "description": { - "en": "Open-source note-taking application heavily focused on encryption.", - "fr": "Application de prise de notes open source axée sur le chiffrement." + "en": "Open-source note-taking application heavily focused on encryption", + "fr": "Application de prise de notes open source axée sur le chiffrement" }, "version": "0.1.0~ynh3", "url": "https://www.encryptic.org/", + "upstream": { + "license": "MPL-2.0", + "website": "https://www.encryptic.org/", + "demo": "https://app.encryptic.org/", + "admindoc": "https://github.com/encryptic-team/encryptic/wiki", + "code": "https://github.com/encryptic-team/encryptic" + }, "license": "MPL-2.0", "maintainer": { "name": "eric_G", From af2ee736d8ccee0997fd0c06c666dd73fb78be99 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 30 Aug 2021 12:03:50 +0000 Subject: [PATCH 6/9] Auto-update README --- README.md | 75 +++++++++++++++++++++---------------------------- README_fr.md | 79 +++++++++++++++++++++------------------------------- 2 files changed, 62 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 0705570..dea1509 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ + + # Encryptic for YunoHost [![Integration level](https://dash.yunohost.org/integration/encryptic.svg)](https://dash.yunohost.org/appci/app/encryptic) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.maintain.svg) @@ -5,60 +10,40 @@ *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Encryptic 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.* +> *This package allows you to install Encryptic 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 + Encryptic (fork of Laverna) is an anonymous system, encrypted and without registration required, it is accessible via a web browser (without software installation). The data is private because it is stored by default on your machine (InnoDB and localstorage), it is a setting in the settings that will allow you to synchronize it via the cloud on your various devices. -**Shipped version:** 0.1.0 +### Features + +- Markdown editor based on Pagedown +- Synchronization with cloud storage via Dropbox or RemoteStorage +- Multiple editing modes: normal, preview, and distraction free +- Offline access to your notes +- WYSIWYG control buttons +- Syntax highlighting, MathJax support +- Robust keyboard shortcuts + + +**Shipped version:** 0.1.0~ynh3 + +**Demo:** https://app.encryptic.org/ ## Screenshots -![](sources/encryptic.png) +![](./doc/screenshots/encryptic.png) -## Demo +## Documentation and resources -* [Official demo](https://app.encryptic.org/) - -## Configuration - -* How to configure this app: From an admin panel. - -## Documentation - - * Official documentation: https://github.com/encryptic-team/encryptic/wiki - * YunoHost documentation: If specific documentation is needed, feel free to contribute. - -## YunoHost specific features - -#### Multi-user support - - * Are LDAP and HTTP auth supported? **No** - * Can the app be used by multiple users? **Yes** - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) - -## Limitations - -* Any known limitations. - -## Additional information - -* Other info you would like to add about this app. - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/encryptic_ynh/issues - * App website: https://encryptic.org/ - * Upstream app repository: https://github.com/encryptic-team/encryptic - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://www.encryptic.org/ +* Official admin documentation: https://github.com/encryptic-team/encryptic/wiki +* Upstream app code repository: https://github.com/encryptic-team/encryptic +* YunoHost documentation for this app: https://yunohost.org/app_encryptic +* Report a bug: https://github.com/YunoHost-Apps/encryptic_ynh/issues ## Developer info @@ -70,3 +55,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/encryptic_ynh/tree/te or sudo yunohost app upgrade encryptic -u https://github.com/YunoHost-Apps/encryptic_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 5030368..b603361 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,64 +1,45 @@ # Encryptic pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/encryptic.svg)](https://dash.yunohost.org/appci/app/encryptic) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/encryptic.svg)](https://dash.yunohost.org/appci/app/encryptic) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/encryptic.maintain.svg) [![Installer Encryptic avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=encryptic) -*[Read this readme in english.](./README.md)* +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer Encryptic rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.* +> *Ce package vous permet d'installer Encryptic 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 -Encryptic est un système anonyme, crypté et sans inscription requise, il est accessible via un navigateur web (sans installation de logiciel). -Les données sont privées, car stockées par défaut sur votre machine (InnoDB et localstorage), c’est un réglage dans les paramètres qui vous permettra de les synchroniser via le cloud sur vos différents périphériques. -**Version incluse :** 0.1.0 +Encryptic (fork of Laverna) is an anonymous system, encrypted and without registration required, it is accessible via a web browser (without software installation). +The data is private because it is stored by default on your machine (InnoDB and localstorage), it is a setting in the settings that will allow you to synchronize it via the cloud on your various devices. + +### Features + +- Markdown editor based on Pagedown +- Synchronization with cloud storage via Dropbox or RemoteStorage +- Multiple editing modes: normal, preview, and distraction free +- Offline access to your notes +- WYSIWYG control buttons +- Syntax highlighting, MathJax support +- Robust keyboard shortcuts + + +**Version incluse :** 0.1.0~ynh3 + +**Démo :** https://app.encryptic.org/ ## Captures d'écran -![](sources/encryptic.png) +![](./doc/screenshots/encryptic.png) -## Démo +## Documentations et ressources -* [Démo officielle](https://app.encryptic.org/) - -## Configuration - -Comment configurer cette application : via le panneau d'administration, un fichier brut en SSH ou tout autre moyen. - -## Documentation - - * Documentation officielle : https://github.com/encryptic-team/encryptic/wiki - * Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. - -## Caractéristiques spécifiques YunoHost - -#### Support multi-utilisateur - -* L'authentification LDAP et HTTP est-elle prise en charge ? **Non** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -#### Architectures supportées - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps.yunohost.org/ci/apps/encryptic/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/encryptic.svg)](https://ci-apps-arm.yunohost.org/ci/apps/encryptic/) - -## Limitations - -* Limitations connues. - -## Informations additionnelles - -* Autres informations que vous souhaitez ajouter sur cette application. - -## Liens - - * Signaler un bug : https://github.com/YunoHost-Apps/encryptic_ynh/issues - * Site de l'application : https://encryptic.org/ - * Dépôt de l'application principale : https://github.com/encryptic-team/encryptic - * Site web YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : https://www.encryptic.org/ +* Documentation officielle de l'admin : https://github.com/encryptic-team/encryptic/wiki +* Dépôt de code officiel de l'app : https://github.com/encryptic-team/encryptic +* Documentation YunoHost pour cette app : https://yunohost.org/app_encryptic +* Signaler un bug : https://github.com/YunoHost-Apps/encryptic_ynh/issues ## Informations pour les développeurs @@ -70,3 +51,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/encryptic_ynh/tree/te ou sudo yunohost app upgrade encryptic -u https://github.com/YunoHost-Apps/encryptic_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file From c3ab505cf3b834e140a2eaf19be76904d593c3b3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 30 Aug 2021 14:06:49 +0200 Subject: [PATCH 7/9] Fix --- check_process | 11 +++-------- scripts/install | 27 ++++++++++++--------------- scripts/restore | 18 +++++++++++------- scripts/upgrade | 27 ++++++++++++--------------- 4 files changed, 38 insertions(+), 45 deletions(-) diff --git a/check_process b/check_process index 344fafa..2f5fbfe 100644 --- a/check_process +++ b/check_process @@ -1,13 +1,8 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/scripts/install b/scripts/install index ff4eb5e..a4855af 100755 --- a/scripts/install +++ b/scripts/install @@ -43,6 +43,14 @@ 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 +#================================================= +# 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" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -52,6 +60,10 @@ 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" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -60,21 +72,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chown -R $app: $final_path - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index 2da27f7..a4ed16e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -41,6 +41,14 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -48,13 +56,9 @@ ynh_script_progression --message="Restoring Encryptic main directory..." --weigh ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index 048195a..1ba8d65 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,6 +57,14 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# 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" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -69,6 +77,10 @@ then ynh_setup_source --dest_dir="$final_path" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -77,21 +89,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -chown -R $app: $final_path - #================================================= # RELOAD NGINX #================================================= From f62a62d572e9bd4c9f01d04ea850373ba865c3ee Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Oct 2021 17:45:04 +0200 Subject: [PATCH 8/9] Cleaning up --- conf/app.src | 1 - manifest.json | 3 +-- scripts/upgrade | 28 ++++++++++++++-------------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/conf/app.src b/conf/app.src index 3a3c053..bfeef25 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=f59d2cf4fbfec704404c35b8c5aba3c4361a6f3afee95a0beccc16fcc34985e4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index ec93c05..a88668f 100644 --- a/manifest.json +++ b/manifest.json @@ -31,8 +31,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/upgrade b/scripts/upgrade index 1ba8d65..23f595e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,20 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up Encryptic before upgrading..." --weight=3 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -43,20 +57,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up Encryptic before upgrading..." --weight=3 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # CREATE DEDICATED USER #================================================= From f9c1adf57301f1307c404e5615d17712dc9a3be8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Oct 2021 21:31:34 +0200 Subject: [PATCH 9/9] Update restore --- scripts/restore | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/restore b/scripts/restore index a4ed16e..4fcf2a2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -60,13 +60,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -chown -R $app: $final_path - #================================================= # GENERIC FINALIZATION #=================================================