diff --git a/fieldpoc/dect.py b/fieldpoc/dect.py index 43811ff..0229601 100644 --- a/fieldpoc/dect.py +++ b/fieldpoc/dect.py @@ -27,7 +27,6 @@ class Dect: return next(self.fp.extensions.extensions_by_type("temp")).num def load_temp_extensions(self): - current_temp_extension = 0 used_temp_extensions = self.c.find_users(lambda u: u.num.startswith(self.temp_num_prefix)) for u in used_temp_extensions: temp_num = u.num diff --git a/nix/modules/dhcp.nix b/nix/modules/dhcp.nix index 30e689a..05d7227 100644 --- a/nix/modules/dhcp.nix +++ b/nix/modules/dhcp.nix @@ -44,11 +44,17 @@ in { }; config = mkIf cfg.enable { + systemd.services.kea-dhcp4-server.serviceConfig = { + Restart = "on-failure"; + RestartSec = 3; + }; + services.kea.dhcp4 = { enable = true; settings = { interfaces-config = { interfaces = [ cfg.interface ]; + service-sockets-require-all = true; }; option-def = [ { diff --git a/nix/modules/fieldpoc.nix b/nix/modules/fieldpoc.nix index 24462ad..18adc52 100644 --- a/nix/modules/fieldpoc.nix +++ b/nix/modules/fieldpoc.nix @@ -41,7 +41,7 @@ in { User = "fieldpoc"; Group = "fieldpoc"; RuntimeDirectory = "fieldpoc"; - RuntimeDirectoryMode = "0755"; + RuntimeDirectoryMode = "0750"; ConfigurationDirectory = "fieldpoc"; StateDirectory = "fieldpoc"; StateDirectoryMode = "0700"; @@ -98,6 +98,11 @@ in { CREATE ROLE fieldpoc WITH LOGIN PASSWORD 'fieldpoc' CREATEDB; CREATE DATABASE fieldpoc; GRANT ALL PRIVILEGES ON DATABASE fieldpoc TO fieldpoc; + + \connect fieldpoc + GRANT USAGE, CREATE ON SCHEMA public TO fieldpoc; + + \connect postgres ''; };