Giter VIP home page Giter VIP logo

container-healthchecks's Introduction

Hello there 👋

I'm Alexander Trost aka galexrt. I am a maintainer of the Rook project.

container-healthchecks's People

Contributors

braintelligence avatar darrachequesne avatar denis-ev avatar galexrt avatar jhnlsn avatar kclosu avatar louissegal avatar renovate[bot] avatar swoga avatar whysthatso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

container-healthchecks's Issues

'CSRF verification failed' when trying to login

Hi, I have tried to test your docker image on two systems now, but each time I try to log in I get the following error in my browser

Forbidden (403)
CSRF verification failed. Request aborted.

Do you have any idea what the problem is?

Fully Qualified Hostname has to be set for E-Mails

When trying to send mails I got this:

27.12.2017 17:26:55Exception in thread Thread-39:
27.12.2017 17:26:55Traceback (most recent call last):
27.12.2017 17:26:55  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
27.12.2017 17:26:55    self.run()
27.12.2017 17:26:55  File "/healthchecks/hc/lib/emails.py", line 22, in run
27.12.2017 17:26:55    msg.send()
27.12.2017 17:26:55  File "/healthchecks/hc-venv/lib/python3.4/site-packages/django/core/mail/message.py", line 348, in send
27.12.2017 17:26:55    return self.get_connection(fail_silently).send_messages([self])
27.12.2017 17:26:55  File "/healthchecks/hc-venv/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 111, in send_messages
27.12.2017 17:26:55    sent = self._send(message)
27.12.2017 17:26:55  File "/healthchecks/hc-venv/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 127, in _send
27.12.2017 17:26:55    self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))
27.12.2017 17:26:55  File "/usr/lib/python3.4/smtplib.py", line 793, in sendmail
27.12.2017 17:26:55    raise SMTPRecipientsRefused(senderrs)
27.12.2017 17:26:55smtplib.SMTPRecipientsRefused: {'[email protected]': (504, b'5.5.2 <5c632f939fd4>: Helo command rejected: need fully-qualified hostname')}

After setting the FQDN in the container this didn't happen anymore, I get a HTTP 200 instead. But I still don't get mails it seems. Will look into this.

Hint: How to circumvent problems with ":" (Telegram Token)

Setting TELEGRAM_TOKEN causes problems as it contains a ":" symbol and is not escaped properly by the entrypoint script.

Workaround:

To properly add a TELEGRAM_TOKEN that contains a : symbol, you can set it in your docker-compose.yml via

- HC_TELEGRAM_TOKEN: '""1234567:ABCDEFH__IJKLMNOPQRSTUVWXYZ""'

This way it gets rewritten into the generated settings.py as

TELEGRAM_TOKEN = """1234567:ABCDEFH__IJKLMNOPQRSTUVWXYZ"""

Start sendalerts with supervisord

The current docs recommend managing the sendalerts command with supervisord. I'm not super familiar with it, but might attempt the change and submit a PR.

PagerDuty Vendor Key issue

the PD vendor key starts with a number, which causes the entrypoint script to write it as an invalid python variable. I'm not super familiar with bash switch statement evaluations but I'm going to take a stab at fixing it.

Keep getting "Referer checking failed does not match any trusted origins."

I keep getting this error when trying to login with an email. I don't know if something went wrong in my configurations.

docker-compose service

  healthchecks:
    container_name: healthchecks
    image: galexrt/healthchecks:latest
    restart: always
    ports:
      - 10009:8000
    environment:
      - HC_HOST=192.168.1.20
      - HC_SECRET_KEY=[censored]
      - HC_SITE_ROOT=https://healthchecks.[censored]
      - HC_DEBUG=True
      - HC_ALLOWED_HOSTS=["healthcheck.[censored]","localhost"]
      - HC_CORS_ORIGIN_ALLOW_ALL=True
      - HC_CSRF_TRUSTED_ORIGINS=["healthcheck.[censored]"]

Not sure if HC_CORS_ORIGIN_ALLOW_ALL and HC_CSRF_TRUSTED_ORIGINS are configurable.

nginx-reversed proxy

I'm using linuxserver's letsencrypt container with the following config:

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

server {
    include /config/nginx/ssl.conf;

    server_name  healthchecks.[censored];
    root        /config/www;
    index  index.html index.htm index.php;

    client_max_body_size 0;

    location / {
        proxy_pass http://localhost:10009;
    }
}

I'm able to access other function just fine. Except login function. Please take a look if there are something wrong or missing in my configs. Thanks.

Internal Server Error with v1.15.0-20200620-143251-752

Hi,

I'm having an internal server error when I try to access the website after upgrading to v1.15.0-20200620-143251-752.

Rolling back to v1.15.0-20200618-123207-243 solves the problem.

