From 7e077a0e107994b030265cb23cde3e00a9799e75 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Fri, 28 Aug 2026 09:08:02 +0200 Subject: [PATCH] mastodon: read .ruby-version dynamically instead of hardcoding 4.0.5 --- ct/mastodon.sh | 5 ++++- install/mastodon-install.sh | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ct/mastodon.sh b/ct/mastodon.sh index 4380b3d61..ee145eba9 100644 --- a/ct/mastodon.sh +++ b/ct/mastodon.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -40,6 +42,7 @@ function update_script() { CLEAN_INSTALL=1 fetch_and_deploy_gh_release "mastodon" "mastodon/mastodon" "tarball" sed -i "s/config.force_ssl = true/config.force_ssl = ENV.fetch('LOCAL_HTTPS', 'false') == 'true'/" /opt/mastodon/config/environments/production.rb sed -i "s/https = Rails.env.production? || ENV\['LOCAL_HTTPS'\] == 'true'/https = ENV.fetch('LOCAL_HTTPS', 'false') == 'true'/" /opt/mastodon/config/initializers/1_hosts.rb + RUBY_VERSION="$(cat /opt/mastodon/.ruby-version)" RUBY_INSTALL_RAILS="false" setup_ruby msg_info "Installing Ruby Dependencies" cd /opt/mastodon diff --git a/install/mastodon-install.sh b/install/mastodon-install.sh index b5640c602..b2723cca7 100644 --- a/install/mastodon-install.sh +++ b/install/mastodon-install.sh @@ -48,13 +48,13 @@ PG_VERSION="17" setup_postgresql PG_DB_NAME="mastodon_production" PG_DB_USER="mastodon" PG_DB_SKIP_ALTER_ROLE="true" setup_postgresql_db $STD sudo -u postgres psql -c "ALTER USER mastodon CREATEDB;" -RUBY_VERSION="4.0.5" RUBY_INSTALL_RAILS="false" setup_ruby -export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" - fetch_and_deploy_gh_release "mastodon" "mastodon/mastodon" "tarball" sed -i "s/config.force_ssl = true/config.force_ssl = ENV.fetch('LOCAL_HTTPS', 'false') == 'true'/" /opt/mastodon/config/environments/production.rb sed -i "s/https = Rails.env.production? || ENV\['LOCAL_HTTPS'\] == 'true'/https = ENV.fetch('LOCAL_HTTPS', 'false') == 'true'/" /opt/mastodon/config/initializers/1_hosts.rb +RUBY_VERSION="$(cat /opt/mastodon/.ruby-version)" RUBY_INSTALL_RAILS="false" setup_ruby +export PATH="$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" + msg_info "Installing Ruby Dependencies" cd /opt/mastodon $STD bundle config set --local without 'development test'