From d037817d59c67ef9cc38fb7f8c06daeeaefad5bf Mon Sep 17 00:00:00 2001 From: Fabian Wilkens <46000361+FabianWilkens@users.noreply.github.com> Date: Sat, 8 Jan 2022 18:36:42 +0100 Subject: [PATCH 01/12] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index cc540f2..c2b1870 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "46000361+FabianWilkens@users.noreply.github.com" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3" }, "multi_instance": true, "services": [ From 26416a05c02b0d9d6733d9f7c7474d8dd894cdc4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Apr 2022 08:52:48 +0200 Subject: [PATCH 02/12] upgrade --- manifest.json | 7 ++++--- scripts/_common.sh | 4 ++-- scripts/remove | 10 ---------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/manifest.json b/manifest.json index c2b1870..42c7fbb 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "snweb", "packaging_format": 1, "description": { - "en": "The Standard Notes Web App. An end-to-end encrypted note-taking app. Web, Mac, Windows, Linux, iOS, and Android." + "en": "End-to-end encrypted note-taking app", + "en": "Application de prise de notes chiffrée" }, "version": "3.8.25~ynh2", "url": "https://github.com/standardnotes/web", @@ -21,7 +22,7 @@ "email": "46000361+FabianWilkens@users.noreply.github.com" }, "requirements": { - "yunohost": ">= 4.3" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -39,7 +40,7 @@ "example": "/notes", "default": "/", "help": { - "en": "You can use extensions only without a path url." + "en": "You can use extensions only without a path URL." } }, { diff --git a/scripts/_common.sh b/scripts/_common.sh index 172122c..27c6652 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -14,10 +14,10 @@ pkg_dependencies="\ " RUBY_VERSION="2.7.3" -NODEJS_VERSION="15.11.0" +NODEJS_VERSION="16" SOURCE="https://github.com/standardnotes/web" -COMMIT="e856ce7bfd3a7b357544e43ca343b1ec861debb3" +COMMIT="90fcac61e0ed58e875648951fd4c257cd77a4165" node_max_old_space_size=2048 diff --git a/scripts/remove b/scripts/remove index 460bbc1..4552e6f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -76,16 +76,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= From 5c5055a89383bd319cf66a62c610e3034fd2cf36 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 Apr 2022 06:52:53 +0000 Subject: [PATCH 03/12] Auto-update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60903dc..c3a14fc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -The Standard Notes Web App. An end-to-end encrypted note-taking app. Web, Mac, Windows, Linux, iOS, and Android. +Application de prise de notes chiffrée **Shipped version:** 3.8.25~ynh2 From 4a2f282abc80f062c40cb075ba44f6ab084ccf5c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Apr 2022 10:52:40 +0200 Subject: [PATCH 04/12] Set version to tag --- manifest.json | 4 ++-- scripts/_common.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 42c7fbb..58351b1 100644 --- a/manifest.json +++ b/manifest.json @@ -4,9 +4,9 @@ "packaging_format": 1, "description": { "en": "End-to-end encrypted note-taking app", - "en": "Application de prise de notes chiffrée" + "en": "Application de prise de notes chiffrées" }, - "version": "3.8.25~ynh2", + "version": "10.17.0~ynh1", "url": "https://github.com/standardnotes/web", "upstream": { "license": "AGPL-3.0-or-later", diff --git a/scripts/_common.sh b/scripts/_common.sh index 27c6652..8dc8f89 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,7 +17,7 @@ RUBY_VERSION="2.7.3" NODEJS_VERSION="16" SOURCE="https://github.com/standardnotes/web" -COMMIT="90fcac61e0ed58e875648951fd4c257cd77a4165" +COMMIT="5735ec38f67b42805962c8c7e43b8aea2a65ba4e" node_max_old_space_size=2048 From 3bed941aeefafb2a85f4b695a56c50d31533a5fa Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 Apr 2022 08:52:49 +0000 Subject: [PATCH 05/12] Auto-update README --- README.md | 4 ++-- README_fr.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c3a14fc..d12177c 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Application de prise de notes chiffrée +Application de prise de notes chiffrées -**Shipped version:** 3.8.25~ynh2 +**Shipped version:** 10.17.0~ynh1 **Demo:** https://standardnotes.org/demo diff --git a/README_fr.md b/README_fr.md index ae1ecf5..72a098e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour -**Version incluse :** 3.8.25~ynh2 +**Version incluse :** 10.17.0~ynh1 **Démo :** https://standardnotes.org/demo From b72f05399c1b41a073749e0907192b1dd1690ce0 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 10 Apr 2022 11:10:02 +0200 Subject: [PATCH 06/12] Fix: add "bundle update" to install and upgrade script --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 6ebca8c..974fac3 100644 --- a/scripts/install +++ b/scripts/install @@ -161,6 +161,7 @@ pushd "$final_path/live" ynh_use_nodejs ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle' ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development' + ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle update -j$(getconf _NPROCESSORS_ONLN) --quiet ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install --pure-lockfile ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn bundle diff --git a/scripts/upgrade b/scripts/upgrade index 0e33369..91498c6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -181,6 +181,7 @@ then ynh_use_nodejs ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle' ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development' + ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle update -j$(getconf _NPROCESSORS_ONLN) --quiet ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install --pure-lockfile ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn bundle From ff08714c60ad794a08259bc4559eb6c3d398bdc7 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 10 Apr 2022 11:16:09 +0200 Subject: [PATCH 07/12] Update: env.sample --- conf/env.sample | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/conf/env.sample b/conf/env.sample index f911665..da5fdc0 100644 --- a/conf/env.sample +++ b/conf/env.sample @@ -2,20 +2,21 @@ RAILS_ENV=production PORT=__PORT__ WEB_CONCURRENCY=0 RAILS_LOG_TO_STDOUT=true + # Log Level options: "INFO" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL" RAILS_LOG_LEVEL=INFO + RAILS_SERVE_STATIC_FILES=true SECRET_KEY_BASE=__SECRET_KEY_BASE__ + APP_HOST=http://__DOMAIN____PATH__/ +PURCHASE_URL=https://standardnotes.com/purchase +PLANS_URL=https://standardnotes.com/plans +DASHBOARD_URL=http://standardnotes.com/dashboard +DEFAULT_SYNC_SERVER=https://__SNSERVER_DOMAIN__/ +WEBSOCKET_URL=wss://sockets-dev.standardnotes.com -EXTENSIONS_MANAGER_LOCATION=extensions/extensions-manager/dist/index.html -SF_DEFAULT_SERVER=https://__SNSERVER_DOMAIN__/ - -# Development options -DEV_DEFAULT_SYNC_SERVER=https://api.standardnotes.org -DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html ENABLE_UNFINISHED_FEATURES=false -DEV_WEBSOCKET_URL=wss://sockets-dev.standardnotes.com # NewRelic (Optional) NEW_RELIC_ENABLED=false @@ -24,5 +25,9 @@ NEW_RELIC_LICENSE_KEY= NEW_RELIC_APP_NAME=Web NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false +DEV_ACCOUNT_EMAIL= +DEV_ACCOUNT_PASSWORD= +DEV_ACCOUNT_SERVER= + # Sub-URI RAILS_RELATIVE_URL_ROOT=__PATH__/ From 056838362d8edcd78a70c2af6dcdd604f05da149 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Apr 2022 15:11:08 +0200 Subject: [PATCH 08/12] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 58351b1..259f51c 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "End-to-end encrypted note-taking app", - "en": "Application de prise de notes chiffrées" + "fr": "Application de prise de notes chiffrées" }, "version": "10.17.0~ynh1", "url": "https://github.com/standardnotes/web", From 0fae881efa2945aea4bf6ca0278df4daac764e13 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 Apr 2022 13:11:14 +0000 Subject: [PATCH 09/12] 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 d12177c..0e8c559 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Application de prise de notes chiffrées +End-to-end encrypted note-taking app **Shipped version:** 10.17.0~ynh1 diff --git a/README_fr.md b/README_fr.md index 72a098e..10387b6 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 - +Application de prise de notes chiffrées **Version incluse :** 10.17.0~ynh1 From b82efd924c4076aefc71c0d96a9c5f89cb7b474c Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 10 Apr 2022 17:22:28 +0200 Subject: [PATCH 10/12] Update: ci-auto-update --- .github/workflows/updater.sh | 36 ++++++++++++++++++++++++----------- .github/workflows/updater.yml | 11 ++++++----- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 821f608..819a51f 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -15,32 +15,40 @@ # Fetching information current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +current_ynh_version=$(cat manifest.json | jq -j '.version|split("~ynh")[1]') +current_commit=$(cat scripts/_common.sh | awk -F= '/^COMMIT/ { print $2 }') 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="https://github.com/$repo/archive/refs/tags/$version.tar.gz" -commit=$(curl --silent "https://api.github.com/repos/$repo/tags" | jq -r '[ .[] | select(.name=="'$version'").commit.sha ] | join(" ") | @sh' | tr -d "'") +tag_version=$(curl --silent "https://api.github.com/repos/$repo/tags" | jq -r '.[] | .name' | sort -V | tail -1) +version=$(curl --silent "https://raw.githubusercontent.com/$repo/$tag_version/package.json" | jq -j '.version') +assets="https://github.com/$repo/archive/refs/tags/$tag_version.tar.gz" +commit=$(curl --silent "https://api.github.com/repos/$repo/tags" | jq -r '[ .[] | select(.name=="'$tag_version'").commit.sha ] | join(" ") | @sh' | tr -d "'") # Later down the script, we assume the version has only digits and dots # Sometimes the release name starts with a "v", so let's filter it out. # You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi +#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 "Current ynh version: $current_ynh_version" +echo "Current commit: $current_commit" +echo "Latest tag version from upstream: $tag_version" +echo "Latest version from upstream: $version" + echo "VERSION=$version" >> $GITHUB_ENV +echo "YNH_VERSION=$current_ynh_version" >> $GITHUB_ENV +echo "TAG_VERSION=$tag_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 +if [[ ${current_commit:1:-1} == $commit ]] ; 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 +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version-tag$tag_version ; then echo "::warning ::A branch already exists for this update" exit 0 fi @@ -63,8 +71,14 @@ sed -i 's/COMMIT=".*"$/COMMIT="'$commit'"/g' $filename # GENERIC FINALIZATION #================================================= +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + new_version="$version~ynh$((current_ynh_version+1))" +else + new_version="$version~ynh1" +fi + # Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json +echo "$(jq -s --indent 4 ".[] | .version = \"$new_version\"" manifest.json)" > manifest.json # No need to update the README, yunohost-bot takes care of it diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index dd636c7..13cada3 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -29,21 +29,22 @@ jobs: id: commit if: ${{ env.PROCEED == 'true' }} run: | - git commit -am "Upgrade to v$VERSION" + git commit -am "Upgrade to version $VERSION - tag $TAG_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: Update to version ${{ env.VERSION }}' + commit-message: 'Update: Update to version ${{ env.VERSION }} - tag ${{ env.TAG_VERSION }}' committer: 'yunohost-bot ' author: 'yunohost-bot ' signoff: false base: testing - branch: ci-auto-update-v${{ env.VERSION }} + branch: ci-auto-update-v${{ env.VERSION }}-tag${{ env.TAG_VERSION }} delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' + title: 'Upgrade to version ${{ env.VERSION }} - tag ${{ env.TAG_VERSION }}' body: | - Upgrade to v${{ env.VERSION }} + Upgrade to version ${{ env.VERSION }} + Upgrade to tag ${{ env.TAG_VERSION }} draft: false From 0254dc475e996878e93bc9232c2d624d35da07bc Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 10 Apr 2022 17:28:45 +0200 Subject: [PATCH 11/12] Fix: version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 259f51c..7580ac9 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "End-to-end encrypted note-taking app", "fr": "Application de prise de notes chiffrées" }, - "version": "10.17.0~ynh1", + "version": "3.14.0~ynh1", "url": "https://github.com/standardnotes/web", "upstream": { "license": "AGPL-3.0-or-later", From 4a429ec639ab1f2957204a4422699e9229ab79f5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 Apr 2022 15:29:58 +0000 Subject: [PATCH 12/12] 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 0e8c559..59c5223 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in End-to-end encrypted note-taking app -**Shipped version:** 10.17.0~ynh1 +**Shipped version:** 3.14.0~ynh1 **Demo:** https://standardnotes.org/demo diff --git a/README_fr.md b/README_fr.md index 10387b6..6925b90 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Application de prise de notes chiffrées -**Version incluse :** 10.17.0~ynh1 +**Version incluse :** 3.14.0~ynh1 **Démo :** https://standardnotes.org/demo