There is no error in the default output (DEBUG is enabled), and I couldn't find any in the container logs (maybe I didn't find the right log file) :

Compressing... done
Compressed 20 block(s) from 102 template(s) for 0 context(s).
You have requested to collect static files at the destination
location as specified in your settings:
/healthchecks/static-collected
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel:
309 static files copied to '/healthchecks/static-collected'.
Correcting config file permissions ...
Migrating database ...
Operations to perform:
Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions
Running migrations:
No migrations to apply.
2020-06-20 22:26:20,642 INFO supervisord started with pid 1
2020-06-20 22:26:21,647 INFO spawned: 'nginx' with pid 16
2020-06-20 22:26:21,651 INFO spawned: 'smtpd' with pid 17
2020-06-20 22:26:21,656 INFO spawned: 'gunicorn' with pid 18
2020-06-20 22:26:21,667 INFO spawned: 'sendalerts' with pid 19
2020-06-20 22:26:23,506 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-20 22:26:23,506 INFO success: smtpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-20 22:26:23,506 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-20 22:26:23,507 INFO success: sendalerts entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Issue with Fonts/Static Items

This may be related to bf85f25 but I am not positive. I'm getting 404 errors on font files:

Screen Shot 2020-02-25 at 4 03 28 PM

I see this from the Nginx logs:

2020/02/25 16:01:53 [error] 18#18: *3 open() "/healthchecks/static-collected//fonts/icomoon.woff" failed (2: No such file or directory), client: 172.18.0.1, server: _, request: "GET /static/fonts/icomoon.woff?jvwv9j HTTP/1.1", host: "hc.linuxbox.ninja", referrer: "https://hc.linuxbox.ninja/projects/xxxxxxxx-xxxx-479d-xxxx-xxxxxxxx/checks/"
172.18.0.1 - - [25/Feb/2020:16:01:53 -0600] "GET /static/fonts/icomoon.woff?jvwv9j HTTP/1.1" 404 169 "https://hc.linuxbox.ninja/projects/xxxxxxxx-xxxx-479d-xxxx-xxxxxxxx/checks/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15"
2020/02/25 16:01:54 [error] 18#18: *3 open() "/healthchecks/static-collected//fonts/icomoon.svg" failed (2: No such file or directory), client: 172.18.0.1, server: _, request: "GET /static/fonts/icomoon.svg?jvwv9j HTTP/1.1", host: "hc.linuxbox.ninja", referrer: "https://hc.linuxbox.ninja/projects/xxxxxxxx-xxxx-479d-xxxx-xxxxxxxx/checks/"

and in the other log I see:

Compressing... Invalid template /healthchecks/templates/integrations/add_pd.html: 'staticfiles' is not a registered tag library. Must be one of:,
admin_list,�
admin_modify,
admin_urls,
cache,
compress,�,
s,
humanize,
i18n,
l10n,
log,
static,
tz,
done,
Compressed 18 block(s) from 96 template(s) for 0 context(s).,
,
You have requested to collect static files at the destination,
location as specified in your settings:,
,
    /healthchecks/static-collected,
,
This will overwrite existing files!,
Are you sure you want to do this?,
,
Traceback (most recent call last):,
  File "/healthchecks/manage.py", line 10, in <module>,
    execute_from_command_line(sys.argv),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line,
    utility.execute(),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute,
    self.fetch_command(subcommand).run_from_argv(self.argv),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv,
    self.execute(*args, **cmd_options),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute,
    output = self.handle(*args, **options),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle,
    collected = self.collect(),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 104, in collect,
    for path, storage in finder.list(self.ignore_patterns):,
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/finders.py", line 130, in list,
    for path in utils.get_files(storage, ignore_patterns):,
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/utils.py", line 39, in get_files,
    yield from get_files(storage, ignore_patterns, dir),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/utils.py", line 39, in get_files,
    yield from get_files(storage, ignore_patterns, dir),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/utils.py", line 39, in get_files,
    yield from get_files(storage, ignore_patterns, dir),
  [Previous line repeated 37 more times],
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/contrib/staticfiles/utils.py", line 23, in get_files,
    directories, files = storage.listdir(location),
  File "/home/healthchecks/.local/lib/python3.7/site-packages/django/core/files/storage.py", line 317, in listdir,
    if entry.is_dir():,
OSError: [Errno 40] Too many levels of symbolic links: '/healthchecks/static/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE/CACHE',
Type 'yes' to continue, or 'no' to cancel: Correcting config file permissions ...,
Migrating database ...,
System check identified some issues:,
,�,
:,
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default',
	HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/3.0/ref/databases/#mysql-sql-mode,
Operations to perform:,
  Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions,
