Browse Source

Add SITE_LOGO_URL setting

Fixes: #323
pull/545/head
Pēteris Caune 3 years ago
parent
commit
2382bf6722
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
10 changed files with 33 additions and 10 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +5
    -1
      hc/front/context_processors.py
  3. +1
    -0
      hc/settings.py
  4. BIN
      static/img/logo-512-green.png
  5. BIN
      static/img/logo-full.png
  6. BIN
      static/img/[email protected]
  7. BIN
      static/img/[email protected]
  8. +5
    -9
      templates/base.html
  9. +8
    -0
      templates/docs/self_hosted_configuration.html
  10. +13
    -0
      templates/docs/self_hosted_configuration.md

+ 1
- 0
CHANGELOG.md View File

@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
### Improvements ### Improvements
- Use multicolor channel icons for better appearance in the dark mode - Use multicolor channel icons for better appearance in the dark mode
- Add SITE_LOGO_URL setting (#323)
### Bug Fixes ### Bug Fixes
- Fix dark mode styling issues in Cron Syntax Cheatsheet - Fix dark mode styling issues in Cron Syntax Cheatsheet


+ 5
- 1
hc/front/context_processors.py View File

@ -2,4 +2,8 @@ from django.conf import settings
def branding(request): def branding(request):
return {"site_name": settings.SITE_NAME, "site_root": settings.SITE_ROOT}
return {
"site_name": settings.SITE_NAME,
"site_root": settings.SITE_ROOT,
"site_logo_url": settings.SITE_LOGO_URL,
}

+ 1
- 0
hc/settings.py View File

@ -155,6 +155,7 @@ LOCALE_PATHS = (os.path.join(BASE_DIR, "locale"),)
SITE_ROOT = os.getenv("SITE_ROOT", "http://localhost:8000") SITE_ROOT = os.getenv("SITE_ROOT", "http://localhost:8000")
SITE_NAME = os.getenv("SITE_NAME", "Mychecks") SITE_NAME = os.getenv("SITE_NAME", "Mychecks")
SITE_LOGO_URL = os.getenv("SITE_LOGO_URL")
MASTER_BADGE_LABEL = os.getenv("MASTER_BADGE_LABEL", SITE_NAME) MASTER_BADGE_LABEL = os.getenv("MASTER_BADGE_LABEL", SITE_NAME)
PING_ENDPOINT = os.getenv("PING_ENDPOINT", SITE_ROOT + "/ping/") PING_ENDPOINT = os.getenv("PING_ENDPOINT", SITE_ROOT + "/ping/")
PING_EMAIL_DOMAIN = os.getenv("PING_EMAIL_DOMAIN", "localhost") PING_EMAIL_DOMAIN = os.getenv("PING_EMAIL_DOMAIN", "localhost")


BIN
static/img/logo-512-green.png View File

Before After
Width: 512  |  Height: 512  |  Size: 6.8 KiB

BIN
static/img/logo-full.png View File

Before After
Width: 200  |  Height: 50  |  Size: 4.3 KiB

BIN
static/img/[email protected] View File

Before After
Width: 400  |  Height: 100  |  Size: 8.2 KiB

BIN
static/img/[email protected] View File

Before After
Width: 118  |  Height: 100  |  Size: 3.8 KiB

+ 5
- 9
templates/base.html View File

@ -82,19 +82,15 @@
{% if request.user.is_authenticated and project %} {% if request.user.is_authenticated and project %}
{{ project }} {{ project }}
<span class="caret"></span> <span class="caret"></span>
{% elif request.user.is_authenticated%}
<img
id="logo"
height="50"
src="{% static 'img/logo.png'%}"
srcset="{% static 'img/logo.png'%} 1x, {% static 'img/[email protected]'%} 2x"
alt="{{ site_name }}">
{% else %} {% else %}
<img <img
id="logo" id="logo"
height="50" height="50"
src="{% static 'img/logo-full.png'%}"
srcset="{% static 'img/logo-full.png'%} 1x, {% static 'img/[email protected]'%} 2x"
{% if site_logo_url %}
src="{{ site_logo_url }}"
{% else %}
src="{% static 'img/logo.png' %}"
{% endif %}
alt="{{ site_name }}"> alt="{{ site_name }}">
{% endif %} {% endif %}
</a> </a>


+ 8
- 0
templates/docs/self_hosted_configuration.html View File

@ -287,6 +287,14 @@ notifications. Healthcecks interacts with signal-cli over DBus.</p>
example given in the signal-cli instructions.</li> example given in the signal-cli instructions.</li>
<li>Set the <code>SIGNAL_CLI_ENABLED</code> environment variable to <code>True</code>.</li> <li>Set the <code>SIGNAL_CLI_ENABLED</code> environment variable to <code>True</code>.</li>
</ul> </ul>
<h2 id="SITE_LOGO_URL"><code>SITE_LOGO_URL</code></h2>
<p>Default: <code>None</code></p>
<p>An URL pointing to the image you want to use as the site logo. If not set,
Healthchecks will use a fallback image (<code>/static/img/logo.png</code>).</p>
<p>Example:</p>
<div class="highlight"><pre><span></span><code><span class="na">SITE_LOGO_URL</span><span class="o">=</span><span class="s">https://example.org/my-custom-logo.svg</span>
</code></pre></div>
<h2 id="SITE_NAME"><code>SITE_NAME</code></h2> <h2 id="SITE_NAME"><code>SITE_NAME</code></h2>
<p>Default: <code>Mychecks</code></p> <p>Default: <code>Mychecks</code></p>
<p>The display name of this Healthchecks instance. Healthchecks uses it throughout <p>The display name of this Healthchecks instance. Healthchecks uses it throughout


+ 13
- 0
templates/docs/self_hosted_configuration.md View File

@ -456,6 +456,19 @@ To enable the Signal integration:
example given in the signal-cli instructions. example given in the signal-cli instructions.
* Set the `SIGNAL_CLI_ENABLED` environment variable to `True`. * Set the `SIGNAL_CLI_ENABLED` environment variable to `True`.
## `SITE_LOGO_URL` {: #SITE_LOGO_URL }
Default: `None`
An URL pointing to the image you want to use as the site logo. If not set,
Healthchecks will use a fallback image (`/static/img/logo.png`).
Example:
```ini
SITE_LOGO_URL=https://example.org/my-custom-logo.svg
```
## `SITE_NAME` {: #SITE_NAME } ## `SITE_NAME` {: #SITE_NAME }
Default: `Mychecks` Default: `Mychecks`


Loading…
Cancel
Save