Project

General

Profile

How to have the same Redmine with several host_name ?

Added by Ludovic Gasc about 15 years ago

Hi,

In my company, we have several branches with different names.
Everybody use the same Redmine, but for the clients, it isn't really clear, we want to have multiples url: projects.AAAAA.com and projects.BBBBB.com for example.

With the Virtualhost in Apache, no problems to do this, but in the e-mail notification, Redmine uses host_name value in db to generate URL.

Do you have an idea to resolve this ?
I see in app/models/mailer.rb file at line 192 the declaration: h = Setting.host_name, but how to detect the current virtualhost ?

Thanks you very much for your response.


Replies (3)

RE: How to have the same Redmine with several host_name ? - Added by Billy Ma about 15 years ago

This is a quick solution, but can't guarantee security issue.

There is a way using javascript to grab the web address from the client's browser into your code.
Submit that information with the login or post.

Afterward you can use URL library from RoR API to determine the exact hostname where the client comes from.

Hope this helps.

RE: How to have the same Redmine with several host_name ? - Added by Ludovic Gasc about 15 years ago

Thanks for your comment, but I prefer a server side solution.

I find request.host value, but it doesn't work inside the model, only the view or controller.

Finally I find a solution: Clone Redmine files, configure X virtualhosts, symbolic link on the files folder, to have the same documents on each instance, and rewrite view/mailer.rb to change the declarations of e-mail adress and hostname.

If somebody has a cleaner solution, you're welcome ;-)

RE: How to have the same Redmine with several host_name ? - Added by Harry Yamamoto about 15 years ago

You can add a customize filed for project named such as "mailing_list_name@b_project.net".
then modify the mailer.rb to set the mail sender head as the customize filed you set above.

    (1-3/3)