-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 on resources when custom path #3618
Comments
👋 Thank you for opening your first issue. I'm just an automated bot that's here to help you get the information you need quicker, so please ignore this message if it doesn't apply to your issue. |
I just find public/build/rev-manifest.json but it's not absolute path. The goal is to find where is generated "/build" & to force the root path before.. |
Hello, Thank you for coming from Slack to here. I'll try to illustrate the issue, and check in the code what we have to do. Firstly, to illustrate your problem (if I correctly understand it), here is a screenshot of the setup page. On my fresh install the URL is |
Cachet may be installed at the root of its vhost or in a subdirectory, for example in "/" or under "/status". The URI we found pointing to some assets were usually not prefixed with the APP_URL value, so if Cachet was installed under "/status" the asset URI pointed to the server root like "/my-asset.js". It is a problem because that means the behaviour is broken in this case. The problem was present from the setup, it was not possible to fill the setup since the path to the scripts and CSS weres wrong. The content of the APP_URL environment variable is now read and used in the assets URI. See: cachethq#3618
Thank you @anthonybocci , This is exactly the issue that I have. For now I use mod_substitue to rewrite body on the fly but it's pretty dirty:
Best regards, |
@anthosz thank you for sharing your workaround. I've understood the problem, I just need to fix one thing and it will be ok. The error your said before updating your message about a |
@anthonybocci I confirm that the error (count) has been fixed in 2.4 (dev). Please note btw that we have the same issue on 2.4 concerning resources call. Workaround for 2.4:
But the path of fonts/, metrics/ and dashboard are ok once logged but not ok when not logged (anonymous). Best regards, |
Cachet may be installed at the root of its vhost or in a subdirectory, for example in "/" or under "/status". The URI we found pointing to some assets were usually not prefixed with the path, so if Cachet was installed under "/status" the asset URI pointed to the server root like "/my-asset.js". It is a problem because that means the behaviour is broken in this case. The problem was present from the setup, it was not possible to fill the setup since the path to the scripts and CSS weres wrong. The "asset" helper is now used and resolves the URI. See: cachethq#3618
The `asset()` helper was missing at some places so it was not possible to install it in an other place than the server's root (/). The paths have been fixed and now use the `asset()` helper. Also, The steps process takes care of the current path. See: cachethq#3618
The `asset()` helper was missing at some places so it was not possible to install it in an other place than the server's root (/). The paths have been fixed and now use the `asset()` helper. Also, The steps process takes care of the current path. See: cachethq#3618
Cachet may be installed at the root of its vhost or in a subdirectory, for example in "/" or under "/status". The URI we found pointing to some assets were usually not prefixed with the path, so if Cachet was installed under "/status" the asset URI pointed to the server root like "/my-asset.js". It is a problem because that means the behaviour is broken in this case. The problem was present from the setup, it was not possible to fill the setup since the path to the scripts and CSS weres wrong. The "asset" helper is now used and resolves the URI. See: cachethq#3618
This should now be fixed! |
Dear @jbrooksuk , There is only one problem left concerning ionicons.svg & ionicions.woff called by /dist/css/app.css (dashboard anonymous & logged) The link to woff/svg in the CSS is url("../../../fonts/ionicons.ttf?v=2.0.1" instead url("/a/b/c/fonts/ionicons.ttf?v=2.0.1" For the rest, all seems fixed now :) Thx! |
I believe @anthonybocci has fixed fonts now? |
@jbrooksuk I didn't touch the fonts. I'll check during the week-end to remember the problem, reproduce it and see if I can fix it. I'll let you know. |
I just tested now with 2.3 and 2.4 since I didn't know about what version you were talking about, but I have no 404 in my browser. I guess you are talking about 2.4, so @anthosz could you lead me to reproduce the 404? I checked in my browser's console. |
@anthonybocci it's 2.4 (revision c74193e Sat Jul 13 17:31:27 2019 +0100). So to summarize, you just need to go on the root page (like example.org/subdirectory/sub2/cachet) (anonymous & logged) and the url is not ok for .ttf/.woff : In our case, instead to call these resources on example.org/subdirectory/sub2/cachet/fonts/., these resources are called on example.org/subdirectory/sub2/fonts/. (missing /cachet) .env: |
@anthosz @nalysius @jbrooksuk The setup page is exactly like in the example of this issue. What do I have to do to work? |
This project is not maintained anymore |
I know, but should the issue been fixed in the latest version? |
The last version is old of more/less 4 years so.. during this time, laravel/php/composer has been updated so no make sense to use it... You need to switch to another solution (not found a correct one on our side so switched to commercial solution) |
You are right. Thank you for answering me! |
The easiest would be to use a subdomain status.mydomain.com, so no problems with this. The other day I was thinking about creating a status page, way simpler than Cachet, just a Symfony API, a front-end, no JavaScript. An API compatible with Cachet, so the modules would still work. Something easy to maintain and with as few dependencies as possible. I have to think about it, if it's a good idea or not. |
Hello,
Following issue #2977 and a request to slack. I cannot install cachet with a custom path.
Example: http://127.0.0.1/cachet
APP URL is the same in all case.
If I add RewriteBase, only page seems to works but 127.0.0.1/cachet/setup/ cannot load ressources (like js/css...etc). Indeed, the browser try to get resources from 127.0.0.1/build/... instead 127.0.0.1/cachet/build/...
If I don't add RewriteBase, I have 404 for all pages but ressources links are ok..
Versions:
Apache 2.4
Php 7.2
Cachet 2.3.18
Best regards,
The text was updated successfully, but these errors were encountered: