Use direct cache address for first boot
This commit is contained in:
@@ -482,13 +482,23 @@ in
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
dataDir = "/persist/var/lib/caddy";
|
||||
virtualHosts."http://${cfg.domain}".extraConfig = ''
|
||||
${caddyAllowedMatcher}
|
||||
handle @allowed {
|
||||
reverse_proxy 127.0.0.1:${toString cfg.atticPort}
|
||||
}
|
||||
respond 403
|
||||
'';
|
||||
virtualHosts = {
|
||||
"http://${cfg.domain}".extraConfig = ''
|
||||
${caddyAllowedMatcher}
|
||||
handle @allowed {
|
||||
reverse_proxy 127.0.0.1:${toString cfg.atticPort}
|
||||
}
|
||||
respond 403
|
||||
'';
|
||||
|
||||
":80".extraConfig = ''
|
||||
${caddyAllowedMatcher}
|
||||
handle @allowed {
|
||||
reverse_proxy 127.0.0.1:${toString cfg.atticPort}
|
||||
}
|
||||
respond 403
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.caddy = {
|
||||
|
||||
+1
-1
Submodule tofu/ami-builder updated: f8c9ef03bf...d5f5fe75bd
@@ -7,19 +7,18 @@
|
||||
|
||||
outputs = { nixpkgs, appServer, amiBuilderModules, ... }:
|
||||
let
|
||||
nixCacheHostAddress = "${nix_cache_host_address}";
|
||||
nixCacheDirectHost = if builtins.match ".*:.*" nixCacheHostAddress != null then "[${nix_cache_host_address}]" else nixCacheHostAddress;
|
||||
nixCacheEarlySubstituter = "http://$${nixCacheDirectHost}/${nix_cache_cache_name}";
|
||||
quixosEarlyBuildNixConfig = if ${nix_cache_enable} then {
|
||||
hosts = {
|
||||
"${nix_cache_host_address}" = [ "${nix_cache_domain}" ];
|
||||
};
|
||||
substituters = [ "${nix_cache_substituter}" ];
|
||||
substituters = [ nixCacheEarlySubstituter ];
|
||||
trustedPublicKeys = [ ${jsonencode(nix_cache_public_key)} ];
|
||||
} else {
|
||||
hosts = {};
|
||||
substituters = [];
|
||||
trustedPublicKeys = [];
|
||||
};
|
||||
nixCacheDomain = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.hosts."${nix_cache_host_address}" else "";
|
||||
nixCacheSubstituter = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.substituters else "";
|
||||
nixCacheDomain = "${nix_cache_domain}";
|
||||
nixCacheSubstituter = "${nix_cache_substituter}";
|
||||
nixCachePublicKey = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.trustedPublicKeys else "";
|
||||
|
||||
centralHost = nixpkgs.lib.nixosSystem {
|
||||
|
||||
@@ -7,19 +7,18 @@
|
||||
|
||||
outputs = { nixpkgs, amiBuilderModules, quixos, ... }:
|
||||
let
|
||||
nixCacheHostAddress = "${nix_cache_host_address}";
|
||||
nixCacheDirectHost = if builtins.match ".*:.*" nixCacheHostAddress != null then "[${nix_cache_host_address}]" else nixCacheHostAddress;
|
||||
nixCacheEarlySubstituter = "http://$${nixCacheDirectHost}/quixos";
|
||||
quixosEarlyBuildNixConfig = if ${nix_cache_enable} then {
|
||||
hosts = {
|
||||
"${nix_cache_host_address}" = [ "${nix_cache_domain}" ];
|
||||
};
|
||||
substituters = [ "${nix_cache_substituter}" ];
|
||||
substituters = [ nixCacheEarlySubstituter ];
|
||||
trustedPublicKeys = [ ${jsonencode(nix_cache_public_key)} ];
|
||||
} else {
|
||||
hosts = {};
|
||||
substituters = [];
|
||||
trustedPublicKeys = [];
|
||||
};
|
||||
nixCacheDomain = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.hosts."${nix_cache_host_address}" else "";
|
||||
nixCacheSubstituter = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.substituters else "";
|
||||
nixCacheDomain = "${nix_cache_domain}";
|
||||
nixCacheSubstituter = "${nix_cache_substituter}";
|
||||
nixCachePublicKey = if ${nix_cache_enable} then builtins.head quixosEarlyBuildNixConfig.trustedPublicKeys else "";
|
||||
|
||||
quixosHost = nixpkgs.lib.nixosSystem {
|
||||
|
||||
Reference in New Issue
Block a user