cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
13.79k stars 1.55k forks source link

Fixed paths for reverse proxies with different subfolder #4335

Closed KiralyCraft closed 10 months ago

KiralyCraft commented 1 year ago

When having Cachet running behind a reverse proxy with a different subpath, I noticed the icons were broken.

For example, the server running the app is hosted at:

It is hosted by apache, and it has an Alias entry for "status" pointing to the public folder. Therefore, it is also accessible by:

The paths referenced in the CSS go back three levels, which for the dashboard is fine, since the structure is:

├── dist
│   ├── css
│   │   ├── app.8e642081c214028ed55259aac8d62dee.css
│   │   ├── app.css
│   │   ├── app.feac6a0c1283b11117bc898e9697488a.css
│   │   └── dashboard
│   │       ├── dashboard.23178384bd205669aa1bf4d387ba070d.css
│   │       ├── dashboard.css
│   │       └── dashboard.d62a8b6468ab8c9bca396ab8f6cde506.css

so that they are relative to the root. However, the app.css ones also go back three levels, which is one level behind the root, or when running with an alias like I am, it is precisely the root.

This patch should fix this behavior. Please note that I'm not sure what the purpose of the app.[HASH].css is, since I'm not a web developer

welcome[bot] commented 1 year ago

Congratulations on opening your first Pull Request, this is a momentous day for you and us! :sparkles: To help us out, please make sure that you've followed the below: