Dear Soren,

Ok, so the primary issue has actually nothing to do with the multi tenancy support but is rather an issue with FHS, which is handled in the same patch. Redmine switched to use propshaft for asset management that collects (and compiles) static assets from application paths, hashes them and stores them in the public folder (/usr/share/redmine/public as
currently done). This, of course, is unacceptable and needs to be changed.

The current post-install script runs static item collection as user www-data who is not allowed to write to /usr/share/redmine/public. The current post-install avoids running into this by touching a .manifest.json.
This does not work for two reasons:
First, this files timestamp is used to check if asset collection is required. Touching .manifest.json circumvents asset collection all together. Second, when the server runs that file gets parsed as JSON and an empty string ('') is not valid json, leading to the observed 500.

To fix that, we propose to extend the FHS section in the multi tenancy patch by setting the public_path much in the same way as the other paths get set (see the attached patch).

We are currently working on updating use_system_jquery_libs.patch to work with the new way assets are handled, but package setup, configuration and everything that doesn't use jquery works just fine with this patch.

All the best,
Valentin

On 19/03/2025 18.04, Soren Stoutner wrote:
On Wednesday, March 19, 2025 4:17:27 AM Mountain Standard Time Adi
Kriegisch wrote:
On Tuesday, 18 March 2025 01:54:35 CET Soren Stoutner wrote:
On Monday, March 17, 2025 3:57:53 AM Mountain Standard Time Adi
Kriegisch
wrote:
[...]

Finding someone who can update and maintain the following patch is
the only way we can keep this feature.

https://salsa.debian.org/ruby-team/redmine/-/blob/master/debian/pa
tches/0004 -Add-multi-tenancy-support.patch?ref_type=heads

You can read back through this thread for a little information
about my experimentation trying to update it before deciding it
was beyond my ability.

If nobody steps forward in the next couple of days I will resume
the fairly significant task of trying to excise all of the
multi-tenancy changes in a way that allows for a safe upgrade of
the default instance.
Thank you very much for the grace period. We used the time to
inspect the patch to find out how things work and are happy to say:
the fix is easier than originally anticipated; we are currently
running some tests, polishing the patch a little and are about to
write some notes on what went wrong and how it is supposed to
work...

That is good to hear!

From 5a97520b87ec75a33b04955f1efcb0de517ac557 Mon Sep 17 00:00:00 2001
From: Valentin <valen...@vrvis.at>
Date: Thu, 20 Mar 2025 14:15:10 +0100
Subject: [PATCH] update multi-tenancy for redmine 6

Redmine 6 starts using propshaft which collects assets and writes writes them to
the public path for serving.
Modify the rails public path to point to the existing per-instance directories.
---
 debian/patches/0004-Add-multi-tenancy-support.patch | 5 ++++-
 debian/redmine.dirs                                 | 2 --
 debian/redmine.postinst                             | 3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)
 delete mode 100644 debian/redmine.dirs

diff --git a/debian/patches/0004-Add-multi-tenancy-support.patch b/debian/patches/0004-Add-multi-tenancy-support.patch
index ea93b506..dc3098fb 100644
--- a/debian/patches/0004-Add-multi-tenancy-support.patch
+++ b/debian/patches/0004-Add-multi-tenancy-support.patch
@@ -365,7 +365,7 @@ Last-Update: 2025-03-10
 +DOCUMENTATION
 --- /dev/null
 +++ b/config/multitenancy_environment.rb
-@@ -0,0 +1,42 @@
+@@ -0,0 +1,45 @@
 +# Copyright (C) 2014-2015 Antonio Terceiro
 +# Copyright (C) 2011-2014 Jérémy Lal
 +# Copyright (C) 2011-2014 Ondřej Surý
@@ -398,6 +398,9 @@ Last-Update: 2025-03-10
 +  # per-instance database configuration
 +  config.paths['config/database'] = Redmine.root.join('config', 'database.yml').to_s
 +
++  # per-instance public directory
++  config.paths['public'] = Redmine.root.join('public')
++
 +  # per-instance session cookie
 +  path = ENV.fetch('RAILS_RELATIVE_URL_ROOT', '/')
 +  key = Redmine.name || '_redmine_session'
diff --git a/debian/redmine.dirs b/debian/redmine.dirs
deleted file mode 100644
index 1f2fef68..00000000
--- a/debian/redmine.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-# This directory needs to exist or an error is produced at config time.
-/usr/share/redmine/public/assets
diff --git a/debian/redmine.postinst b/debian/redmine.postinst
index 63a09236..b4b1c5a3 100755
--- a/debian/redmine.postinst
+++ b/debian/redmine.postinst
@@ -48,9 +48,6 @@ chown www-data:www-data /var/lib/redmine/Gemfile.lock
 
 mkdir -p /var/log/redmine
 
-# Create .manifest.json, which needs to exist during rake.
-touch /usr/share/redmine/public/assets/.manifest.json
-
 #######################################################################
 # manage instances
 #######################################################################
-- 
2.39.5

Reply via email to