a
This commit is contained in:
parent
1233b1afde
commit
38ca2ee874
6 changed files with 38 additions and 25 deletions
|
|
@ -48,14 +48,15 @@
|
||||||
ragon.agenix.secrets."picardSlidingSyncSecret" = { };
|
ragon.agenix.secrets."picardSlidingSyncSecret" = { };
|
||||||
|
|
||||||
services.nginx.recommendedOptimisation = true;
|
services.nginx.recommendedOptimisation = true;
|
||||||
|
|
||||||
services.nginx.virtualHosts."xyno.space" = {
|
services.nginx.virtualHosts."xyno.space" = {
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/".proxyPass = "http://[::1]${config.services.xynoblog.listen}";
|
locations."/".proxyPass = "http://[::1]${config.services.xynoblog.listen}";
|
||||||
locations."/gyakapyukawfyuokfgwtyutf.js".proxyPass = "http://127.0.0.1:${toString config.services.plausible.server.port}/js/plausible.outbound-links.js";
|
locations."/gyakapyukawfyuokfgwtyutf.js".proxyPass = "http://127.0.0.1:${toString config.services.plausible.server.port}/js/plausible.outbound-links.js";
|
||||||
locations."/api/event".proxyPass = "http://127.0.0.1:${toString config.services.plausible.server.port}";
|
locations."/api/event".proxyPass = "http://127.0.0.1:${toString config.services.plausible.server.port}";
|
||||||
};
|
} // (lib.my.findOutTlsConfig "xyno.space" config);
|
||||||
|
|
||||||
services.lolpizza2.enable = true;
|
services.lolpizza2.enable = true;
|
||||||
|
|
||||||
services.nginx.virtualHosts."lolpizza.ragon.xyz" = {
|
services.nginx.virtualHosts."lolpizza.ragon.xyz" = {
|
||||||
useACMEHost = "ragon.xyz";
|
useACMEHost = "ragon.xyz";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
@ -63,11 +64,18 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."xyno.systems" = {
|
services.nginx.virtualHosts."xyno.systems" = {
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/".return = "307 https://xyno.space$request_uri";
|
locations."/".return = "307 https://xyno.space$request_uri";
|
||||||
} // (lib.findOutTlsConfig "xyno.systems" config);
|
} // (lib.my.findOutTlsConfig "xyno.systems" config);
|
||||||
|
|
||||||
|
security.acme.certs."xyno.space" = {
|
||||||
|
dnsProvider = "ionos";
|
||||||
|
dnsResolver = "1.1.1.1:53";
|
||||||
|
group = "nginx";
|
||||||
|
extraDomainNames = [
|
||||||
|
"*.xyno.systems"
|
||||||
|
];
|
||||||
|
credentialsFile = "${config.age.secrets.cloudflareAcme.path}";
|
||||||
|
};
|
||||||
security.acme.certs."xyno.systems" = {
|
security.acme.certs."xyno.systems" = {
|
||||||
dnsProvider = "ionos";
|
dnsProvider = "ionos";
|
||||||
dnsResolver = "1.1.1.1:53";
|
dnsResolver = "1.1.1.1:53";
|
||||||
|
|
@ -76,7 +84,6 @@
|
||||||
"*.xyno.systems"
|
"*.xyno.systems"
|
||||||
];
|
];
|
||||||
credentialsFile = "${config.age.secrets.cloudflareAcme.path}";
|
credentialsFile = "${config.age.secrets.cloudflareAcme.path}";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.appendHttpConfig = ''
|
services.nginx.appendHttpConfig = ''
|
||||||
|
|
@ -160,6 +167,7 @@
|
||||||
ts3.enable = true;
|
ts3.enable = true;
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
nginx.domain = "ragon.xyz";
|
nginx.domain = "ragon.xyz";
|
||||||
|
nginx.domains = [ "xyno.space" "xyno.systems" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ in
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
"${serverName}" = {
|
"${serverName}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
|
||||||
|
|
||||||
locations."= /.well-known/matrix/server".extraConfig =
|
locations."= /.well-known/matrix/server".extraConfig =
|
||||||
let
|
let
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,19 @@ rec {
|
||||||
};
|
};
|
||||||
findOutTlsConfig = domain: config:
|
findOutTlsConfig = domain: config:
|
||||||
let
|
let
|
||||||
spl = builtins.splitString "." domain;
|
spl = lib.splitString "." domain;
|
||||||
outerDomain = builtins.concatStringsSep "." (builtins.take (builtins.length spl - 1) spl);
|
len = builtins.length spl;
|
||||||
|
outerDomain = lib.traceVal (lib.concatStringsSep "." (lib.sublist (len - 2) len spl));
|
||||||
|
domains = config.ragon.services.nginx.domains;
|
||||||
|
hasDomain = lib.any (d: d == outerDomain) domains;
|
||||||
in
|
in
|
||||||
lib.mkMerge [
|
if hasDomain then {
|
||||||
((lib.hasAttr outerDomain config.acme.certs) && {
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "${domain}";
|
useACMEHost = "${domain}";
|
||||||
})
|
} else
|
||||||
(!(lib.hasAttr outerDomain config.acme.certs) && {
|
{
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
})
|
};
|
||||||
];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@ in
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
ragon.secrets.autheliaStorageEncryption = { };
|
ragon.agenix.secrets.autheliaStorageEncryption = { };
|
||||||
ragon.secrets.autheliaSessionSecret = { };
|
ragon.agenix.secrets.autheliaSessionSecret = { };
|
||||||
ragon.secrets.autheliaOidcIssuerPrivateKey = { };
|
ragon.agenix.secrets.autheliaOidcIssuerPrivateKey = { };
|
||||||
ragon.secrets.autheliaOidcHmacSecret = { };
|
ragon.agenix.secrets.autheliaOidcHmacSecret = { };
|
||||||
ragon.secrets.autheliaJwtSecret = { };
|
ragon.agenix.secrets.autheliaJwtSecret = { };
|
||||||
ragon.secrets.autheliaEmail = { user = "authelia"; };
|
ragon.agenix.secrets.autheliaEmail = { user = "authelia"; };
|
||||||
services.authelia.instances.${instanceName} = {
|
services.authelia.instances.${instanceName} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
secrets = {
|
secrets = {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ in
|
||||||
default = "md.xyno.systems";
|
default = "md.xyno.systems";
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
ragon.secrets.autheliaHedgedoc = { user = "authelia"; };
|
ragon.agenix.secrets.autheliaHedgedoc = { user = "authelia"; };
|
||||||
services.authelia.instances.main.settingsFiles = [
|
services.authelia.instances.main.settingsFiles = [
|
||||||
config.age.secrets.autheliaHedgedoc.path
|
config.age.secrets.autheliaHedgedoc.path
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ in
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "hailsatan.eu";
|
default = "hailsatan.eu";
|
||||||
};
|
};
|
||||||
|
options.ragon.services.nginx.domains =
|
||||||
|
lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue