CoreDNS, dedicated git.gmem.ca route for NAS
This commit is contained in:
parent
89e425c201
commit
e1e7b401fc
|
@ -27,6 +27,30 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
coredns = {
|
||||||
|
enable = true;
|
||||||
|
config =
|
||||||
|
''
|
||||||
|
.:53 {
|
||||||
|
cache
|
||||||
|
bind tailscale0
|
||||||
|
}
|
||||||
|
git.gmem.ca {
|
||||||
|
cache
|
||||||
|
bind tailscale0
|
||||||
|
template IN A {
|
||||||
|
answer "{{ .Name }} 0 IN A 100.116.48.47"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
jack.enable = true;
|
||||||
|
};
|
||||||
zfs.autoScrub.enable = true;
|
zfs.autoScrub.enable = true;
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
openssh.enable = true;
|
openssh.enable = true;
|
||||||
|
@ -104,28 +128,24 @@
|
||||||
recommendedBrotliSettings = true;
|
recommendedBrotliSettings = true;
|
||||||
recommendedZstdSettings = true;
|
recommendedZstdSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
# We can only proxy one port with Tailscale Funnel so we abuse locations instead.
|
# We can only proxy one port with Tailscale Funnel so we abuse locations instead.
|
||||||
virtualHosts."vancouver.gmem.ca" = {
|
virtualHosts."vancouver.gmem.ca" = {
|
||||||
default = true;
|
default = true;
|
||||||
enableACME = false;
|
enableACME = true;
|
||||||
forceSSL = false;
|
addSSL = true;
|
||||||
|
acmeRoot = null;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
root = "/var/www/";
|
root = "/var/www/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
locations."/git/" = {
|
locations."/git" = {
|
||||||
proxyWebsockets = false; # needed if you need to use WebSocket
|
|
||||||
extraConfig =
|
extraConfig =
|
||||||
''
|
''
|
||||||
proxy_set_header Host $host;
|
return 301 $scheme://git.gmem.ca;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
'';
|
'';
|
||||||
proxyPass = "http://127.0.0.1:8973/";
|
|
||||||
};
|
};
|
||||||
locations."/n8n/" = {
|
locations."/n8n/" = {
|
||||||
proxyPass = "http://127.0.0.1:5678/";
|
proxyPass = "http://127.0.0.1:5678/";
|
||||||
|
@ -136,6 +156,21 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
virtualHosts."git.gmem.ca" = {
|
||||||
|
enableACME = true;
|
||||||
|
addSSL = true;
|
||||||
|
acmeRoot = null;
|
||||||
|
locations."/" = {
|
||||||
|
extraConfig =
|
||||||
|
''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
'';
|
||||||
|
proxyPass = "http://127.0.0.1:8973/";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
gitea = {
|
gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -143,7 +178,7 @@
|
||||||
package = pkgs.forgejo;
|
package = pkgs.forgejo;
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
ROOT_URL = "https://vancouver.scorpion-ghost.ts.net/git/";
|
ROOT_URL = "https://git.gmem.ca/";
|
||||||
HTTP_PORT = 8973;
|
HTTP_PORT = 8973;
|
||||||
};
|
};
|
||||||
service = {
|
service = {
|
||||||
|
@ -159,6 +194,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
gitea-actions-runner = {
|
gitea-actions-runner = {
|
||||||
|
package = pkgs.forgejo-actions-runner;
|
||||||
instances = {
|
instances = {
|
||||||
vancouver = {
|
vancouver = {
|
||||||
name = "vancouver";
|
name = "vancouver";
|
||||||
|
@ -167,8 +203,7 @@
|
||||||
"debian-latest:docker://node:18-bullseye"
|
"debian-latest:docker://node:18-bullseye"
|
||||||
"nix:docker://nixos/nix"
|
"nix:docker://nixos/nix"
|
||||||
];
|
];
|
||||||
url = "https://vancouver.scorpion-ghost.ts.net/git";
|
url = "https://git.gmem.ca/";
|
||||||
token = "";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -182,7 +217,9 @@
|
||||||
firewall = {
|
firewall = {
|
||||||
trustedInterfaces = ["tailscale0"];
|
trustedInterfaces = ["tailscale0"];
|
||||||
checkReversePath = "loose";
|
checkReversePath = "loose";
|
||||||
enable = false;
|
enable = true;
|
||||||
|
allowedTCPPorts = [ 22 53 80 443 ];
|
||||||
|
allowedUDPPorts = [ 53 ];
|
||||||
};
|
};
|
||||||
nftables.enable = true;
|
nftables.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -197,6 +234,8 @@
|
||||||
screen
|
screen
|
||||||
nix-output-monitor
|
nix-output-monitor
|
||||||
cifs-utils
|
cifs-utils
|
||||||
|
cloudflared
|
||||||
|
bat
|
||||||
# atuin
|
# atuin
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -233,9 +272,13 @@
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/Primary/becki";
|
home = "/Primary/becki";
|
||||||
};
|
};
|
||||||
root.openssh.authorizedKeys.keys = [
|
root.openssh.authorizedKeys.keys = let
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIztwQxt+jqroFONSgq+xzPMuE2I5Dq/zWPQ8RcTYJr"
|
authorizedKeys = pkgs.fetchurl {
|
||||||
];
|
url = "https://gmem.ca/ssh";
|
||||||
|
sha256 = "0iwrm80hsadr0midy0h3da4x0sbci76a92g8f9wnz5pj38gimdi9";
|
||||||
|
};
|
||||||
|
in pkgs.lib.splitString "\n" (builtins.readFile
|
||||||
|
authorizedKeys);
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.gsimmer = { pkgs, ... }: {
|
home-manager.users.gsimmer = { pkgs, ... }: {
|
||||||
|
@ -251,22 +294,25 @@
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
docker = {
|
docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
rootless = {
|
|
||||||
enable = true;
|
|
||||||
setSocketVariable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
libvirtd.enable = true;
|
libvirtd.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
security.acme.acceptTerms = true;
|
||||||
alsa.enable = true;
|
security.acme.defaults.email = "acme@gmem.ca";
|
||||||
alsa.support32Bit = true;
|
security.acme.certs."git.gmem.ca" = {
|
||||||
pulse.enable = true;
|
domain = "git.gmem.ca";
|
||||||
jack.enable = true;
|
dnsProvider = "route53";
|
||||||
|
credentialsFile = "/var/lib/secrets/credentials";
|
||||||
};
|
};
|
||||||
|
security.acme.certs."vancouver.gmem.ca" = {
|
||||||
|
domain = "vancouver.gmem.ca";
|
||||||
|
dnsProvider = "route53";
|
||||||
|
credentialsFile = "/var/lib/secrets/credentials";
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "23.05";
|
system.stateVersion = "23.05";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue