2022-01-26 11:15:46 +00:00
|
|
|
{ pkgs, config, ... }:
|
2022-01-17 07:02:56 +00:00
|
|
|
let
|
|
|
|
listenIPs = (import ../../utils/getInternalIP.nix config).listenIPs;
|
|
|
|
in
|
|
|
|
{
|
2022-01-16 16:44:30 +00:00
|
|
|
services.minio = {
|
|
|
|
enable = true;
|
2022-01-17 14:22:22 +00:00
|
|
|
rootCredentialsFile = "/run/secrets/security/minio/credentials_file";
|
2022-01-16 16:44:30 +00:00
|
|
|
};
|
2022-01-17 07:02:56 +00:00
|
|
|
services.nginx.virtualHosts."minio.int.chir.rs" = {
|
|
|
|
forceSSL = true;
|
|
|
|
http2 = true;
|
|
|
|
listenAddresses = listenIPs;
|
|
|
|
sslCertificate = "/var/lib/acme/int.chir.rs/cert.pem";
|
|
|
|
sslCertificateKey = "/var/lib/acme/int.chir.rs/key.pem";
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:9000";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
2022-01-17 07:35:35 +00:00
|
|
|
};
|
|
|
|
services.nginx.virtualHosts."minio-console.int.chir.rs" = {
|
|
|
|
forceSSL = true;
|
|
|
|
http2 = true;
|
|
|
|
listenAddresses = listenIPs;
|
|
|
|
sslCertificate = "/var/lib/acme/int.chir.rs/cert.pem";
|
|
|
|
sslCertificateKey = "/var/lib/acme/int.chir.rs/key.pem";
|
|
|
|
locations."/" = {
|
2022-01-17 07:02:56 +00:00
|
|
|
proxyPass = "http://127.0.0.1:9001";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
2022-01-18 10:36:50 +00:00
|
|
|
sops.secrets."security/minio/credentials_file" = { };
|
2022-01-26 11:15:46 +00:00
|
|
|
systemd.services.minio.serviceConfig.ExecStart = "${pkgs.minio}/bin/minio gateway s3 --json --address :9000 --console-address :9001 --config-dir=/var/lib/minio/config http://[fd00:e621:e621:2::2]:9000";
|
2022-01-16 16:44:30 +00:00
|
|
|
}
|