1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-29 11:07:44 +00:00

fix: make cache serve s3

This commit is contained in:
RGBCube 2025-02-26 02:34:56 +03:00
parent 8aead69aba
commit 31bf6bc062
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
5 changed files with 20 additions and 39 deletions

18
hosts/best/cache.nix Normal file
View file

@ -0,0 +1,18 @@
{ self, config, lib, ... }: let
inherit (config.networking) domain;
inherit (lib) merge;
fqdn = "cache.${domain}";
in {
imports = [(self + /modules/nginx.nix)];
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
locations."/" = {
extraConfig = /* nginx */ ''
proxy_set_header Host "hercules.${config.services.garage.settings.s3_api.root_domain}";
'';
proxyPass = "http://${config.services.garage.settings.s3_api.api_bind_addr}";
};
};
}

View file

@ -3,8 +3,8 @@
inherit (lib) enabled merge;
fqdn = "s3.${domain}";
portS3 = 8004;
portRpc = 8005;
portS3 = 8003;
portRpc = 8004;
in {
imports = [(self + /modules/nginx.nix)];

View file

@ -1,27 +0,0 @@
{ self, config, lib, pkgs, ... }: let
inherit (config.networking) domain;
inherit (lib) enabled merge;
fqdn = "cache.${domain}";
port = 8003;
in {
imports = [(self + /modules/nginx.nix)];
secrets.nixServeKey = {
file = ./key.age;
owner = "nix-serve";
};
services.nix-serve = enabled {
package = pkgs.nix-serve-ng;
secretKeyFile = config.secrets.nixServeKey.path;
# Not ::1 because nix-serve doesn't like that.
bindAddress = "127.0.0.1";
inherit port;
};
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
};
}

View file

@ -1,8 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 8y3T6w +fPOWUbuD+JGfimuJnNa0wBpQyxC2nXGLGFdxAhfwns
bonLQGaN8rp0KmZHW9efsPyCQ8eujuxEB9p7Ewdp4Bo
-> ssh-ed25519 CzqbPQ 91liBCRmtq4YGG8Zz6+ObSEDlGVmA8Jn+NPQzTLQoGY
Gurxg2Tp1sdpz7xESiZCVw5BAuMI5vYH/UtdrFH9vd0
--- MJVivHhiqkVMke+mib2EZiFeZFX/BnFuEUctH+fdwd4
8k
Ôh}p©®lðz¾!I{­ <0A>z@SíZy/ôC3JÞQ:t¯ñ»NS&<26>CXw<58>·`ûE {£f'Oä<Äq<71>ï\;yùS—AöùÒ!Û_Ù<pñJ „@#‰Û·É(Õ63(«/G·ØgãIvÄ%ýºœ†