update to 3.0.1

This commit is contained in:
Jeffrey C. Ollie 2023-11-26 09:00:03 -06:00
parent 0e07f409c1
commit c03c2e9885
Signed by: jeff
GPG key ID: 6F86035A6D97044E
2 changed files with 286 additions and 290 deletions

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1697851979, "lastModified": 1700851152,
"narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", "narHash": "sha256-3PWITNJZyA3jz5IGREJRfSykM6xSLmD8u5A3WpBCyDM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8", "rev": "1216a5ba22a93a4a3a3bfdb4bff0f4727c576fcc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -7,8 +7,10 @@
}; };
}; };
outputs = { self, nixpkgs }@inputs: outputs = {
let self,
nixpkgs,
} @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -16,8 +18,7 @@
py = pkgs.python3.override { py = pkgs.python3.override {
packageOverrides = final: prev: { packageOverrides = final: prev: {
django = prev.django_4; django = prev.django_4;
cronsim = cronsim = let
let
version = "2.5"; version = "2.5";
pname = "cronsim"; pname = "cronsim";
src = pkgs.fetchPypi { src = pkgs.fetchPypi {
@ -44,7 +45,7 @@
config = { config = {
User = "5000:5000"; User = "5000:5000";
Volumes = { Volumes = {
"/tmp" = { }; "/tmp" = {};
}; };
WorkingDir = "${self.packages.${system}.healthchecks}/app"; WorkingDir = "${self.packages.${system}.healthchecks}/app";
Env = [ Env = [
@ -56,14 +57,12 @@
]; ];
}; };
}; };
in in {
{
packages.${system} = { packages.${system} = {
healthchecks = healthchecks = let
let
pname = "healthchecks"; pname = "healthchecks";
version = "3.0"; version = "3.0.1";
hash = "sha256-1xEWsNl1Gs+Xb5+KIZhnVrK4yT4CcVPfHEBP5EYQAD0="; hash = "sha256-r8wzIZPetnTEJDKPx/Oxk+gzs8gbjEHSi40LSxLb1Js=";
localSettings = pkgs.writeText "local_settings.py" '' localSettings = pkgs.writeText "local_settings.py" ''
import os import os
CSRF_TRUSTED_HOSTS = os.getenv("CSRF_TRUSTED_HOSTS", "").split(",") CSRF_TRUSTED_HOSTS = os.getenv("CSRF_TRUSTED_HOSTS", "").split(",")
@ -97,7 +96,7 @@
inherit pname version propagatedBuildInputs; inherit pname version propagatedBuildInputs;
format = "other"; format = "other";
outputs = [ "out" "static" "doc" ]; outputs = ["out" "static" "doc"];
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "healthchecks"; owner = "healthchecks";
@ -154,7 +153,7 @@
"2525" "2525"
]; ];
ExposedPorts = { ExposedPorts = {
"2525/tcp" = { }; "2525/tcp" = {};
}; };
}; };
} }
@ -168,7 +167,7 @@
"${self.packages.${system}.healthchecks}/app/manage.py" "${self.packages.${system}.healthchecks}/app/manage.py"
"sendalerts" "sendalerts"
]; ];
ExposedPorts = { }; ExposedPorts = {};
}; };
} }
); );
@ -182,13 +181,12 @@
"sendreports" "sendreports"
"--loop" "--loop"
]; ];
ExposedPorts = { }; ExposedPorts = {};
}; };
} }
); );
maintenance = maintenance = let
let
script = pkgs.writeShellScript "maintenance" '' script = pkgs.writeShellScript "maintenance" ''
CURL_OPTIONS="--fail --silent --show-error --max-time 10 --retry 5 --output /dev/null" CURL_OPTIONS="--fail --silent --show-error --max-time 10 --retry 5 --output /dev/null"
${pkgs.curl}/bin/curl $CURL_OPTIONS http://webserver.healthchecks.svc/ping/$MAINTENANCE_CHECK_UUID/start ${pkgs.curl}/bin/curl $CURL_OPTIONS http://webserver.healthchecks.svc/ping/$MAINTENANCE_CHECK_UUID/start
@ -206,7 +204,7 @@
Cmd = [ Cmd = [
"${script}" "${script}"
]; ];
ExposedPorts = { }; ExposedPorts = {};
}; };
} }
); );
@ -219,15 +217,14 @@
"${self.packages.${system}.healthchecks}/app/manage.py" "${self.packages.${system}.healthchecks}/app/manage.py"
"migrate" "migrate"
]; ];
ExposedPorts = { }; ExposedPorts = {};
}; };
} }
); );
webserver = webserver = let
let
uwsgi = pkgs.uwsgi.override { uwsgi = pkgs.uwsgi.override {
plugins = [ "python3" ]; plugins = ["python3"];
}; };
uwsgi-ini = pkgs.writeTextFile { uwsgi-ini = pkgs.writeTextFile {
name = "uwsgi.ini"; name = "uwsgi.ini";
@ -255,7 +252,7 @@
pkgs.dockerTools.buildLayeredImage ( pkgs.dockerTools.buildLayeredImage (
pkgs.lib.attrsets.recursiveUpdate baseImage { pkgs.lib.attrsets.recursiveUpdate baseImage {
name = "healthchecks-webserver"; name = "healthchecks-webserver";
fakeRootCommands = ''; fakeRootCommands = '' ;
mkdir /tmp mkdir /tmp
chmod 0777 /tmp chmod 0777 /tmp
''; '';
@ -265,7 +262,7 @@
"${uwsgi-ini}" "${uwsgi-ini}"
]; ];
ExposedPorts = { ExposedPorts = {
"8000/tcp" = { }; "8000/tcp" = {};
}; };
}; };
} }
@ -283,11 +280,10 @@
"--root=${self.packages.${system}.healthchecks.static}" "--root=${self.packages.${system}.healthchecks.static}"
]; ];
ExposedPorts = { ExposedPorts = {
"8000/tcp" = { }; "8000/tcp" = {};
}; };
}; };
}; };
}; };
checks.${system} = { checks.${system} = {
webserver = self.packages.${system}.webserver; webserver = self.packages.${system}.webserver;