Running migrations:,
  No migrations to apply.,
  Your models have changes that are not yet reflected in a migration, and so won't be applied.,
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.,
2020-02-25 16:01:07,705 INFO supervisord started with pid 1,
2020-02-25 16:01:08,707 INFO spawned: 'nginx' with pid 15,
2020-02-25 16:01:08,710 INFO spawned: 'gunicorn' with pid 16,
2020-02-25 16:01:08,712 INFO spawned: 'sendalerts' with pid 17,
2020-02-25 16:01:09,944 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2020-02-25 16:01:09,944 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2020-02-25 16:01:09,944 INFO success: sendalerts entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),

Any ideas?

Also I've noticed I believe this breaks the logo image in email. The HTML from the email is:

<img alt="Logo" src="https://hc.linuxbox.ninja/static/img/[email protected]" width="200" height="50" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #ffffff; font-size: 16px;" border="0">

Postgres database not being selected

Hi,

According to docs, DB_TYPE should be set to postgres. However, in the source hc/settings.py it looks like DB should be set as postgres - hence HC_DB rather than HC_DB_TYPE. The intresting part tho, non of them works and output of hc/local_settings.py will show a connection to SqlLite3.

Envs

HC_DB: "postgres"
HC_DB_TYPE: "postgres"
HC_DB_HOST: "postgres.example.com"
HC_DB_PORT: "5432"
HC_DB_NAME: "default"
HC_DB_USER: "postgres"
HC_DB_PASSWORD: "postgres"

/healthchecks/hc/local_settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/data/hc.sqlite',
    }
}
EMAIL_HOST_PASSWORD = "SG.0FVIewlzQ72XU..."
DB_NAME = "default"
SITE_ROOT = "https://hc.example.com"
DEBUG = False
DB = "postgres"
DB_HOST = "postgres.example.com"
SITE_NAME = "HC"
HOST = "0.0.0.0"
SECRET_KEY = "Aab..."
DISCORD_CLIENT_SECRET = "Xhyt_i33Rd8..."
ALLOWED_HOSTS = ["hc.example.com", "healthchecks.example.com"]
PING_ENDPOINT = "https://hc.example.com/ping/"
MASTER_BADGE_LABEL = "HealthChecks"
EMAIL_HOST_USER = "apikey"
REGISTRATION_OPEN = True
DB_TYPE = "postgres"
DB_USER = "postgres"
USE_PAYMENTS = False
DB_PORT = 5432
DB_PASSWORD = "postgres"
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = "[email protected]"
PING_EMAIL_DOMAIN = "hc.example.com"
EMAIL_HOST = "smtp.example.com"
EMAIL_PORT = 587
DISCORD_CLIENT_ID = 1234567

Any thoughts?
Thanks!

The latest build fails…

The latest build is failing to start. It used to work a week ago?

