Files
danbooru/app/views/status/show.html.erb
evazion e36fb6fee3 /status: show HTTP request headers and client IP.
Show the HTTP request headers and the client IP on the /status page.
This is for debugging request headers added by reverse proxies such as
Cloudflare and Nginx, and for making sure the client IP is correctly set
by the X-Forwarded-For header.
2021-05-06 00:32:24 -05:00

48 lines
1.2 KiB
Plaintext

<div id="c-status">
<div id="a-show" class="fixed-width-container">
<h1>Status</h1>
<% if @status.danbooru_version.present? && Danbooru.config.source_code_url.present? %>
<p>Running <%= external_link_to "#{Danbooru.config.source_code_url}/commits/#{@status.danbooru_version}", @status.danbooru_version.first(7) %>.</p>
<% end %>
<h2>Server</h2>
<details>
<summary>
Server: <%= @status.hostname %>
</summary>
<%= render "list", hash: @status.serializable_hash[:status] %>
</details>
<h2>Postgres</h2>
<details>
<summary>
<%= pluralize @status.postgres_active_connections, "active connection" %>.
</summary>
<%= render "table", rows: @status.serializable_hash[:postgres][:connection_stats] %>
</details>
<h2>Redis</h2>
<details>
<summary>
<%= @status.redis_used_memory %> memory used.
</summary>
<%= render "list", hash: @status.serializable_hash[:redis][:info] %>
</details>
<h2>Request</h2>
<details>
<summary>
IP: <%= @status.request.remote_ip %>
</summary>
<%= render "list", hash: @status.serializable_hash[:headers] %>
</details>
</div>
</div>