add ring webhook
This commit is contained in:
parent
5297e7daab
commit
d16ac26712
4 changed files with 44 additions and 4 deletions
|
@ -936,11 +936,11 @@
|
|||
"secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1674110639,
|
||||
"narHash": "sha256-IpvJcMtRxcUM4gk8Ha0yKsIJs7Dmo+r9XBb8wUM2sDo=",
|
||||
"lastModified": 1675168228,
|
||||
"narHash": "sha256-n2SBJNQxdWZhnqQwTZS2QDCiPDyBPHHUslGTEpAYCTk=",
|
||||
"ref": "main",
|
||||
"rev": "ef5f10f16f670e26c950bacf95d3d0ec90f0a371",
|
||||
"revCount": 40,
|
||||
"rev": "ca6040e71ff71e905d896bdbdf8f9c74930ecc78",
|
||||
"revCount": 41,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@git.ingolf-wagner.de/palo/nixos-secrets.git"
|
||||
},
|
||||
|
|
|
@ -67,5 +67,7 @@
|
|||
# todo move to some place else
|
||||
home-manager.users.mailUser.home.stateVersion = "22.11";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
./wireguard.nix
|
||||
./jellyfin.nix
|
||||
|
||||
#./webhook-ring.nix
|
||||
|
||||
#../../system/server
|
||||
|
||||
|
|
37
nixos/machines/robi/webhook-ring.nix
Normal file
37
nixos/machines/robi/webhook-ring.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
sops.secrets.ringPushover = {
|
||||
owner = config.services.webhook.user;
|
||||
};
|
||||
|
||||
services.webhook = {
|
||||
enable = true;
|
||||
hooks = {
|
||||
ring = {
|
||||
execute-command =
|
||||
let
|
||||
script = pkgs.writers.writeBash "ring-script" ''
|
||||
. ${config.sops.secrets.ringPushover.path}
|
||||
${pkgs.curl}/bin/curl -s \
|
||||
--form-string "token=$API_KEY" \
|
||||
--form-string "user=$USER_KEY" \
|
||||
--form-string "title=Klingeling" \
|
||||
--form-string "message=Jemand an der Tür" \
|
||||
https://api.pushover.net/1/messages.json
|
||||
'';
|
||||
in
|
||||
toString script;
|
||||
response-message = "It's ringing";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."ring.ingolf-wagner.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.webhook.port}/${config.services.webhook.urlPrefix}/ring";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue