From 282b953bc5ba78879ca10cb21473845cd9d9ba77 Mon Sep 17 00:00:00 2001 From: Daniel Dizdarevic Date: Fri, 20 Sep 2024 15:41:02 +0200 Subject: [PATCH] Fix precompile issue Yarn has to be started via corepack in the Mastodon directory. --- src/mastodon/bin/pre-migrate_if_required | 0 src/mastodon/bin/yarn | 5 +++++ src/mastodon/mastodon.env | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/mastodon/bin/pre-migrate_if_required create mode 100755 src/mastodon/bin/yarn diff --git a/src/mastodon/bin/pre-migrate_if_required b/src/mastodon/bin/pre-migrate_if_required old mode 100644 new mode 100755 diff --git a/src/mastodon/bin/yarn b/src/mastodon/bin/yarn new file mode 100755 index 0000000..7abec13 --- /dev/null +++ b/src/mastodon/bin/yarn @@ -0,0 +1,5 @@ +#!/bin/bash -e + +. "$SNAP/mastodon.env" + +cd "$MASTODON_DIR" && corepack yarn "$@" diff --git a/src/mastodon/mastodon.env b/src/mastodon/mastodon.env index eaf7543..69589d9 100644 --- a/src/mastodon/mastodon.env +++ b/src/mastodon/mastodon.env @@ -9,7 +9,6 @@ update_paths node update_paths libvips update_paths ffmpeg -export HOME="$MASTODON_DIR" export XDG_CONFIG_HOME="$HOME" export MASTODON_DBUSER=mastodon @@ -79,6 +78,12 @@ if mastodon_config_exists; then export ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY="$(mastodon_get_var ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY)" export ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT="$(mastodon_get_var ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT)" export ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY="$(mastodon_get_var ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY)" +else + export OTP_SECRET=precompile_placeholder + export SECRET_KEY_BASE=precompile_placeholder + export ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=precompile_placeholder + export ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=precompile_placeholder + export ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=precompile_placeholder fi mastodon_rake() {