Compare commits
3 Commits
a9f86e7ced
...
4c119f0b80
Author | SHA1 | Date |
---|---|---|
Simon Bruder | 4c119f0b80 | |
Simon Bruder | 939df6ae2a | |
Simon Bruder | 8f1d0a149c |
|
@ -67,12 +67,7 @@ in
|
||||||
id = host;
|
id = host;
|
||||||
address = hostAddresses;
|
address = hostAddresses;
|
||||||
})
|
})
|
||||||
addresses) ++ lib.optional isPrimaryHost {
|
addresses);
|
||||||
id = "inwx";
|
|
||||||
# INWX only allows the specification of one primary DNS,
|
|
||||||
# which limits the IP protocol usable for zone transfers to one.
|
|
||||||
address = lib.singleton "185.181.104.96";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
(lib.mkIf isPrimaryHost {
|
(lib.mkIf isPrimaryHost {
|
||||||
policy = lib.singleton {
|
policy = lib.singleton {
|
||||||
|
@ -90,7 +85,7 @@ in
|
||||||
zonefile-load = "difference-no-serial";
|
zonefile-load = "difference-no-serial";
|
||||||
journal-content = "all";
|
journal-content = "all";
|
||||||
# secondary
|
# secondary
|
||||||
notify = [ "inwx" ] ++ secondaryHosts;
|
notify = secondaryHosts;
|
||||||
# dnssec
|
# dnssec
|
||||||
dnssec-signing = true;
|
dnssec-signing = true;
|
||||||
dnssec-policy = "default";
|
dnssec-policy = "default";
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
enable = config.sbruder.wireguard.home.enable;
|
enable = config.sbruder.wireguard.home.enable;
|
||||||
listenAddress = config.sbruder.wireguard.home.address;
|
listenAddress = config.sbruder.wireguard.home.address;
|
||||||
enabledCollectors = [ "systemd" ];
|
enabledCollectors = [ "systemd" ];
|
||||||
disabledCollectors = [ "rapl" ];
|
disabledCollectors = [
|
||||||
|
"arp.netlink" # https://github.com/prometheus/node_exporter/issues/2849
|
||||||
|
"rapl"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg-home.service" ];
|
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg-home.service" ];
|
||||||
|
|
|
@ -61,15 +61,6 @@ def get_color_for_time(time: datetime.time, base=(60, 60, 60)) -> (int, int, int
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def update(client: mqtt.Client):
|
|
||||||
time = datetime.datetime.now().time()
|
|
||||||
color = get_color_for_time(time)
|
|
||||||
print(f"{time}: setting color to {color}")
|
|
||||||
sys.stdout.flush()
|
|
||||||
set_color(client, *color)
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
client = mqtt.Client("wordclock.py")
|
client = mqtt.Client("wordclock.py")
|
||||||
|
|
||||||
user = os.environ["WORDCLOCK_MQTT_USER"]
|
user = os.environ["WORDCLOCK_MQTT_USER"]
|
||||||
|
@ -83,6 +74,15 @@ host = os.environ["WORDCLOCK_MQTT_HOST"]
|
||||||
client.username_pw_set(user, password)
|
client.username_pw_set(user, password)
|
||||||
client.connect(host, 1883, 60)
|
client.connect(host, 1883, 60)
|
||||||
|
|
||||||
|
color = (0, 0, 0)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
update(client)
|
time = datetime.datetime.now().time()
|
||||||
|
new_color = get_color_for_time(time)
|
||||||
|
if new_color != color:
|
||||||
|
color = new_color
|
||||||
|
print(f"setting color to {color}")
|
||||||
|
sys.stdout.flush()
|
||||||
|
set_color(client, *color)
|
||||||
|
|
||||||
sleep(300)
|
sleep(300)
|
||||||
|
|
Loading…
Reference in New Issue