-
Notifications
You must be signed in to change notification settings - Fork 52
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
CMD_URL_PATH not working #31
Comments
This is a quite layered issue: First of all, yes, it seems like something got lost when refactoring towards webpack 4. The subdomain in general. This feature should come back, please open an issue for that in https://github.com/codimd/server. For the container itself. there remains the problem, that at build time we already set the prefix to /. Which means you need to build the container yourself in order to have a |
@SISheogorath do you really need a prefix to render the files with? Normally, the problem inside the CSS or whatnot files is trivial to solve: relative paths in CSS files etc. are always relative to the file on the server, not to the current URL. So, just calculate the relative paths during build time. That's what most frameworks do, too, e.g., Bootstrap. Web frameworks like Flask allow for either using relative paths, or for calculating them on demand. If you really have to, you can temporarily render media files via the server. I haven't tried the CDN option by the way. CDNs are evil, and not using them should be standard (i.e., opt-in instead of opt-out).
I am not quite sure what you refer to. I am talking about subdirs, not subdomains. Did you mix up the two terms somehow? I'm open to opening issues somewhere else, but only if I know what to write there. Might be easier if you just open an issue somewhere, I'll insert the information there then in a comment. I just want to highlight that I will only be able to help on the Docker side of things, and in logical/conceptual things. I have a strong aversion towards JavaScript (especially backend stuff), and don't have enough rubber gloves here to even look into what's going on... Edit: I would also suggest to rename this repo into |
I see to have the same issue, using this docker-compose.yml with traefik:
the first thing which does not work, is that it tries to get https://test.example.com/config instead of https://test.example.com/codimd/config - so probably everything else fails afterwards, like trying to directly resolve the fonts folder - or in the "features" tab, it cannot connect to the socket- trying to access https://test.example.com/socket.io/?noteId.... instead of https://test.example.com/codimd/socket.io/?noteId..... The config file contains the seetings, so it seems to be a bootstraping problem? |
REMOVED COMMENT: I commented on the wrong project, sorry! |
@nmaas87 As you might notice, you don't use our version of CodiMD, but the one maintained by the HackMD team. We can't help you with that. If you want us to support you, please use our container image or ask the HackMD team for support. |
@SISheogorath Sorry, my bad. I just realizied. I was thrown of-course as both HackMD and you have a CodiMD project - however they are backed by other teams and have different versions and development status. Sorry for that :(! |
Yeah, that was never intended to be like that. We aim to solve that confusion with our version 2.0. |
I've set
CMD_URL_PATH
topad/
(also triedpad
) in mydocker-compose.yml
, since I want to proxy from a different subdir.This works partly; the screenshot for instance is loaded from https://my.domain.tld/pad//screenshot.png, but all other media is loaded from the root, e.g., https://my.domain.tld/build/cover-styles-pack.css.
I'm using NGINX, see the following config excerpt:
It's a pretty standard websocket-enabled proxy config.
I'm not sure if it's an issue of the infra in this repo (often, env vars are translated into config files by startup scripts), or needs to go into https://github.com/codimd/server.
The text was updated successfully, but these errors were encountered: