Closed Dup4 closed 2 years ago
See webapp/config/static.yaml
(or the .in
version on git), that is where we place the base URL. Besides that we also put it in the docs, but there is no easy way to fix that. But we could use sed
to replace that if BASEURL
is set. Indeed the nginx config should also be updated. You are welcome to send in a PR.
OK, I will do it later.
See
webapp/config/static.yaml
(or the.in
version on git), that is where we place the base URL. Besides that we also put it in the docs, but there is no easy way to fix that. But we could usesed
to replace that ifBASEURL
is set. Indeed the nginx config should also be updated. You are welcome to send in a PR.
ok, I got it.
See
webapp/config/static.yaml
(or the.in
version on git), that is where we place the base URL. Besides that we also put it in the docs, but there is no easy way to fix that. But we could usesed
to replace that ifBASEURL
is set. Indeed the nginx config should also be updated. You are welcome to send in a PR.ok, I got it.
Note this requires a webapp/bin/console cache:clear
after doing so. Not sure if we already do this.
I tend to use docker to run domserver.
I found that in the official docker image, the default BaseURL is
/
.And this is configured during compilation.
But because the university only provided us with a domain name, and there is no subdomain available.
But at the same time we have many other services.
So we can only forward domjudge through path forwarding, like
http://localhost/domjudge
.But we can't simply configure path forwarding in Nginx of the gateway server.
Because web pages require static resources to beloaded, their request paths also need to be prefixed accordingly.
Just like the picture above, it needs to be prefixed with
/domjudge
or other you like.I note that BaseURL will be specified when the domserver image is compiled.
https://github.com/DOMjudge/domjudge-packaging/blob/49e2c5af0a6779f460f024a150824dd23e27eab4/docker/domserver/build.sh#L7
It may be used to get the path prfix of
asset()
, maybe it will be used in other places.https://github.com/DOMjudge/domjudge/blob/222c4ae5af23f03b316c25dcea99e8cf51792d9c/webapp/templates/base.html.twig#L7-L20
And also need to change the forwarding path in Nginx.
https://github.com/DOMjudge/domjudge-packaging/blob/49e2c5af0a6779f460f024a150824dd23e27eab4/docker/domserver/configure.sh#L68-L77
If want to specify BaseURL through environment variables when the container is started.
It should be easier to replace the Nginx configuration.
So for the modification of BaseURL in webapp, is there a more lightweight method?
And you agree to add an environment variable to be able to specify BaseURL when the container starts?