Commit 859589a2 authored by Mikko Ahlroth's avatar Mikko Ahlroth

Add absolute URL to config to support proxied installs

parent 59866835
......@@ -27,6 +27,10 @@ config :code_stats,
# User configurable settings below
##################################
# If the site is proxied, the URL helpers may end up with the wrong URL.
# This value is used as absolute URL instead. No trailing slash!
absolute_url: "https://domain.example",
site_name: "Code::Stats",
# Address to send email from in the form of {"Name", "address@domain.example"}
......
......@@ -5,7 +5,7 @@
</p>
<p>
<a href="<%= auth_url(CodeStats.Endpoint, :render_reset, @token) %>"><%= auth_url(CodeStats.Endpoint, :render_reset, @token) %></a>
<a href="<%= get_conf(:absolute_url) <> auth_path(CodeStats.Endpoint, :render_reset, @token) %>"><%= get_conf(:absolute_url) <> auth_path(CodeStats.Endpoint, :render_reset, @token) %></a>
</p>
<p>
......
A password reset was requested for an account registered with this email address. To reset your password, please open the following link:
<%= auth_url(CodeStats.Endpoint, :render_reset, @token) %>
<%= get_conf(:absolute_url) <> auth_path(CodeStats.Endpoint, :render_reset, @token) %>
This link is valid for <%= CodeStats.PasswordReset.token_max_life() %> hours.
......
......@@ -21,7 +21,7 @@
<hr />
<p>
This email was sent from <a href="<%= page_url(CodeStats.Endpoint, :index) %>"><%= get_conf(:site_name) %></a>. If you do not wish to receive more emails, you can remove your email address in the preferences page of your account.
This email was sent from <a href="<%= get_conf(:absolute_url) <> page_path(CodeStats.Endpoint, :index) %>"><%= get_conf(:site_name) %></a>. If you do not wish to receive more emails, you can remove your email address in the preferences page of your account.
</p>
<p>
......
......@@ -4,6 +4,6 @@
<%= render @view_module, @view_template, assigns %>
-----------
This email was sent from <%= get_conf(:site_name) %> <<%= page_url(CodeStats.Endpoint, :index) %>>. If you do not wish to receive more emails, you can remove your email address in the preferences page of your account.
This email was sent from <%= get_conf(:site_name) %> <<%= get_conf(:absolute_url) <> page_path(CodeStats.Endpoint, :index) %>>. If you do not wish to receive more emails, you can remove your email address in the preferences page of your account.
Please note that you cannot reply to this email.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment