diff --git a/hosts/next/agenix.nix b/hosts/next/agenix.nix index e53bb04..f365dc8 100644 --- a/hosts/next/agenix.nix +++ b/hosts/next/agenix.nix @@ -20,5 +20,9 @@ owner = "nextcloud"; group = "nextcloud"; }; + age.secrets.secret_pgadmin = { + file = ./secrets/pgadmin.age; + path = "/run/pgadmin"; + }; } diff --git a/hosts/next/databases.nix b/hosts/next/databases.nix index b91feaa..0a50f4e 100644 --- a/hosts/next/databases.nix +++ b/hosts/next/databases.nix @@ -1,10 +1,11 @@ {config, pkgs, ...}: { -networking.firewall.allowedTCPPorts = [ 5432 ]; +networking.firewall.allowedTCPPorts = [ 5432 5050 ]; # Enable PostgreSQL services.postgresql = { enable = true; + enableTCPIP = true; authentication = "host all all 192.168.0.0/16 trust"; # Ensure the database, user, and permissions always exist @@ -15,5 +16,11 @@ networking.firewall.allowedTCPPorts = [ 5432 ]; } ]; }; + services.pgadmin = { + openFirewall = true; + enable = true; + initialEmail = "pizzajoffre@gmail.com"; + initialPasswordFile = /run/pgadmin; + }; } diff --git a/hosts/next/secrets/pgadmin.age b/hosts/next/secrets/pgadmin.age new file mode 100644 index 0000000..4740d33 --- /dev/null +++ b/hosts/next/secrets/pgadmin.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 AsRWPA vJ7KcVXhCCcq0Mk4aBaM5LoA9gF6WOdDzTChwbkelkM +YdTT5zQt6gQobb50qs6nCXokOqW7+ZM5trmp6ld034M +-> (GBiT\-grease (e