fix narodmon script
This commit is contained in:
parent
3424713a41
commit
a75bd96aeb
@ -63,7 +63,7 @@ try:
|
|||||||
if temp is not None:
|
if temp is not None:
|
||||||
print_page(temp)
|
print_page(temp)
|
||||||
raise SystemExit(0)
|
raise SystemExit(0)
|
||||||
api_key = read_key('/tmp/narodmon-key')
|
api_key = read_key('/run/secrets/narodmon-key')
|
||||||
data['api_key'] = api_key
|
data['api_key'] = api_key
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
'http://narodmon.com/api',
|
'http://narodmon.com/api',
|
||||||
|
@ -151,7 +151,7 @@ in {
|
|||||||
};
|
};
|
||||||
} // default;
|
} // default;
|
||||||
"api.ataraxiadev.com" = {
|
"api.ataraxiadev.com" = {
|
||||||
locations."~ (\\.py|\\.sh)$" = with config.services; {
|
locations."~ (\\.py)$" = with config.services; {
|
||||||
alias = "/srv/http/api.ataraxiadev.com";
|
alias = "/srv/http/api.ataraxiadev.com";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
gzip off;
|
gzip off;
|
||||||
@ -355,7 +355,17 @@ in {
|
|||||||
|
|
||||||
sops.secrets.narodmon-key.sopsFile = inputs.self.secretsDir + /home-hypervisor/api.yaml;
|
sops.secrets.narodmon-key.sopsFile = inputs.self.secretsDir + /home-hypervisor/api.yaml;
|
||||||
sops.secrets.narodmon-key.owner = config.services.nginx.user;
|
sops.secrets.narodmon-key.owner = config.services.nginx.user;
|
||||||
sops.secrets.narodmon-key.path = "/tmp/narodmon-key";
|
# Avoid api key revoke
|
||||||
|
systemd.services.narodmon-api = {
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = config.services.nginx.user;
|
||||||
|
ExecStart = "${pkgs.narodmon-py}/bin/temp.py";
|
||||||
|
};
|
||||||
|
startAt = "daily";
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
system.activationScripts.linkPyScripts.text = ''
|
system.activationScripts.linkPyScripts.text = ''
|
||||||
[ ! -d "/srv/http/api.ataraxiadev.com" ] && mkdir -p /srv/http/api.ataraxiadev.com
|
[ ! -d "/srv/http/api.ataraxiadev.com" ] && mkdir -p /srv/http/api.ataraxiadev.com
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
narodmon-key: ENC[AES256_GCM,data:sNzfMEF5W6aaRAukJw==,iv:WUHbk+SYoU5J2L5eL16EnuH3jMIlv020oO+quWljCR0=,tag:EJ2LguJOT7HZgFjyn5eU5g==,type:str]
|
narodmon-key: ENC[AES256_GCM,data:8LJRYete2kojvn7sDA==,iv:KkUFWz2Dhs0FCQOutALhNHg8UKdQmrOog5Fw3GP/4Hk=,tag:rKoRfq0e4cytC0RFjwdLww==,type:str]
|
||||||
sops:
|
sops:
|
||||||
kms: []
|
kms: []
|
||||||
gcp_kms: []
|
gcp_kms: []
|
||||||
azure_kv: []
|
azure_kv: []
|
||||||
hc_vault: []
|
hc_vault: []
|
||||||
age: []
|
age: []
|
||||||
lastmodified: "2024-01-21T19:48:53Z"
|
lastmodified: "2024-01-27T14:51:05Z"
|
||||||
mac: ENC[AES256_GCM,data:htIZ35knmE7lscDrAHv/FnhiuwWxudr8W63wv39k97FfvmlM35MAJD7hKj2aYj5fk6dHz7XqinX+ibb6q5CYhCSi2gqGp6jzoUIj3Dowo/aBci39GTbnjXHhjCUYFWSJLoJHQDa6YxhHn5LGjbVmcGUqhx2GtfF6ZYkZNboJrgY=,iv:ptcGa8QbPaFz9Ln24QHdd/lMib1c1mVCbZ7YotSqqMA=,tag:GK0RGoQpuYJuQWOW+xSKDw==,type:str]
|
mac: ENC[AES256_GCM,data:1OnZT0kcK1t8wCW80YGQ+sMnfOR6EKqRYlrvFG81vZEPLwOeZVi5ByzydBYBCcrVQ6I5fxDULf1AVpQeWB0GmXaG9ZxehAzSkD4LA09l3/4RtKXKgSFNdiCkudeVwUguxyzWaLJd4Saq82ltxpW5Am4VWtzp+z0wJe81ImSz0cI=,iv:jqES/410Z02Z39z5mg6mn2nNeQqPzvxHQlstZJw7iJY=,tag:y7EurbA3YQmLtawgYWeJjg==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2024-01-21T19:48:32Z"
|
- created_at: "2024-01-21T19:48:32Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
|
Loading…
x
Reference in New Issue
Block a user