diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 819a51f..cc18f85 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -18,10 +18,19 @@ 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]') -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 "'") + +page=0 +tag_version="" +while [ -z $tag_version ] +do + let page++ + tag_version=$(curl --silent "https://api.github.com/repos/$repo/tags?per_page=100&page=$page" | jq -r '.[] | .name' | grep -v "alpha" | grep "@standardnotes/web@" | sort -V | tail -1) + +done + +version=$(curl --silent "https://raw.githubusercontent.com/$repo/$tag_version/packages/web/package.json" | jq -j '.version') +asset="https://github.com/$repo/archive/refs/tags/$tag_version.tar.gz" +commit=$(curl --silent "https://api.github.com/repos/$repo/tags?per_page=100&page=$page" | 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. @@ -57,8 +66,34 @@ fi # UPDATE SOURCE FILES #================================================= -filename="scripts/_common.sh" -sed -i 's/COMMIT=".*"$/COMMIT="'$commit'"/g' $filename +# Create the temporary directory +tempdir="$(mktemp -d)" + +# Download sources and calculate checksum +filename=${asset##*/} +curl --silent -4 -L $asset -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/app.src +SOURCE_URL=$asset +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +EOT +echo "... conf/app.src updated" #================================================= # SPECIFIC UPDATE STEPS @@ -85,5 +120,3 @@ echo "$(jq -s --indent 4 ".[] | .version = \"$new_version\"" manifest.json)" > m # The Action will proceed only if the PROCEED environment variable is set to true echo "PROCEED=true" >> $GITHUB_ENV exit 0 - - diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index 13cada3..6d40a58 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -6,9 +6,9 @@ name: Check for new upstream releases on: # Allow to manually trigger the workflow workflow_dispatch: - # Run it every day at 6:00 UTC + # Run it every monday at 6:00 UTC schedule: - - cron: '0 6 * * *' + - cron: '0 6 * * 1' jobs: updater: runs-on: ubuntu-latest @@ -29,22 +29,21 @@ jobs: id: commit if: ${{ env.PROCEED == 'true' }} run: | - git commit -am "Upgrade to version $VERSION - tag $TAG_VERSION" + git commit -am "Upgrade to version $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 }} - tag ${{ env.TAG_VERSION }}' + commit-message: 'Update: Update to version ${{ env.VERSION }}' committer: 'yunohost-bot ' author: 'yunohost-bot ' signoff: false base: testing - branch: ci-auto-update-v${{ env.VERSION }}-tag${{ env.TAG_VERSION }} + branch: ci-auto-update-v${{ env.VERSION }} delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }} - tag ${{ env.TAG_VERSION }}' + title: 'Upgrade to version ${{ env.VERSION }}' body: | Upgrade to version ${{ env.VERSION }} - Upgrade to tag ${{ env.TAG_VERSION }} draft: false diff --git a/README.md b/README.md index 8f4259b..25f2242 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:** 3.20.2~ynh1 +**Shipped version:** 3.39.1~ynh1 **Demo:** https://standardnotes.org/demo @@ -29,12 +29,12 @@ End-to-end encrypted note-taking app * No single-sign on or LDAP integration * The app requires up 1500MB of RAM to install -* The app requires at least 80MB of RAM to work properly. -* The app requires around 1000MB of disk. +* The app requires at least 100MB of RAM to work properly. +* The app requires around 3500MB of disk. * A dedicated domain is requierd if you want to use extensions. - * notes.your-domain.tld/ -> Extension Manager is working - * your-domain.tld/notes/ -> Extension Manager is not working + * notes.your-domain.tld/ -> Extensions are working + * your-domain.tld/notes/ -> Extensions are not working * The config-file is stored under "/opt/yunohost/$app/live/.env" @@ -43,7 +43,7 @@ End-to-end encrypted note-taking app * Official app website: * Official user documentation: * Official admin documentation: -* Upstream app code repository: +* Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 0c0d526..61b0a43 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Application de prise de notes chiffrées -**Version incluse :** 3.20.2~ynh1 +**Version incluse :** 3.39.1~ynh1 **Démo :** https://standardnotes.org/demo @@ -29,12 +29,12 @@ Application de prise de notes chiffrées * No single-sign on or LDAP integration * The app requires up 1500MB of RAM to install -* The app requires at least 80MB of RAM to work properly. -* The app requires around 1000MB of disk. +* The app requires at least 100MB of RAM to work properly. +* The app requires around 3500MB of disk. * A dedicated domain is requierd if you want to use extensions. - * notes.your-domain.tld/ -> Extension Manager is working - * your-domain.tld/notes/ -> Extension Manager is not working + * notes.your-domain.tld/ -> Extensions are working + * your-domain.tld/notes/ -> Extensions are not working * The config-file is stored under "/opt/yunohost/$app/live/.env" @@ -43,7 +43,7 @@ Application de prise de notes chiffrées * Site officiel de l'app : * Documentation officielle utilisateur : * Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : diff --git a/check_process b/check_process index 5d1679f..979298f 100644 --- a/check_process +++ b/check_process @@ -11,8 +11,8 @@ setup_private=1 setup_public=1 upgrade=1 - # 3.14.0~ynh1 - upgrade=1 from_commit=6b533ef25d4454a09c4a6e5b135b4873a4cdbcb8 + # 3.20.2~ynh1 + # upgrade=1 from_commit=294a7b88cd8dbf396b6f90ecc164cedcb0516e57 backup_restore=1 multi_instance=1 port_already_use=0 @@ -21,6 +21,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=6b533ef25d4454a09c4a6e5b135b4873a4cdbcb8 - name=3.14.0~ynh1 + ; commit=294a7b88cd8dbf396b6f90ecc164cedcb0516e57 + name=3.20.2~ynh1 manifest_arg=domain=DOMAIN&is_public=1 diff --git a/conf/app.src b/conf/app.src new file mode 100644 index 0000000..abd6a8e --- /dev/null +++ b/conf/app.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/standardnotes/app/archive/refs/tags/@standardnotes/web@3.39.1.tar.gz +SOURCE_SUM=1dc84e151c20f5a31cf8b6f9c1248b14d2f72800f58557ddb8fe8ee54d360c58 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/env.sample b/conf/env.sample index da5fdc0..a9bb6b5 100644 --- a/conf/env.sample +++ b/conf/env.sample @@ -1,33 +1,15 @@ 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 -ENABLE_UNFINISHED_FEATURES=false +# Subscription related endpoints +DASHBOARD_URL=http://standardnotes.com/dashboard +PLANS_URL=https://standardnotes.com/plans +PURCHASE_URL=https://standardnotes.com/purchase -# NewRelic (Optional) -NEW_RELIC_ENABLED=false -NEW_RELIC_THREAD_PROFILER_ENABLED=false -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= +# Used by Rails internals and not Standard Notes related +SECRET_KEY_BASE=__SECRET_KEY_BASE__ # Sub-URI RAILS_RELATIVE_URL_ROOT=__PATH__/ diff --git a/conf/nginx.conf b/conf/nginx.conf index 52614d4..426082e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,10 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/live/public ; + alias __FINALPATH__/live/packages/web-server/public ; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - client_max_body_size 25M; + client_max_body_size 50M; proxy_pass http://127.0.0.1:__PORT____PATH__/; proxy_http_version 1.1; diff --git a/conf/systemd.service b/conf/systemd.service index 711412c..8a571ea 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,8 +7,8 @@ Type=simple User=__APP__ Group=__APP__ EnvironmentFile=__FINALPATH__/live/.env -WorkingDirectory=__FINALPATH__/live/ -ExecStart=__RBENV_INSTALL_DIR__/versions/__APP__/bin/bundle exec puma -C config/puma.rb -p __PORT__ -e production +WorkingDirectory=__FINALPATH__/live/packages/web-server/ +ExecStart=__RBENV_INSTALL_DIR__/versions/__APP__/bin/bundle exec rails s -b 0.0.0.0 -p __PORT__ -e production StandardOutput=append:/var/log/__APP__/snweb.log StandardError=inherit Restart=always diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 22efad9..2c669cc 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,10 +1,10 @@ * No single-sign on or LDAP integration * The app requires up 1500MB of RAM to install -* The app requires at least 80MB of RAM to work properly. -* The app requires around 1000MB of disk. +* The app requires at least 100MB of RAM to work properly. +* The app requires around 3500MB of disk. * A dedicated domain is requierd if you want to use extensions. - * notes.your-domain.tld/ -> Extension Manager is working - * your-domain.tld/notes/ -> Extension Manager is not working + * notes.your-domain.tld/ -> Extensions are working + * your-domain.tld/notes/ -> Extensions are not working * The config-file is stored under "/opt/yunohost/$app/live/.env" diff --git a/doc/screenshots/standard_notes.png b/doc/screenshots/standard_notes.png index 157a21b..400cdce 100644 Binary files a/doc/screenshots/standard_notes.png and b/doc/screenshots/standard_notes.png differ diff --git a/manifest.json b/manifest.json index 11b9d82..0ef3c17 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": "3.20.2~ynh1", + "version": "3.39.1~ynh1", "url": "https://github.com/standardnotes/web", "upstream": { "license": "AGPL-3.0-or-later", @@ -14,7 +14,7 @@ "demo": "https://standardnotes.org/demo", "admindoc": "https://docs.standardnotes.org/", "userdoc": "https://standardnotes.org/help", - "code": "https://github.com/standardnotes/web" + "code": "https://github.com/standardnotes/app" }, "license": "AGPL-3.0-or-later", "maintainer": { @@ -58,7 +58,7 @@ "en": "Choose the default Standard Notes Syncing Server", "de": "Wähle den Standard Notes Syncing Server" }, - "default": "sync.standardnotes.org" + "default": "api.standardnotes.org" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 376887d..c47cfa8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,19 +6,11 @@ # dependencies used by the app pkg_dependencies="\ - zlib1g-dev \ - libssl-dev \ - libjemalloc-dev \ - python2-minimal \ - git \ " -RUBY_VERSION="2.7.3" +RUBY_VERSION="2.7.4" NODEJS_VERSION="16" -SOURCE="https://github.com/standardnotes/web" -COMMIT="4d581feb0ac862e5face27be3fd52ac39f565d23" - node_max_old_space_size=2048 #================================================= diff --git a/scripts/install b/scripts/install index 974fac3..ab683b6 100644 --- a/scripts/install +++ b/scripts/install @@ -70,7 +70,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=30 -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_ruby --ruby_version=$RUBY_VERSION @@ -90,33 +90,12 @@ ynh_script_progression --message="Setting up source files..." --weight=16 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -mkdir -p "$final_path/live" -git clone $SOURCE "$final_path/live" --quiet -pushd "$final_path/live" - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet -popd - -# Apply Patch -if [ -f "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" ] -then - pushd "$final_path/live" - patch --strip=1 < "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" - popd -fi +ynh_setup_source --dest_dir="$final_path/live" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app: "$final_path" -# Set permissions to app files -mkdir -p "$final_path/live/log" -chown -R $app: "$final_path/live/log" -mkdir -p "$final_path/live/public" -chown -R $app: "$final_path/live/public" -mkdir -p "$final_path/live/tmp" -chown -R $app: "$final_path/live/tmp" - #================================================= # NGINX CONFIGURATION #================================================= @@ -159,13 +138,9 @@ chown -R $app: "$final_path" 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 - ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --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 + 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 build:web-server + 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 build:web popd #================================================= @@ -187,7 +162,6 @@ mkdir -p "/var/log/$app" chown -R $app: "/var/log/$app" # Use logrotate to manage application logfile(s) -ynh_use_logrotate --logfile="$final_path/live/log/production.log" ynh_use_logrotate --logfile="/var/log/$app/$app.log" #================================================= diff --git a/scripts/restore b/scripts/restore index f46a689..5429da9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -68,14 +68,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app: "$final_path" -# Set permissions to app files -mkdir -p "$final_path/live/log" -chown -R $app: "$final_path/live/log" -mkdir -p "$final_path/live/public" -chown -R $app: "$final_path/live/public" -mkdir -p "$final_path/live/tmp" -chown -R $app: "$final_path/live/tmp" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -84,7 +76,7 @@ chown -R $app: "$final_path/live/tmp" ynh_script_progression --message="Reinstalling dependencies... ( This may take a while... )" --weight=100 #294 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_ruby --ruby_version=$RUBY_VERSION diff --git a/scripts/upgrade b/scripts/upgrade index 91498c6..6c11c3b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,22 +98,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=17 - # Remove destination directory - ynh_secure_remove --file=$final_path - # Download - mkdir -p "$final_path" - git clone $SOURCE "$final_path/live" --quiet - pushd "$final_path/live" - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet - popd - # Apply Patch - if [ -f "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" ] - then - pushd "$final_path/live" - patch --strip=1 < "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" - popd - fi + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path/live" fi # Set permissions to app files @@ -121,13 +107,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app: "$final_path" -mkdir -p "$final_path/live/log" -chown -R $app: "$final_path/live/log" -mkdir -p "$final_path/live/public" -chown -R $app: "$final_path/live/public" -mkdir -p "$final_path/live/tmp" -chown -R $app: "$final_path/live/tmp" - #================================================= # NGINX CONFIGURATION #================================================= @@ -141,7 +120,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=37 -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_ruby --ruby_version=$RUBY_VERSION @@ -179,13 +158,9 @@ then 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 - ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --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 + 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 build:web-server + 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 build:web popd fi @@ -208,7 +183,6 @@ mkdir -p "/var/log/$app" chown -R $app: "/var/log/$app" # Use logrotate to manage application logfile(s) -ynh_use_logrotate --logfile="$final_path/live/log/production.log" ynh_use_logrotate --logfile="/var/log/$app/$app.log" #================================================= diff --git a/scripts/ynh_install_ruby__2 b/scripts/ynh_install_ruby__2 index 32a8ff4..982d0b2 100644 --- a/scripts/ynh_install_ruby__2 +++ b/scripts/ynh_install_ruby__2 @@ -12,6 +12,12 @@ rbenv_install_dir="/opt/rbenv" ruby_version_path="$rbenv_install_dir/versions" # RBENV_ROOT is the directory of rbenv, it needs to be loaded as a environment variable. export RBENV_ROOT="$rbenv_install_dir" +export rbenv_root="$rbenv_install_dir" + +ruby_dependencies="" +build_ruby_dependencies="libjemalloc-dev curl build-essential libreadline-dev zlib1g-dev libsqlite3-dev libssl-dev libxml2-dev libxslt-dev autoconf automake bison libtool" +pkg_dependencies="$pkg_dependencies $ruby_dependencies" +build_pkg_dependencies="$build_pkg_dependencies $build_ruby_dependencies" # Load the version of Ruby for an app, and set variables. # @@ -36,9 +42,9 @@ export RBENV_ROOT="$rbenv_install_dir" # Finally, to start a Ruby service with the correct version, 2 solutions # Either the app is dependent of Ruby or gem, but does not called it directly. # In such situation, you need to load PATH -# `Environment="__YNH_RUBY_LOAD_ENV_PATH__"` +# `Environment="__YNH_RUBY_LOAD_PATH__"` # `ExecStart=__FINALPATH__/my_app` -# You will replace __YNH_RUBY_LOAD_ENV_PATH__ with $ynh_ruby_load_path +# You will replace __YNH_RUBY_LOAD_PATH__ with $ynh_ruby_load_path # # Or Ruby start the app directly, then you don't need to load the PATH variable # `ExecStart=__YNH_RUBY__ my_app run` @@ -281,7 +287,7 @@ ynh_cleanup_ruby () { required_ruby_versions="${installed_app_ruby_version}\n${required_ruby_versions}" fi done - + # Remove no more needed Ruby versions local installed_ruby_versions=$(rbenv versions --bare --skip-aliases | grep -Ev '/') for installed_ruby_version in $installed_ruby_versions diff --git a/sources/patches/app-00-add-path-url.patch b/sources/patches/app-00-add-path-url.patch index 92d073a..d9bab2f 100644 --- a/sources/patches/app-00-add-path-url.patch +++ b/sources/patches/app-00-add-path-url.patch @@ -1,7 +1,7 @@ -diff --git a/config.ru b/config.ru +diff --git a/packages/web-server/config.ru b/packages/web-server/config.ru index bd83b25..6b1bb50 100644 ---- a/config.ru -+++ b/config.ru +--- a/packages/web-server/config.ru ++++ b/packages/web-server/config.ru @@ -1,4 +1,6 @@ # This file is used by Rack-based servers to start the application.