4 changed files with 92 additions and 57 deletions
@ -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; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,49 @@
|
||||
name: |
||||
|
||||
(import ../outer-defaults.nix name) // { |
||||
|
||||
bindMounts."/srv/files" = { |
||||
hostPath = "/srv/ceph/c3d2/files"; |
||||
isReadOnly = true; |
||||
}; |
||||
|
||||
config = { config, pkgs, lib, ... }: { |
||||
imports = [ ../inner-defaults.nix ]; |
||||
|
||||
c3d2.hq.statistics.enable = true; |
||||
|
||||
services.nginx = { |
||||
enable = true; |
||||
package = pkgs.nginx.override { |
||||
modules = with pkgs.nginxModules; [ fancyindex ]; |
||||
}; |
||||
virtualHosts = { |
||||
"storage-ng.hq.c3d2.de".extraConfig = '' |
||||
server_name storage-ng.hq.c3d2.de; |
||||
return 301 $scheme://storage.hq.c3d2.de$request_uri; |
||||
''; |
||||
|
||||
"storage.hq.c3d2.de" = { |
||||
default = true; |
||||
http2 = true; |
||||
# addSSL = true; |
||||
locations = { |
||||
"/" = let authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY"; |
||||
in { |
||||
alias = "/srv/files/"; |
||||
extraConfig = '' |
||||
auth_basic "Chaos"; |
||||
auth_basic_user_file ${authFile}; |
||||
fancyindex on; |
||||
# autoindex on; |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
networking.firewall.enable = false; |
||||
}; |
||||
|
||||
} |
Loading…
Reference in new issue