Added "PING_ENDPOINT" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "ALLOWED_HOSTS" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "EMAIL_HOST" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "SECRET_KEY" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "REGISTRATION_OPEN" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "MASTER_BADGE_LABEL" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "EMAIL_PORT" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "SITE_NAME" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "USE_PAYMENTS" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "SITE_ROOT" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "EMAIL_HOST_PASSWORD" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "EMAIL_HOST_USER" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "DEBUG" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "HOST" (type "string") to local_settings.py
16.12.2019 15:14:31 Added "EMAIL_USE_TLS" (type "plain") to local_settings.py
16.12.2019 15:14:31 Added "DEFAULT_FROM_EMAIL" (type "string") to local_settings.py
16.12.2019 15:14:31 Traceback (most recent call last):
16.12.2019 15:14:31 File "/healthchecks/manage.py", line 10, in <module>
16.12.2019 15:14:31 execute_from_command_line(sys.argv)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
16.12.2019 15:14:31 utility.execute()
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 325, in execute
16.12.2019 15:14:31 settings.INSTALLED_APPS
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 79, in __getattr__
16.12.2019 15:14:31 self._setup(name)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 66, in _setup
16.12.2019 15:14:31 self._wrapped = Settings(settings_module)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 157, in __init__
16.12.2019 15:14:31 mod = importlib.import_module(self.SETTINGS_MODULE)
16.12.2019 15:14:31 File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
16.12.2019 15:14:31 return _bootstrap._gcd_import(name[level:], package, level)
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 986, in _gcd_import
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 969, in _find_and_load
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
16.12.2019 15:14:31 File "<frozen importlib._bootstrap_external>", line 673, in exec_module
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
16.12.2019 15:14:31 File "/healthchecks/hc/settings.py", line 38, in <module>
16.12.2019 15:14:31 for line in open(os.path.join(BASE_DIR, "CHANGELOG.md")).readlines():
16.12.2019 15:14:31 File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
16.12.2019 15:14:31 return codecs.ascii_decode(input, self.errors)[0]
16.12.2019 15:14:31 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1813: ordinal not in range(128)
16.12.2019 15:14:31 Correcting config file permissions ...
16.12.2019 15:14:31 Migrating database ...
16.12.2019 15:14:31 Traceback (most recent call last):
16.12.2019 15:14:31 File "/healthchecks/manage.py", line 10, in <module>
16.12.2019 15:14:31 execute_from_command_line(sys.argv)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
16.12.2019 15:14:31 utility.execute()
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 325, in execute
16.12.2019 15:14:31 settings.INSTALLED_APPS
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 79, in __getattr__
16.12.2019 15:14:31 self._setup(name)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 66, in _setup
16.12.2019 15:14:31 self._wrapped = Settings(settings_module)
16.12.2019 15:14:31 File "/home/healthchecks/.local/lib/python3.5/site-packages/django/conf/__init__.py", line 157, in __init__
16.12.2019 15:14:31 mod = importlib.import_module(self.SETTINGS_MODULE)
16.12.2019 15:14:31 File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
16.12.2019 15:14:31 return _bootstrap._gcd_import(name[level:], package, level)
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 986, in _gcd_import
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 969, in _find_and_load
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
16.12.2019 15:14:31 File "<frozen importlib._bootstrap_external>", line 673, in exec_module
16.12.2019 15:14:31 File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
16.12.2019 15:14:31 File "/healthchecks/hc/settings.py", line 38, in <module>
16.12.2019 15:14:31 for line in open(os.path.join(BASE_DIR, "CHANGELOG.md")).readlines():
16.12.2019 15:14:31 File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
16.12.2019 15:14:31 return codecs.ascii_decode(input, self.errors)[0]
16.12.2019 15:14:31 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1813: ordinal not in range(128)
16.12.2019 15:14:32 2019-12-16 14:14:32,168 INFO supervisord started with pid 1
16.12.2019 15:14:33 2019-12-16 14:14:33,172 INFO spawned: 'nginx' with pid 17
16.12.2019 15:14:33 2019-12-16 14:14:33,175 INFO spawned: 'gunicorn' with pid 18
16.12.2019 15:14:33 2019-12-16 14:14:33,177 INFO spawned: 'sendalerts' with pid 19
16.12.2019 15:14:33 2019-12-16 14:14:33,288 INFO exited: sendalerts (exit status 1; not expected)
16.12.2019 15:14:33 2019-12-16 14:14:33,668 INFO exited: gunicorn (exit status 3; not expected)
16.12.2019 15:14:34 2019-12-16 14:14:34,668 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
16.12.2019 15:14:34 2019-12-16 14:14:34,670 INFO spawned: 'gunicorn' with pid 25
16.12.2019 15:14:34 2019-12-16 14:14:34,673 INFO spawned: 'sendalerts' with pid 26
16.12.2019 15:14:34 2019-12-16 14:14:34,766 INFO exited: sendalerts (exit status 1; not expected)
16.12.2019 15:14:35 2019-12-16 14:14:35,150 INFO exited: gunicorn (exit status 3; not expected)
16.12.2019 15:14:37 2019-12-16 14:14:37,154 INFO spawned: 'gunicorn' with pid 31
16.12.2019 15:14:37 2019-12-16 14:14:37,157 INFO spawned: 'sendalerts' with pid 32
16.12.2019 15:14:37 2019-12-16 14:14:37,262 INFO exited: sendalerts (exit status 1; not expected)
16.12.2019 15:14:37 2019-12-16 14:14:37,591 INFO exited: gunicorn (exit status 3; not expected)
16.12.2019 15:14:40 2019-12-16 14:14:40,365 INFO spawned: 'sendalerts' with pid 37
16.12.2019 15:14:40 2019-12-16 14:14:40,475 INFO exited: sendalerts (exit status 1; not expected)
16.12.2019 15:14:41 2019-12-16 14:14:41,478 INFO spawned: 'gunicorn' with pid 38
16.12.2019 15:14:41 2019-12-16 14:14:41,479 INFO gave up: sendalerts entered FATAL state, too many start retries too quickly
16.12.2019 15:14:41 2019-12-16 14:14:41,975 INFO exited: gunicorn (exit status 3; not expected)
16.12.2019 15:14:42 2019-12-16 14:14:42,977 INFO gave up: gunicorn entered FATAL state, too many start retries too quickly

Change runserver to Gunicorn

Hi, I'm trying to run this within Rancher by using https://github.com/adi90x/rancher-active-proxy

I get these errors:

27.12.2017 13:59:30nginx.1     | 2017/12/27 12:59:30 [error] 2680#2680: *1726 connect() failed (111: Connection refused) while connecting to upstream, client: client.ip.add.ress, server: my.domain.com, request: "GET / HTTP/2.0", upstream: "http://10.42.29.44:80/", host: "my.domain.com"

27.12.2017 13:59:30nginx.1     | 2017/12/27 12:59:30 [error] 2680#2680: *1726 no live upstreams while connecting to upstream, client: client.ip.add.ress, server: my.domain.com, request: "GET / HTTP/2.0", upstream: "http://my.domain.com/", host: "my.domain.com"

Maybe using "0.0.0.0:8000" for runserver is the culprit?

I connect a random local host port to the container port 8000, then rancher-active-proxy works with that. Works flawlessly for many containers up till now.

/entrypoint.sh: line 79: [: too many arguments

Getting the following errors when deploying :latest to ECS on Amazon:

Added "DEFAULT_FROM_EMAIL" (type "string") to local_settings.py
Added "REGISTRATION_OPEN" (type "plain") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "EMAIL_PORT" (type "plain") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "SITE_ROOT" (type "string") to local_settings.py
Added "EMAIL_HOST_PASSWORD" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
/entrypoint.sh: line 79: [: too many arguments
Added "EMAIL_HOST_USER" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "DEBUG" (type "plain") to local_settings.py
Added "HOST" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "PING_ENDPOINT" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "ALLOWED_HOSTS" (type "plain") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "EMAIL_HOST" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
Added "EMAIL_USE_SSL" (type "plain") to local_settings.py
Added "SECRET_KEY" (type "string") to local_settings.py
/entrypoint.sh: line 79: [: too many arguments
/entrypoint.sh: line 79: [: too many arguments

Environment variables:

DB_HOST	healthchecks.....rds.amazonaws.com
DB_NAME	healthchecks
DB_PASSWORD	...
DB_PORT	3306
DB_TYPE	mysql
DB_USER	healthchecks
HC_ALLOWED_HOSTS	['*']
HC_DEFAULT_FROM_EMAIL	[email protected]
HC_EMAIL_HOST	email-smtp.eu-west-1.amazonaws.com
HC_EMAIL_HOST_PASSWORD	A....P
HC_EMAIL_HOST_USER	A....Q
HC_EMAIL_PORT	465
HC_EMAIL_USE_SSL	True
HC_REGISTRATION_OPEN	False
HC_SITE_ROOT	https://healthchecks.....com

I can't see anything obviously wrong with the entrypoint.sh script. Any ideas?

No need for virtualenv

Since we only run one Python app in the container we don't need to use virtualenv.
Just use pip install on the globally installed Python3.

Receiving Emails

Hi,

how can I start the smtp daemon described here inside the docker container?

I tried the following:
docker exec -it containerid python3 /healthchecks/manage.py smtpd --port 2525
This worked, but my command prompt was stuck and Ctrl-C terminates the smtp daemon.

Then I tried it in docker-compose.yml:
command: python3 /healthchecks/manage.py smtpd --port 2525
Then Healthchecks did not start anymore. Which is (maybe) because I am using a new startup command now (I am not a Docker expert).

Maybe you have a hint for me,
thank you,
Martin

SECRET_KEY should be randomly set

You shouldn't set the SECRET_KEY to ---.
Instead you should generate a random secret key, that you can't derive from reading the Dockerfile or related scripts.
Having DEBUG = True active is risky enough, but then having a well-known SECRET_KEY is just too much.

Cannot reach container

Hi Galexrt,
Just tried to setup the healthchecks container via docker-compose whereas somehow I cannot reach the container, neither by IP:8080 nor by subdomain.domain.com or subdomain.domain.com:8080. Postgres DB connection seems to be ok as I can see connections and the container also seems to start up and not shut down.
Wondering if you could check my docker-compose in case I miss anything?

version: '3'
services:
healthchecks:
image: galexrt/healthchecks:latest
container_name: healthchecks
restart: unless-stopped
ports:
- "8080:80"
volumes:
- /home/folder/healthchecks/data:/data
environment:
DEBUG: "False"
SECERET_KEY: "password123"
USE_PAYMENTS: "False"
REGISTRATION_OPEN: "False"
SITE_ROOT: "https://subdomain.domain.net"
SITE_NAME: "My Healthchecks"
MASTER_BADGE_LABEL: "Mychecks"
PING_ENDPOINT: "https://subdomain.domain.net/ping/"
PING_EMAIL_DOMAIN: "subdomain.domain.net"
DEFAULT_FROM_EMAIL: "[email protected]"
DB: "postgres"
DB_HOST: "IP"
DB_PORT: "PORT"
DB_NAME: "DB"
DB_USER: "USER"
DB_PASSWORD: "PW"
EMAIL_HOST: "smtp.gmail.com"
EMAIL_PORT: "587"
EMAIL_HOST_USER: "[email protected]"
EMAIL_HOST_PASSWORD: "APP PW"
EMAIL_USE_TLS: "True"
ALLOWED_HOSTS: 'localhost, subdomain.domain.net' (also tried it with "*" and with removing the env variable all together)
SUPERUSER_EMAIL: "[email protected]"
SUPERUSER_PASSWORD: "PW"
TELEGRAM_BOT_NAME: "BOTNAME"
TELEGRAM_TOKEN: "BOT KEY"
CONTAINER_PRUNE_INTERVAL: 600

I run various other docker containers with HAProxy etc., but somehow cannot get this one connected.
Thanks!

No E-Mail Notifications will be send on up or down of check but testing the email integration works

Hi,

I am running healthchecks as a daemon using a docker-compose.yml file which looks as follows:

version: '3'
services:
  healthchecks:
    image: galexrt/healthchecks:latest
    container_name: healthchecks
    restart: always
    ports:
      - "8000:8000"
    volumes:
      - SQLite:/data
    environment:
      # DB_NAME must be set like this for the /data volume to be used
      # otherwise the SQLite db is lost on container deletion.
      DB_NAME: "/data/hc.sqlite"
      SECRET_KEY: 'secret'
      ALLOWED_HOSTS: 'localhost,hc.example.com'
      DEBUG: "False"
      DEFAULT_FROM_EMAIL: "[email protected]"
      USE_PAYMENTS: "False"
      REGISTRATION_OPEN: "False"
      EMAIL_HOST: "mailout.example.com"
      EMAIL_PORT: "587"
      EMAIL_HOST_USER: "user"
      EMAIL_HOST_PASSWORD: "password"
      EMAIL_USE_TLS: "True"
      SITE_ROOT: "https://hc.example.com"
      SITE_NAME: "HCM"
      MASTER_BADGE_LABEL: "HCM"
      PING_ENDPOINT: "https://hc.example.com/ping/"
      TWILIO_ACCOUNT: "None"
      TWILIO_AUTH: "None"
      TWILIO_FROM: "None"
      PD_VENDOR_KEY: "None"
      TRELLO_APP_KEY: "None"
      CONTAINER_PRUNE_INTERVAL: 600
volumes:
  SQLite:

E-Mail notifications worked properly but after a few days suddenly no more notification emails (up or down of a check) were sent by healthchecks any more. Docker logs show a traceback which seams to show up on every notification attempt:

2020-10-05 00:47:18,811 INFO success: sendalerts entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/supervisor/loggers.py", line 84, in emit
    self.flush()
  File "/usr/lib/python2.7/dist-packages/supervisor/loggers.py", line 64, in flush
    self.stream.flush()
IOError: [Errno 28] No space left on device

I checked the running processes and /usr/bin/python3 manage.py sendreports --loop was still running.

Interesting is, that if I test the email integration with the test button manually, the mail will be delivered successfully.

After restarting the docker container everything seems to be working again properly.

Does anyone know what causes the IOError?

SITE_ROOT not working with static files?

I am serving the app with NGINX at https://$static_ip/healthchecks, the web page loads but not static files.

With SITE_ROOT set as https://$static_ip/healthchecks, I suppose the static file url would be
/healthchecks/static/css/bootstrap.css but instead it's just /static/css/bootstrap.css.

What changes should I make?

Thanks in advance.

# healthchecks.conf
server {
    listen          80;
    server_name     $server_static_ip;
    return          301 https://$server_name$request_uri;
}

server {
    listen          443 ssl;
    ssl_certificate /path/to/my.crt;
    ssl_certificate_key /path/to/my.key;

    location /healthchecks {
        proxy_pass       http://localhost:6001/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-Real-IP $remote_addr;
    }
}

# docker-compose.yml
version: '3'
services:
    healthchecks:
        image: galexrt/healthchecks:latest
        restart: always
        ports:
            - '6001:8000'
        volumes:
            - ./static:/healthchecks/static
        environment:
            # general
            SITE_ROOT: 'https://$server_static_ip/healthchecks'
            SITE_NAME: 'HEALTHCHECKS'
            ALLOWED_HOSTS: 'server_static_ip, localhost'
            SECRET_KEY: 'my_secret'
            DEBUG: 'False'
            # DB
            DB: 'mysql'
            DB_HOST: 'database_host'
            DB_PORT: 3306
            DB_NAME: 'healthchecks'
            DB_USER: 'username'
            DB_PASSWORD: 'password'
            # EMAIL
            DEFAULT_FROM_EMAIL: '[email protected]'
            EMAIL_HOST: 'smtp.gmail.com'
            EMAIL_PORT: 587
            EMAIL_HOST_USER: '[email protected]'
            EMAIL_HOST_PASSWORD: 'password'
            EMAIL_USE_TLS: 'True'
        networks:
            - app-network

networks:
    app-network:
        driver: bridge

v1.13.0-0 does not contain the change from changelog

Show sub-second durations with higher precision, 2 digits after decimal point (#321)
Screenshot 2020-03-19 at 17 05 41

Replace the gear icon with three horizontal dots icon (#322)
Add a Pause button in the checks list (#312)
Screenshot 2020-03-19 at 17 04 30

Screenshot 2020-03-19 at 17 04 51

Do you have any clue on why it's not as the changelog say ?
My docker compose

  healthchecks:
    container_name: healthchecks
    labels:
      - "com.ouroboros.enable=true" 
    networks:
      - galaxy_cs-tier    
    image: galexrt/healthchecks:v1.13.0-0
    restart: always

Image issues - Please Support

Hi All,

I'm having issues with a self hosted version of the software.

Details of the version I'm having issues with and the log I have showing what I hope is the reason...

ID | sha256:75eff274f174951708cb86a4c5e4fbe75e0c454a4a968b6b44b5506171f039ce
Size | 631.1 MB
Created | 2020-09-02 19:32:02
Build | Docker 19.03.8 on linux, amd64

I'm not getting this issue with the previous build, dated 11th April 2020.

/healthchecks/hc/settings.py:226: UserWarning: local_settings.py not found, using defaults

  warnings.warn("local_settings.py not found, using defaults")

Compressing... done

Compressed 20 block(s) from 104 template(s) for 0 context(s).

/healthchecks/hc/settings.py:226: UserWarning: local_settings.py not found, using defaults

  warnings.warn("local_settings.py not found, using defaults")



You have requested to collect static files at the destination

location as specified in your settings:



    /healthchecks/static-collected



This will overwrite existing files!

Are you sure you want to do this?



Type 'yes' to continue, or 'no' to cancel: 

0 static files copied to '/healthchecks/static-collected', 314 unmodified.

Correcting config file permissions ...

Migrating database ...

/healthchecks/hc/settings.py:226: UserWarning: local_settings.py not found, using defaults

  warnings.warn("local_settings.py not found, using defaults")

Operations to perform:

  Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions

Running migrations:

  No migrations to apply.

Error: Format string '/scripts/prunepings.sh %(ENV_CONTAINER_PRUNE_INTERVAL)s' for 'program:prunepings.command' contains names ('ENV_CONTAINER_PRUNE_INTERVAL') which cannot be expanded. Available names: ENV_DATA_DIR, ENV_DEBIAN_FRONTEND, ENV_DEBUG, ENV_HC_EMAIL_HOST, ENV_HC_EMAIL_HOST_PASSWORD, ENV_HC_EMAIL_HOST_USER, ENV_HC_EMAIL_PORT, ENV_HC_EMAIL_USE_TLS, ENV_HC_REGISTRATION_OPEN, ENV_HC_SITE_NAME, ENV_HC_SITE_ROOT, ENV_HEALTHCHECKS_GROUP, ENV_HEALTHCHECKS_USER, ENV_HEALTHCHECKS_VERSION, ENV_HOME, ENV_HOSTNAME, ENV_OLDPWD, ENV_PATH, ENV_PWD, ENV_SECRET_KEY, ENV_SHLVL, ENV_TERM, ENV_TZ, group_name, here, host_node_name, process_num, program_name in section 'program:prunepings' (file: '/etc/supervisor/supervisord.conf')

For help, use /usr/bin/supervisord -h

The image just circles around the same loop.

Any help appreciated.

Thanks in advance.

Rusty.

Kubernetes Example

Hello,

thanks for this great image!
In case anyone needs this, here is a deployment, ingress, service example for Kubernetes using this image:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: healthchecks
spec:
  tls:
    - hosts:
        - health.yourdomain.com
  rules:
    - host: health.yourdomain.com
      http:
        paths:
          - path: /
            backend:
              serviceName: healthchecks
              servicePort: 8000
---
apiVersion: v1
kind: Service
metadata:
  name: healthchecks
  labels:
    app: healthchecks
spec:
  selector:
    app: healthchecks
  type: ClusterIP
  ports:
    - name: http
      port: 8000
      protocol: TCP
      targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: healthchecks
  labels:
    app: healthchecks
spec:
  replicas: 1
  selector:
    matchLabels:
      app: healthchecks
  template:
    metadata:
      labels:
        app: healthchecks
    spec:
      containers:
        - name: healthchecks
          image: galexrt/healthchecks
          env:
            - name: HC_HOST
              value: health.yourdomain.com
            - name: HC_SECRET_KEY
              value: f74567gvyfgcs43v45
            - name: HC_PING_EMAIL_DOMAIN
              value: health.yourdomain.com
            - name: HC_SITE_ROOT
              value: health.yourdomain.com
            - name: HC_EMAIL_HOST
              value: smtp.yourdomain.com
            - name: HC_EMAIL_PORT
              value: "25"
            - name: HC_EMAIL_USE_TLS
              value: "true"
            - name: HC_EMAIL_HOST_USER
              value: "[email protected]"
            - name: HC_EMAIL_HOST_PASSWORD
              value: asd321423wwdc
            - name: HC_ALLOWED_HOSTS
              value: '["*"]'
          ports:
            - name: http
              containerPort: 8000
          volumeMounts:
            - name: data
              mountPath: /healthchecks
      volumes:
        - name: data
          hostPath:
            path: /data/healthchecks

Using settelegramwebhook Doesn't Appear to Work

I may have had this working previously, but I can't remember. Nonetheless I setup a new Telegram bot, and setup the TELEGRAM_BOT_NAME and TELEGRAM_TOKEN environment variables. Then I used the manage.py command as noted in the docs, but get the following:

$ docker exec -it healthchecks /entrypoint.sh app:managepy settelegramwebhook

Running manage.py ...
/healthchecks/hc/settings.py:226: UserWarning: local_settings.py not found, using defaults
  warnings.warn("local_settings.py not found, using defaults")
Fail: status=404, b'{"ok":false,"error_code":404,"description":"Not Found"}'

I'm not positive what it's 404'ing on. I do know that local_settings.py does not exist though, at least not in /healthchecks/hc/:

healthchecks@healthchecks:/healthchecks/hc $ ls -la
total 80
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 .
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 ..
-rw-r--r-- 1 healthchecks healthchecks    0 Jun 23 15:52 __init__.py
drwxr-xr-x 2 healthchecks healthchecks 4096 Jul  7 09:27 __pycache__
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 accounts
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 api
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 front
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 lib
-rw-r--r-- 1 healthchecks healthchecks  921 Jun 23 15:52 local_settings.py.example
drwxr-xr-x 1 healthchecks healthchecks 4096 Jul  7 09:27 payments
-rwxr-xr-x 1 healthchecks healthchecks 7197 Jun 23 15:52 settings.py
-rw-r--r-- 1 healthchecks healthchecks 1841 Jun 23 15:52 test.py
-rw-r--r-- 1 healthchecks healthchecks  732 Jun 23 15:52 urls.py
-rw-r--r-- 1 healthchecks healthchecks  381 Jun 23 15:52 wsgi.py

Here's the image information:

$ docker images |grep health
galexrt/healthchecks                                latest              0594ed8dd6b2        13 days ago         629MB

Any ideas?

It doesn't work

I'm trying to get the project running in the minimal environment

Screen Shot 2020-10-20 at 16 05 53

Not sure what I'm doing wrong, the server is unreachable – any idea? 😰

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
  • quay.io/galexrt/healthchecks v2.10
  • mariadb 11.3
dockerfile
Dockerfile
  • debian bullseye
github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • docker/login-action v3.1.0
  • docker/login-action v3.1.0
.github/workflows/test-build.yml
  • actions/checkout v4
  • docker/login-action v3.1.0
  • docker/login-action v3.1.0
.github/workflows/weekly-release.yml
  • actions/checkout v4
  • docker/login-action v3.1.0
  • docker/login-action v3.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

Container healthcheck not working

The container exits every few seconds / minutes. The log shows the following:

2022-03-05 02:02:10,796 INFO stopped: pruneflips (terminated by SIGTERM)
2022/03/05 02:02:10 [notice] 17#17: signal 15 (SIGTERM) received from 1, exiting
2022/03/05 02:02:10 [notice] 24#24: exiting
2022/03/05 02:02:10 [notice] 24#24: exit
2022/03/05 02:02:10 [notice] 17#17: signal 17 (SIGCHLD) received from 24
2022/03/05 02:02:10 [notice] 17#17: worker process 24 exited with code 0
2022/03/05 02:02:10 [notice] 17#17: exit
2022-03-05 02:02:10,806 INFO stopped: nginx (exit status 0)
[2022-03-05 02:02:10 +0000] [16] [INFO] Handling signal: term
[2022-03-05 02:02:10 +0000] [28] [INFO] Worker exiting (pid: 28)
[2022-03-05 02:02:11 +0000] [16] [INFO] Shutting down: Master
2022-03-05 02:02:11,155 INFO stopped: gunicorn (exit status 0)
exited with code 0

I am using the tag v1.25.0

Custom Logo

Hi,

how can I set a my custom Logo in the upper left corner of the application?

image

Is there a good way to do this without changing the Dockerfile?

[Question] How to change logo placeholder

Hello,

Thanks for this image, it's very useful 🙂

I didn't see a way for changing the default logo placeholder; I searched inside healthchecks repository without success.

Any idea how to do that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.