Mover storage-ng to server7/storage
This commit is contained in:
parent
a4fefb7251
commit
aee7e8651c
|
@ -58,6 +58,7 @@ rec {
|
||||||
};
|
};
|
||||||
server7.publicKey =
|
server7.publicKey =
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMiDm1b0NubTtcE9NuKrIpEOea5oS/yCW0Ncoaf/w3uy";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMiDm1b0NubTtcE9NuKrIpEOea5oS/yCW0Ncoaf/w3uy";
|
||||||
|
storage = { };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -106,38 +106,9 @@ in {
|
||||||
root = "/mnt/cephfs/c3d2/tftp";
|
root = "/mnt/cephfs/c3d2/tftp";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
#modules = [ pkgs.nginxModules.nixfancyindex ];
|
|
||||||
package =
|
|
||||||
pkgs.nginx.override { modules = with pkgs.nginxModules; [ fancyindex ]; };
|
|
||||||
virtualHosts = {
|
|
||||||
"storage-ng.hq.c3d2.de" = {
|
|
||||||
root = "/etc/nixos/www";
|
|
||||||
serverAliases = [ "storage" "storage2" "storageng" ];
|
|
||||||
http2 = true;
|
|
||||||
# addSSL = true;
|
|
||||||
locations = {
|
|
||||||
"/" = let authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
|
||||||
in {
|
|
||||||
alias = "/mnt/cephfs/c3d2/files/";
|
|
||||||
extraConfig = ''
|
|
||||||
auth_basic "Chaos";
|
|
||||||
auth_basic_user_file ${authFile};
|
|
||||||
fancyindex on;
|
|
||||||
# autoindex on;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/* # Open ports in the firewall.
|
/* # Open ports in the firewall.
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
23
|
23
|
||||||
80
|
|
||||||
443
|
|
||||||
];
|
];
|
||||||
networking.firewall.allowedUDPPorts = [
|
networking.firewall.allowedUDPPorts = [
|
||||||
69
|
69
|
||||||
|
|
Loading…
Reference in New Issue