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 diff --git a/README.md b/README.md index 60903dc..59c5223 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 -The Standard Notes Web App. An end-to-end encrypted note-taking app. Web, Mac, Windows, Linux, iOS, and Android. +End-to-end encrypted note-taking app -**Shipped version:** 3.8.25~ynh2 +**Shipped version:** 3.14.0~ynh1 **Demo:** https://standardnotes.org/demo diff --git a/README_fr.md b/README_fr.md index ae1ecf5..6925b90 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,9 +11,9 @@ 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 :** 3.8.25~ynh2 +**Version incluse :** 3.14.0~ynh1 **Démo :** https://standardnotes.org/demo 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__/ diff --git a/manifest.json b/manifest.json index cc540f2..7580ac9 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,10 @@ "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", + "fr": "Application de prise de notes chiffrées" }, - "version": "3.8.25~ynh2", + "version": "3.14.0~ynh1", "url": "https://github.com/standardnotes/web", "upstream": { "license": "AGPL-3.0-or-later", @@ -21,7 +22,7 @@ "email": "46000361+FabianWilkens@users.noreply.github.com" }, "requirements": { - "yunohost": ">= 4.2.4" + "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..8dc8f89 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="5735ec38f67b42805962c8c7e43b8aea2a65ba4e" node_max_old_space_size=2048 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/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 #================================================= 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