-
Notifications
You must be signed in to change notification settings - Fork 174
Environment Variable RELATIVE_URL_ROOT to Specify Web-Root-Path #99
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
Conversation
… a webroot path in the url
I'm personally -1 on adding this functionality to the base image. It's not something included in upstream's config file, so I think in this case we ought to instead simply defer to upstream's documentation on the subject: https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI |
FWIW, I'd personally find this useful, and it is an option, after all. As a Redmine admin that isn't a Rails dev, I've wasted a lot of time in the past trying to wrestle with conflicting "upstream" wiki pages to deploy to a sub-URI. Does this PR work for both the standard tags and the "passenger" series of tags? |
@tianon: My patch implements exactly what the referenced document writes. There is no way to get it into the docker container other than my patch — except if you really want to manually edit the container after each update, which is nonsense and absolutely not the concept of docker. The concept of docker is to get a working instance directly from the image plus configuration by command line or compose file, i.e. using the environment. I'd prefer to see my patch in upstream soon. I don't have the time to keep track with your changes here. But since this seems to last for a while, I'll setup the image build for mwaeckerlin/redmine, so you can use image mwaeckerlin/redmine until build here is ready. |
sorry, wrong button |
@JongleurNin, I tested the normal latest build. It should work for all, since it is the same change following the redmine developper's instructions. Passenger uses the same file that I modified. |
@JongleurNin, the first passenger build is ready. You can try from here: https://hub.docker.com/r/mwaeckerlin/redmine/tags/ |
Now my projects run on mwaeckerlin/redmine, version 3.4 without passenger. Please feel free to test the other versions, i.e. passenger. |
I've had success with the following simple FROM redmine
RUN { \
echo; \
echo 'unless ENV["REDMINE_RELATIVE_URL_ROOT"].to_s.empty?'; \
echo ' Redmine::Utils::relative_url_root = ENV["REDMINE_RELATIVE_URL_ROOT"]'; \
echo 'end'; \
} >> config/environment.rb Combine that with automated builds (https://docs.docker.com/docker-hub/builds/) and repository links (https://docs.docker.com/docker-hub/builds/#repository-links) and it's reasonably easy to have an up-to-date image built It'd be really great to get some perspective on this from someone who can represent upstream, but I'm not sure what the best way to go about that would be. 😞 |
@tianon, that's even a better solution than mine. But there is no reason for not implementing this |
hi, I got relative url working with this:
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
map ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
run RedmineApp::Application
end That is how gitlab does it for exemple : https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config.ru#L25 I tested this with webrick and puma. What is does:
|
Would please anyone be so kind and add this simple feature to the main branch? There are different ways to do it, any of them would be fine. |
… 2nd try, NameError: uninitialized constant Redmine
Hi, I have tested the @mwaeckerlin's and @jouve's method on the latest version of official Redmine image (4.0 passenger), but the passenger daemon still listened for the "/" even if the "config/environment.rb" and "config.ru" are all patched. Any tips for this? Thanks a lot. |
Closing since this branch is no longer a suggested change but a separate image. At this point we don't want to add more custom environment variables that aren't part of normal upstream recommended config. The current upstream recommended ways are documented here: https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI |
Added a new optional environment variable RELATIVE_URL_ROOT allows to specify a webroot path in the url. This fixes #14.