nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.92k stars 4.02k forks source link

[Bug]: background image is 404 in maintenance mode #45164

Open derbenx opened 5 months ago

derbenx commented 5 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

In maintenance mode background comes up as 404 when nextcloud is in a folder. It's been in pretty much every version, since I remember. :P think the updating mode does this too...

it tries to use: https://server.xxx/apps/theming/img/background/kamil-porembinski-clouds.jpg instead of: https://server.xxx/subdir/apps/theming/img/background/kamil-porembinski-clouds.jpg It's configured in weblink, under theming with the folder and anywhere else I can think of.

I tried light and dark theme, in case it was one or the other.

Steps to reproduce

  1. use nextcloud in a subdir
  2. upgrade
  3. (or just enable maintenance mode)

Expected behavior

no 404 errors.

Installation method

Community Manual installation with Archive

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

\apps\theming\css\default.css is hard coded to: --image-background-default: url('/apps/theming/img/background/kamil-porembinski-clouds.jpg');

This seems to fix it: --image-background-default: url('../../apps/theming/img/background/kamil-porembinski-clouds.jpg');

4ch1m commented 3 months ago

Hi there,

I have discovered the same issue. (And I think it is related to #40252.)

This line needs to be improved:

https://github.com/nextcloud/server/blob/55036a0bc4628bc9e3ce47e26c10fe3f9f6fef56/apps/theming/css/default.css#L98

It obviously doesn't take overwritewebroot into consideration; which is used when running Nextcloud behind a reverse proxy (see: "Reverse proxy").

Combined with a fail2ban-setup, this issue may have severe impact, because you will be locked out completely after the CSS tries to load the background. (Which happened in my case. :smile:)

derbenx commented 3 months ago

40252 is still open from 2023? Wow, such a simple bug to fix too.

Well, I did propose a fix in my post, granted it's untested in root installs, it does work in subdir installs. Maybe it''l be patched by 2025. ;)