mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-22 12:49:32 -08:00
set up postgresql to be remote accessable
This commit is contained in:
parent
570ff894f8
commit
6c37553143
3 changed files with 4 additions and 25 deletions
|
@ -7,7 +7,6 @@
|
|||
(import ./hardware-configuration.nix)
|
||||
(import ./modules/nginx.nix)
|
||||
(import ./modules/nextcloud.nix)
|
||||
(import ./modules/postgresql.nix)
|
||||
(import ./modules/msmtp.nix)
|
||||
(import ./modules/forgejo.nix)
|
||||
];
|
||||
|
@ -34,7 +33,7 @@
|
|||
};
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [80 443 3001]; # port 3001 opened to allow git traffic on the local netword
|
||||
allowedTCPPorts = [80 443 3001 5432]; # port 3001 opened to allow git traffic on the local netword
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableTCPIP = true;
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
|
@ -52,7 +53,8 @@
|
|||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
'';
|
||||
host all all 0.0.0.0/0 md5
|
||||
''; # address is the computer you are connecting from
|
||||
};
|
||||
|
||||
# Make sure PostSQL is running before nextcloud
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
}
|
||||
];
|
||||
authentication = lib.mkForce ''
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue