Compare commits

...

4 commits

Author SHA1 Message Date
Jakob Lechner
f490ba26d0 Fix RuntimeDirectoryMode
`config.json` inside the runtime directory contains secrets and should
therefore not be world-readable.
2025-07-21 01:07:24 +02:00
Jakob Lechner
8894e4dd23 Remove assignment of unused variable 2025-07-21 01:06:52 +02:00
Jakob Lechner
abc8263e02 Force DHCP server to bind sockets
and add restart policy to systemd service
2025-07-21 01:06:52 +02:00
Jakob Lechner
8bd6ffbc7a Fix database privileges
Fixes psycopg2.errors.InsufficientPrivilege: permission denied for
schema public
2025-07-21 01:06:52 +02:00
3 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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 = [
{

View file

@ -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
'';
};