Move samba to server7

This commit is contained in:
Ehmry - 2020-01-26 18:40:18 +01:00
parent 5a39119e2e
commit a4fefb7251
3 changed files with 42 additions and 28 deletions

View File

@ -17,6 +17,7 @@ rec {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzWhy2T7avsFf+ZS8R99kah2wPQs7MYWUP+t4VBi28a";
pulsebert.publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAnEWn/8CKIiCtehh6Ha3XUQqjODj0ygyo3aGAsFWgfG";
samba = { };
storage-ng.publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMeg5ojU7U8+Lx824y+brazVJ007mEJDM7C7aUruOWGP";

View File

@ -0,0 +1,41 @@
name:
(import ../outer-defaults.nix name) // {
bindMounts."/srv/c3d2" = {
hostPath = "/srv/ceph/c3d2";
isReadOnly = true;
};
config = { config, pkgs, lib, ... }: {
imports = [ ../inner-defaults.nix ];
c3d2.hq.statistics.enable = true;
services.samba = {
enable = true;
enableNmbd = true;
extraConfig = ''
workgroup = WORKGROUP
server string = storage
netbios name = storage
hosts allow = 172.20 172.22 172.22.99.146
hosts deny = 0.0.0.0/0
map to guest = Bad user
'';
shares = {
c3d2 = {
path = "/srv/c3d2";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
};
};
};
networking.firewall.enable = false;
};
}

View File

@ -133,42 +133,14 @@ in {
};
};
services.samba = {
enable = false; # samba is garbage
enableNmbd = true;
extraConfig = ''
workgroup = WORKGROUP
server string = storage
netbios name = storage
hosts allow = 172.20 172.22 172.22.99.146
hosts deny = 0.0.0.0/0
guest account = k-ot
map to guest = Bad user
'';
shares = {
c3d2 = {
path = "/mnt/cephfs/c3d2";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "k-ot";
"force group" = "k-ot";
};
};
};
/* # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
23
80
443
137 138 445 139 # samba
];
networking.firewall.allowedUDPPorts = [
69
137 138 445 139 # samba
];
*/