Project

General

Profile

Redmine 6 additional installed themes don't work

Added by Roland Giesler about 22 hours ago

I have a new Redmine 6 installation:

$ RAILS_ENV=production bin/about

Environment:
  Redmine version                6.0.5.stable
  Ruby version                   3.2.3-p157 (2024-01-18) [x86_64-linux-gnu]
  Rails version                  7.2.2.1
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Alternate
SCM:
  Git                            2.43.0
  Filesystem                     
Redmine plugins:
  custom_users_as_assignees      0.0.4
  customfield_checkbox_utility   0.0.4
  easy_mindmup                   3.0
  easy_wbs                       3.0
  redmine_checklists             3.1.26

As can be seen, I have the "alternate" style selected and it work.

However, I tried creating a custom theme, but it's css doesn't load. Then I installed the A1 theme and tried to select that, but it also fails.

I assume I have something missing in my config, but what?

It looks like this (just the top part is snipped here):

I had added this to my Apache config file (using Passenger), but commenting out or leaving it there makes no difference to this problem.

    Alias /public/assets/themes /themes
    <Location /themes>
        Allow from all
        Options -MultiViews
        Require all granted
    </Location>

Replies (2)

RE: Redmine 6 additional installed themes don't work - Added by Holger Just about 19 hours ago

(For reference: you have posted additional detail in an issue at #42978)

Redmine 6 uses Propshaft (a dynamic assets pipeline) which compiles all styles, javascript files, plugin assets, and themes and puts the compiled files into the public/assets directory. See the announcement of Redmine 6.0.0 at: Redmine 6.0.0 is now available

Please make sure to put your custom theme into the themes directory of your Redmine installation rather than public/themes where it was in previous versions. Very likely, you won.t need the Alias and custom Location in your Apache config.

If a theme uses imports in its css of Javascript files, the theme likely needs to be adapted for Propshaft as here, the final URLs (resp. the generated asset files) always contain a short hash of its contents. You thus need to use dynamic imports with fully qualified URLs. You can check the sources of the default themes which you can find in app/assets/themes for examples.

Unfortunately, it likely that some of the wiki pages on redmine.org regarding themes are outdated and/or misleading. Specifically the HowTo_create_a_custom_Redmine_theme page appears to be outdated as it does not use the required syntax for dynamic includes yet and the Themes page appears to propose a possibly invalid configuration which appears to target "hybrid" URL paths with outdated assets. Updating these guides is still not finished yet (see #40221).

For a "works out of the box" config in your Apache, you I think just need to serve the contents of the public directory without any custom configuration and forward requests to any non-existing files to your Redmine app server (such as Passenger, Puma, ...) For the default Propshaft pipeline to work, the user which runs your Redmine service must have write access to the public directory. Make sure to restart your app server process after any changes to config, code, or assets.

RE: Redmine 6 additional installed themes don't work - Added by Roland Giesler about 18 hours ago

Holger Just wrote in RE: Redmine 6 additional installed themes don't work:

(For reference: you have posted additional detail in an issue at #42978)

Yes, indeed, I asked for that issue to be deleted.

Redmine 6 uses Propshaft (a dynamic assets pipeline) which compiles all styles, javascript files, plugin assets, and themes and puts the compiled files into the public/assets directory. See the announcement of Redmine 6.0.0 at: Redmine 6.0.0 is now available

Yes, noted.

Please make sure to put your custom theme into the themes directory of your Redmine installation rather than public/themes where it was in previous versions. Very likely, you won.t need the Alias and custom Location in your Apache config.

I did indeed put it there. In similar fashion RedmineUp's A1 theme was installed there as well. It shows up in the dropdown select box, which indicated the code in the correct location.

If a theme uses imports in its css of Javascript files, the theme likely needs to be adapted for Propshaft as here, the final URLs (resp. the generated asset files) always contain a short hash of its contents. You thus need to use dynamic imports with fully qualified URLs. You can check the sources of the default themes which you can find in app/assets/themes for examples.

I'll take this up with RedmineUp as well, since the A1 theme is specifically the Redmine 6 version.

Unfortunately, it likely that some of the wiki pages on redmine.org regarding themes are outdated and/or misleading. Specifically the HowTo_create_a_custom_Redmine_theme page appears to be outdated as it does not use the required syntax for dynamic includes yet and the Themes page appears to propose a possibly invalid configuration which appears to target "hybrid" URL paths with outdated assets. Updating these guides is still not finished yet (see #40221).

Note, thanks for the update/

For a "works out of the box" config in your Apache, you I think just need to serve the contents of the public directory without any custom configuration and forward requests to any non-existing files to your Redmine app server (such as Passenger, Puma, ...) For the default Propshaft pipeline to work, the user which runs your Redmine service must have write access to the public directory. Make sure to restart your app server process after any changes to config, code, or assets.

This is how I currently have it.

<VirtualHost *:443>

    ServerName xxx.yy.zz
    ServerAdmin xxx@xxx.yy.zz
    DocumentRoot /var/www/redmine/public
    ErrorLog /var/log/redmine/error.log
    CustomLog /var/log/redmine/access.log combined
    LogLevel warn

Either the A1 theme is faulty, and so also my own custom theme, or there's something else still wrong.

    (1-2/2)