From 4b2699c93939c130229eaaeb510f965ac69a16b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 21 Jun 2021 13:32:19 +0200 Subject: [PATCH 01/30] Update config.json.example --- conf/config.json.example | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/config.json.example b/conf/config.json.example index d361583..1b80da5 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -3,7 +3,6 @@ "protocolUseSSL": true, "domain": "__DOMAIN__", "port": "__PORT__", - "urlPath": "__PATH__", "loglevel": "info", "useCDN": false, "allowGravatar": false, From 88d7b13942004fc81d512d5d6d892a6744e8a8a9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 21 Jun 2021 13:36:55 +0200 Subject: [PATCH 02/30] Cleaning up --- scripts/install | 2 +- scripts/restore | 3 --- scripts/upgrade | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 655d5ac..b1a3e19 100644 --- a/scripts/install +++ b/scripts/install @@ -129,8 +129,8 @@ ynh_script_progression --message="Modifying a config file..." path=${path_url:1} ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" -ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc" chmod 600 $final_path/config.json +ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc" chmod 600 $final_path/.sequelizerc chmod +x $final_path/app.js diff --git a/scripts/restore b/scripts/restore index 9cd1a86..6f18d0d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -84,9 +84,6 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -# Install Yarn -ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5dc0268..62f8620 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -133,11 +133,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Building CodiMD... (this will take some time and resources!)" --weight=16 - pushd "$final_path" || ynh_die + pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less bin/setup ynh_exec_warn_less ynh_npm run build - popd || ynh_die + popd fi #================================================= From b13e32941f5760ecdfaae1846732e2af93fc1f9c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Jun 2021 15:33:30 +0200 Subject: [PATCH 03/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 72debb0..76d8326 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ }, "license": "AGPL-3.0-only", "maintainer": { - "name": "" + "name": "eric_G" }, "requirements": { "yunohost": ">= 4.2.4" From c65b766db03cce03e4c89189da72f3eed4d534d7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 4 Sep 2021 11:37:40 +0200 Subject: [PATCH 04/30] Fix --- doc/DESCRIPTION.md | 3 +++ doc/DESCRIPTION_fr.md | 3 +++ scripts/restore | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..e07466b --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,3 @@ +CodiMD is the free software version of HackMD, developed and opened source by the HackMD team with reduced features (without book mode), you can use CodiMD for your community and own all your data. [(See the origin of the name CodiMD.)](https://github.com/hackmdio/codimd/issues/720) + +CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..0e66857 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,3 @@ +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) + +CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. \ No newline at end of file diff --git a/scripts/restore b/scripts/restore index 6f18d0d..7051136 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,8 +38,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -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 3db8e4e625027a25c8b8a8bc6f9e752541a89967 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 4 Sep 2021 09:37:46 +0000 Subject: [PATCH 05/30] Auto-update README --- README.md | 4 +++- README_fr.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c24ab5b..800b584 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Collaborative editor to work on notes written in Markdown +CodiMD is the free software version of HackMD, developed and opened source by the HackMD team with reduced features (without book mode), you can use CodiMD for your community and own all your data. [(See the origin of the name CodiMD.)](https://github.com/hackmdio/codimd/issues/720) + +CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. **Shipped version:** 2.4.1~ynh1 diff --git a/README_fr.md b/README_fr.md index f0a4ea7..f7ded10 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Éditeur collaboratif pour travailler sur des notes en Markdown +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) + +CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. **Version incluse :** 2.4.1~ynh1 From 9f89350affaaa1b086f728fd6dcec244bf81d21f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 4 Sep 2021 11:38:37 +0200 Subject: [PATCH 06/30] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 0e66857..71aedb0 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,3 +1,3 @@ -CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. ([Voir l'origine du nom CodiMD.])(https://github.com/hackmdio/codimd/issues/720) CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. \ No newline at end of file From eff3bc4f142298ddd84fbea13a9e9cd351129a96 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 4 Sep 2021 09:39:05 +0000 Subject: [PATCH 07/30] Auto-update README --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index f7ded10..f076f8c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. ([Voir l'origine du nom CodiMD.])(https://github.com/hackmdio/codimd/issues/720) CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. From b2184ee710b5cae721abff4f39c18e45b6b0eaf8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 4 Sep 2021 11:39:46 +0200 Subject: [PATCH 08/30] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 71aedb0..0e66857 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,3 +1,3 @@ -CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. ([Voir l'origine du nom CodiMD.])(https://github.com/hackmdio/codimd/issues/720) +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. \ No newline at end of file From 09298bfdc96758bfdbc2ec07cf34ed7b278bd073 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 4 Sep 2021 09:43:52 +0000 Subject: [PATCH 09/30] Auto-update README --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index f076f8c..f7ded10 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. ([Voir l'origine du nom CodiMD.])(https://github.com/hackmdio/codimd/issues/720) +CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'équipe HackMD avec des fonctionnalités réduites (sans mode livre), vous pouvez utiliser CodiMD pour votre communauté et posséder toutes vos données. [(Voir l'origine du nom CodiMD.)](https://github.com/hackmdio/codimd/issues/720) CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. From 1658754751ee2baaca1b921d5d6191d5f1a84182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 7 Sep 2021 23:08:32 +0200 Subject: [PATCH 10/30] Update systemd.service (#63) --- conf/systemd.service | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index b5a8d73..f9f591f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -15,7 +15,35 @@ Restart=always PrivateTmp=true PrivateDevices=true +# 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 +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap + +# 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 11f3e6b27763854c8b9bce5e26e1bb7e97578b8e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 10 Sep 2021 10:12:02 +0200 Subject: [PATCH 11/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 76d8326..2a5d734 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "2.4.1~ynh1", + "version": "2.4.1~ynh2", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", From 95a7382b0cd572a26356b7013a0e9a3e3fc8af25 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 10 Sep 2021 08:12:10 +0000 Subject: [PATCH 12/30] 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 800b584..645ec00 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh1 +**Shipped version:** 2.4.1~ynh2 diff --git a/README_fr.md b/README_fr.md index f7ded10..26bbd98 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh1 +**Version incluse :** 2.4.1~ynh2 From 82732972f587ab9e86c05e4e1bb081609dfccd5e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 10 Sep 2021 10:17:14 +0200 Subject: [PATCH 13/30] Update check_process --- check_process | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 03b75a3..0110e79 100644 --- a/check_process +++ b/check_process @@ -12,9 +12,15 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=0d58e34697338049d951c8373da3d363a121d439 backup_restore=1 multi_instance=0 change_url=1 ;;; Options Email= -Notification=none \ No newline at end of file +Notification=none +;;; Upgrade options + ; commit=0d58e34697338049d951c8373da3d363a121d439 + name=Upgrade to version 2.4.1 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + From 24c11b33760327f6312f79e19fb078e008407815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Sep 2021 10:49:57 +0200 Subject: [PATCH 14/30] Create updater.yml --- .github/workflows/updater.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..ca77fed --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,48 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false From bf6e90ba8059d4215f92b4215ea4968a5f1d088a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 16 Sep 2021 10:52:44 +0200 Subject: [PATCH 15/30] Fix --- .github/workflows/updater.sh | 129 +++++++++++++++++++++++++++++++++++ conf/app.src | 1 - scripts/remove | 1 - 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/updater.sh diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..88338a3 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +# Remove this exit command when you are ready to run this Action +#exit 1 + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) +assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) + +# if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then +# version=${version:1} +# fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) +echo "${#assets[@]} available asset(s)" + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Here we use the $assets variable to get the resources published in the upstream release. +# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. + +# Let's loop over the array of assets URLs +for asset_url in ${assets[@]}; do + +echo "Handling asset at $asset_url" + +# Assign the asset to a source file in conf/ directory +# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) +# Leave $src empty to ignore the asset +case $asset_url in + *".tar.gz"*) + src="app" + ;; +esac + +# If $src is not empty, let's process the asset +if [ ! -z "$src" ]; then + +# Create the temporary directory +tempdir="$(mktemp -d)" + +# Download sources and calculate checksum +filename=${asset_url##*/} +curl --silent -4 -L $asset_url -o "$tempdir/$filename" +checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + +# Delete temporary directory +rm -rf $tempdir + +# Get extension +if [[ $filename == *.tar.gz ]]; then + extension=tar.gz +else + extension=${filename##*.} +fi + +# Rewrite source file +cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +EOT +echo "... conf/$src.src updated" + +else +echo "... asset ignored" +fi + +done + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Install moreutils, needed for sponge +sudo apt-get install moreutils + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/conf/app.src b/conf/app.src index cffbe22..b97c2a9 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=3bf516ca447aefc2c3ca9f94c76eeb1d1a14d4a0e24dca044b87ea89f1acdf73 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/scripts/remove b/scripts/remove index 2dddf1c..fa4182c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -57,7 +57,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies - ynh_remove_nodejs #================================================= From 26ec47b8a5d3b2eb857a9560508593d4ecf8c018 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 16 Sep 2021 10:53:00 +0200 Subject: [PATCH 16/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 2a5d734..8c15aa4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "2.4.1~ynh2", + "version": "2.4.1~ynh3", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", From c3e45a1f7bcd76dba63577d63182331c531fc15b Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 16 Sep 2021 08:53:06 +0000 Subject: [PATCH 17/30] 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 645ec00..d288478 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh2 +**Shipped version:** 2.4.1~ynh3 diff --git a/README_fr.md b/README_fr.md index 26bbd98..4f23b28 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh2 +**Version incluse :** 2.4.1~ynh3 From 517e1f7c18a231360c0324c52d502685df6a3f83 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 20 Sep 2021 22:32:19 +0200 Subject: [PATCH 18/30] Update manifest.json --- manifest.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 8c15aa4..227fdc8 100644 --- a/manifest.json +++ b/manifest.json @@ -30,8 +30,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "is_public", From 42adf0f5b4c9e2cebc7ea542e407355a7566eab1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Nov 2021 23:34:03 +0100 Subject: [PATCH 19/30] Update updater.sh --- .github/workflows/updater.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 88338a3..1e2f8ef 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -116,9 +116,6 @@ done # GENERIC FINALIZATION #================================================= -# Install moreutils, needed for sponge -sudo apt-get install moreutils - # Replace new version in manifest echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json From 4941306c234fdff3441b167dbd6e523f2da3b9e3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Nov 2021 15:36:45 +0100 Subject: [PATCH 20/30] 4.3 --- conf/nginx.conf | 4 ---- manifest.json | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index eb64297..c43334b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,4 @@ location / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; diff --git a/manifest.json b/manifest.json index 227fdc8..1b33ec4 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "name": "eric_G" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ From 1446a2fc66809ec47e59a71fca81f0b6daa3e037 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Nov 2021 18:17:18 +0100 Subject: [PATCH 21/30] Fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b1a3e19..857684b 100644 --- a/scripts/install +++ b/scripts/install @@ -119,7 +119,7 @@ ynh_script_progression --message="Building CodiMD... (this will take some time a pushd $final_path ynh_use_nodejs ynh_exec_as $app env $ynh_node_load_PATH bin/setup - ynh_exec_as $app env $ynh_node_load_PATH npm run build + ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 62f8620..beaa315 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -136,7 +136,7 @@ then pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less bin/setup - ynh_exec_warn_less ynh_npm run build + ynh_exec_warn_less $ynh_npm run build popd fi From c272baaa81412d87d24f4d906aea05ea10f11762 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Nov 2021 18:17:28 +0100 Subject: [PATCH 22/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1b33ec4..b31ae65 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "2.4.1~ynh3", + "version": "2.4.1~ynh4", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", From 43a04536c86ef4e7769a54f8c099aab3e9f52955 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 21 Nov 2021 17:17:33 +0000 Subject: [PATCH 23/30] 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 d288478..b50fe7b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh3 +**Shipped version:** 2.4.1~ynh4 diff --git a/README_fr.md b/README_fr.md index 4f23b28..52c5409 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh3 +**Version incluse :** 2.4.1~ynh4 From 2d989b0e1bfbc50a654c95bed9e538b47b0082ca Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 4 Feb 2022 00:57:49 +0100 Subject: [PATCH 24/30] Apply example_ynh --- check_process | 1 - scripts/backup | 3 ++- scripts/change_url | 10 +++++----- scripts/install | 11 +++++++---- scripts/remove | 26 +++++++++++++------------- scripts/restore | 5 +++-- scripts/upgrade | 33 +++++++++++++++++---------------- 7 files changed, 47 insertions(+), 42 deletions(-) diff --git a/check_process b/check_process index 0110e79..bc6846b 100644 --- a/check_process +++ b/check_process @@ -23,4 +23,3 @@ Notification=none ; commit=0d58e34697338049d951c8373da3d363a121d439 name=Upgrade to version 2.4.1 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& - diff --git a/scripts/backup b/scripts/backup index 20b631a..77494ff 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # 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 @@ -66,4 +67,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for CodiMD. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index e3caab9..fdedb7c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,9 +34,9 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up CodiMD before changing its URL (may take a while)..." --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -44,7 +44,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -76,7 +76,7 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -117,4 +117,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for CodiMD" --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 857684b..343d75d 100644 --- a/scripts/install +++ b/scripts/install @@ -123,9 +123,9 @@ pushd $final_path popd #================================================= -# MODIFY A CONFIG FILE +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Adding a configuration file..." path=${path_url:1} ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" @@ -140,6 +140,7 @@ chmod +x $final_path/app.js #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 +# Create a dedicated systemd config ynh_add_systemd_config #================================================= @@ -162,9 +163,11 @@ ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_ #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 -# Make app public if necessary or protect it +# 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 @@ -179,4 +182,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of CodiMD completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index fa4182c..52d4f14 100644 --- a/scripts/remove +++ b/scripts/remove @@ -17,9 +17,9 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) 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) #================================================= # STANDARD REMOVE @@ -27,7 +27,7 @@ db_user=$db_name # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +# 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..." --weight=1 @@ -50,19 +50,10 @@ ynh_script_progression --message="Removing the PostgreSQL database..." --weight= # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies -ynh_remove_nodejs - #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing CodiMD main directory..." --weight=6 +ynh_script_progression --message="Removing app main directory..." --weight=6 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -75,6 +66,15 @@ 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 +ynh_remove_nodejs + #================================================= # GENERIC FINALIZATION #================================================= @@ -89,4 +89,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of CodiMD completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 7051136..81ce72d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # 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 @@ -61,7 +62,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring CodiMD main directory..." --weight=60 +ynh_script_progression --message="Restoring the app main directory..." --weight=60 ynh_restore_file --origin_path="$final_path" @@ -126,4 +127,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for CodiMD" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index beaa315..fc0480c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,30 +27,19 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up CodiMD before upgrading (may take a while)..." --weight=20 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=20 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -65,6 +54,18 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #================================================= @@ -143,7 +144,7 @@ fi #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=2 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Create a dedicated systemd config ynh_add_systemd_config @@ -173,4 +174,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of CodiMD completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last From 5243906c0e5984f155b5d7d3e32ae8464acd256b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 5 Feb 2022 08:22:15 +0100 Subject: [PATCH 25/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index b31ae65..53fddac 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "2.4.1~ynh4", + "version": "2.4.1~ynh5", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", From 9e02e1eabddca1547bc65553b370bb47842ce311 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 5 Feb 2022 07:22:19 +0000 Subject: [PATCH 26/30] 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 b50fe7b..5a7124d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh4 +**Shipped version:** 2.4.1~ynh5 diff --git a/README_fr.md b/README_fr.md index 52c5409..d807d75 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh4 +**Version incluse :** 2.4.1~ynh5 From 89967ef138cf4f075ab7588716a82160ee42a243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 7 Mar 2022 20:37:06 +0100 Subject: [PATCH 27/30] Upgrade nodejs (#70) * Upgrade Nodejs * Fix * Update _common.sh --- conf/config.json.example | 2 +- scripts/_common.sh | 2 +- scripts/install | 13 ++++++------- scripts/upgrade | 16 ++++++++-------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/conf/config.json.example b/conf/config.json.example index 1b80da5..89d0d06 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -29,7 +29,7 @@ "addGoogleAnalytics": false }, "db": { - "username": "__DB_NAME__", + "username": "__DB_USER__", "password": "__DB_PWD__", "database": "__DB_NAME__", "host": "localhost", diff --git a/scripts/_common.sh b/scripts/_common.sh index 6901352..3d61bd4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="postgresql apt-transport-https libssl-dev" -nodejs_version=11 +nodejs_version=12 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 343d75d..b31def0 100644 --- a/scripts/install +++ b/scripts/install @@ -83,10 +83,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +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_name --db_name=$db_name +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -125,14 +125,13 @@ popd #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Modifying a config file..." --weight=1 -path=${path_url:1} ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" -chmod 600 $final_path/config.json ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc" -chmod 600 $final_path/.sequelizerc +chmod 600 $final_path/config.json +chmod 600 $final_path/.sequelizerc chmod +x $final_path/app.js #================================================= @@ -146,7 +145,7 @@ ynh_add_systemd_config #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index fc0480c..186b2b7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,24 +83,24 @@ then ynh_script_progression --message="Upgrading source files..." --weight=16 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -a "$final_path/config.json" "$tmpdir/config.json" - cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc" + #cp -a "$final_path/config.json" "$tmpdir/config.json" + #cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc" # Remove the app directory securely - ynh_secure_remove --file=$final_path + #ynh_secure_remove --file=$final_path # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path + ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json $final_path/.sequelizerc" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.json" "$final_path/config.json" - cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc" + #cp -a "$tmpdir/config.json" "$final_path/config.json" + #cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc" # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + #ynh_secure_remove --file="$tmpdir" fi chmod 750 "$final_path" From f9457319da55578311d09dbcfd51aa52cc5f4fe1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Mar 2022 11:44:35 +0100 Subject: [PATCH 28/30] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 53fddac..17ffbb5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "2.4.1~ynh5", + "version": "2.4.1~ynh6", "url": "https://github.com/hackmdio/codimd", "upstream": { "license": "AGPL-3.0-only", From 1bec573f910a0ca5b5321e8a03505050a7741668 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 8 Mar 2022 10:44:42 +0000 Subject: [PATCH 29/30] 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 5a7124d..b5542f0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases. -**Shipped version:** 2.4.1~ynh5 +**Shipped version:** 2.4.1~ynh6 diff --git a/README_fr.md b/README_fr.md index d807d75..2d8acd2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l' CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale. -**Version incluse :** 2.4.1~ynh5 +**Version incluse :** 2.4.1~ynh6 From b393a0e9f2055352a12cd35208b94cb7bfc94c60 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 27 May 2022 22:16:41 +0000 Subject: [PATCH 30/30] Auto-update README --- README.md | 23 +++++++++++------------ README_fr.md | 29 ++++++++++++++++------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b5542f0..b001677 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # CodiMD for YunoHost -[![Integration level](https://dash.yunohost.org/integration/codimd.svg)](https://dash.yunohost.org/appci/app/codimd) ![](https://ci-apps.yunohost.org/ci/badges/codimd.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/codimd.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/codimd.svg)](https://dash.yunohost.org/appci/app/codimd) ![Working status](https://ci-apps.yunohost.org/ci/badges/codimd.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/codimd.maintain.svg) [![Install CodiMD with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=codimd) *[Lire ce readme en français.](./README_fr.md)* @@ -21,11 +21,9 @@ CodiMD is perfect for open communities, while HackMD emphasizes on permission an **Shipped version:** 2.4.1~ynh6 - - ## Screenshots -![](./doc/screenshots/screenshot.png) +![Screenshot of CodiMD](./doc/screenshots/screenshot.png) ## Disclaimers / important information @@ -40,22 +38,23 @@ You can configure CodiMD by editing this file `/var/www/codimd/config.json` usin ## Documentation and resources -* Official app website: https://hackmd.io/ -* Official user documentation: https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation#User-Guides -* Official admin documentation: https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation#Administration-Guides -* Upstream app code repository: https://github.com/hackmdio/codimd -* YunoHost documentation for this app: https://yunohost.org/app_codimd -* Report a bug: https://github.com/YunoHost-Apps/codimd_ynh/issues +* Official app website: +* Official user documentation: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/codimd_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/codimd_ynh/tree/testing --debug or sudo yunohost app upgrade codimd -u https://github.com/YunoHost-Apps/codimd_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 2d8acd2..909a95f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # CodiMD pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/codimd.svg)](https://dash.yunohost.org/appci/app/codimd) ![](https://ci-apps.yunohost.org/ci/badges/codimd.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/codimd.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/codimd.svg)](https://dash.yunohost.org/appci/app/codimd) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/codimd.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/codimd.maintain.svg) [![Installer CodiMD avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=codimd) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer CodiMD 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.* @@ -17,11 +21,9 @@ CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accen **Version incluse :** 2.4.1~ynh6 - - ## Captures d'écran -![](./doc/screenshots/screenshot.png) +![Capture d'écran de CodiMD](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -36,22 +38,23 @@ Vous pouvez configurer CodiMD en éditant ce fichier `/var/www/codimd/config.jso ## Documentations et ressources -* Site officiel de l'app : https://hackmd.io/ -* Documentation officielle utilisateur : https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation#User-Guides -* Documentation officielle de l'admin : https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation#Administration-Guides -* Dépôt de code officiel de l'app : https://github.com/hackmdio/codimd -* Documentation YunoHost pour cette app : https://yunohost.org/app_codimd -* Signaler un bug : https://github.com/YunoHost-Apps/codimd_ynh/issues +* Site officiel de l'app : +* Documentation officielle utilisateur : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/codimd_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/codimd_ynh/tree/testing --debug ou sudo yunohost app upgrade codimd -u https://github.com/YunoHost-Apps/codimd_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :**