2022-06-10 14:31:00 +02:00
|
|
|
{ lib
|
|
|
|
, writeText
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = final: prev: {
|
|
|
|
django = prev.django_4;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
py.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "healthchecks";
|
2023-07-18 00:40:09 +02:00
|
|
|
version = "2.10";
|
2022-06-10 14:31:00 +02:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "healthchecks";
|
|
|
|
repo = pname;
|
2023-01-26 18:34:24 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-18 00:40:09 +02:00
|
|
|
sha256 = "sha256-1x+pYMHaKgLFWcL1axOv/ok1ebs0I7Q+Q6htncmgJzU=";
|
2022-06-10 14:31:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
|
|
|
apprise
|
|
|
|
cron-descriptor
|
|
|
|
cronsim
|
|
|
|
django
|
2022-08-06 00:21:16 +02:00
|
|
|
django-compressor
|
2022-06-10 14:31:00 +02:00
|
|
|
fido2
|
|
|
|
minio
|
|
|
|
psycopg2
|
2022-10-26 20:43:59 +02:00
|
|
|
pycurl
|
2022-06-10 14:31:00 +02:00
|
|
|
pyotp
|
|
|
|
segno
|
|
|
|
statsd
|
|
|
|
whitenoise
|
|
|
|
];
|
|
|
|
|
nixos/healthchecks: enable _FILE variants for all secrets
This change enables _FILE variants for all secrets in Healthchecks
configuration so they can be read from a file and not stored in
/nix/store.
In particular, it adds support for these secrets:
DB_PASSWORD, DISCORD_CLIENT_SECRET, EMAIL_HOST_PASSWORD,
LINENOTIFY_CLIENT_SECRET, MATRIX_ACCESS_TOKEN, PD_APP_ID,
PUSHBULLET_CLIENT_SECRET, PUSHOVER_API_TOKEN, S3_SECRET_KEY, SECRET_KEY,
SLACK_CLIENT_SECRET, TELEGRAM_TOKEN, TRELLO_APP_KEY, and TWILIO_AUTH.
2023-08-25 22:46:07 +02:00
|
|
|
secrets = [
|
|
|
|
"DB_PASSWORD"
|
|
|
|
"DISCORD_CLIENT_SECRET"
|
|
|
|
"EMAIL_HOST_PASSWORD"
|
|
|
|
"LINENOTIFY_CLIENT_SECRET"
|
|
|
|
"MATRIX_ACCESS_TOKEN"
|
|
|
|
"PD_APP_ID"
|
|
|
|
"PUSHBULLET_CLIENT_SECRET"
|
|
|
|
"PUSHOVER_API_TOKEN"
|
|
|
|
"S3_SECRET_KEY"
|
|
|
|
"SECRET_KEY"
|
|
|
|
"SLACK_CLIENT_SECRET"
|
|
|
|
"TELEGRAM_TOKEN"
|
|
|
|
"TRELLO_APP_KEY"
|
|
|
|
"TWILIO_AUTH"
|
|
|
|
];
|
|
|
|
|
2022-06-10 14:31:00 +02:00
|
|
|
localSettings = writeText "local_settings.py" ''
|
|
|
|
import os
|
2023-08-25 09:59:06 +02:00
|
|
|
|
2022-06-10 14:31:00 +02:00
|
|
|
STATIC_ROOT = os.getenv("STATIC_ROOT")
|
2023-08-25 09:59:06 +02:00
|
|
|
|
nixos/healthchecks: enable _FILE variants for all secrets
This change enables _FILE variants for all secrets in Healthchecks
configuration so they can be read from a file and not stored in
/nix/store.
In particular, it adds support for these secrets:
DB_PASSWORD, DISCORD_CLIENT_SECRET, EMAIL_HOST_PASSWORD,
LINENOTIFY_CLIENT_SECRET, MATRIX_ACCESS_TOKEN, PD_APP_ID,
PUSHBULLET_CLIENT_SECRET, PUSHOVER_API_TOKEN, S3_SECRET_KEY, SECRET_KEY,
SLACK_CLIENT_SECRET, TELEGRAM_TOKEN, TRELLO_APP_KEY, and TWILIO_AUTH.
2023-08-25 22:46:07 +02:00
|
|
|
${lib.concatLines (map
|
|
|
|
(secret: ''
|
|
|
|
${secret}_FILE = os.getenv("${secret}_FILE")
|
|
|
|
if ${secret}_FILE:
|
|
|
|
with open(${secret}_FILE, "r") as file:
|
|
|
|
${secret} = file.readline()
|
|
|
|
'')
|
|
|
|
secrets)}
|
2022-06-10 14:31:00 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt/healthchecks
|
|
|
|
cp -r . $out/opt/healthchecks
|
|
|
|
chmod +x $out/opt/healthchecks/manage.py
|
|
|
|
cp ${localSettings} $out/opt/healthchecks/hc/local_settings.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
# PYTHONPATH of all dependencies used by the package
|
|
|
|
pythonPath = py.pkgs.makePythonPath propagatedBuildInputs;
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) healthchecks;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/healthchecks/healthchecks";
|
|
|
|
description = "A cron monitoring tool written in Python & Django ";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ phaer ];
|
|
|
|
};
|
|
|
|
}
|