Initial add of gitea, add traefik for network routing
This commit is contained in:
parent
3aa74091ea
commit
0c57e7722f
|
@ -10,6 +10,7 @@
|
|||
./desktop/steam.nix
|
||||
./syncthing/Vanguard.nix
|
||||
./server/adguardhome.nix
|
||||
./server/gitea.nix
|
||||
];
|
||||
|
||||
networking.hostName = "Vanguard"; # Define your hostname.
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ./nginx ];
|
||||
imports = [ ./traefik.nix ];
|
||||
services.adguardhome = {
|
||||
enable = true;
|
||||
mutableSettings = true;
|
||||
settings.bind_port = 3001;
|
||||
openFirewall = true;
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 53 ];
|
||||
allowedUDPPorts = [ 53 ];
|
||||
};
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
routers.adguard = { rule = "Host(`guard.xenia.me.uk`)"; service = "adguard-webinterface"; };
|
||||
services.adguard-webinterface.loadBalancer.servers = [{ url = "http://localhost:3001"; }];
|
||||
};
|
||||
services.nginx.virtualHosts."guard.xenia.me.uk" = import ./nginx/sites/adguardhome.nix;
|
||||
networking.firewall.allowedTCPPorts = [ 53 3000 ];
|
||||
networking.firewall.allowedUDPPorts = [ 53 ];
|
||||
}
|
||||
|
|
10
server/gitea.nix
Normal file
10
server/gitea.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ./traefik.nix ];
|
||||
services.gitea.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
routers.gitea = { rule = "Host(`git.xenia.me.uk`)"; service = "gitea-websecure"; };
|
||||
services.gitea-websecure.loadBalancer.servers = [{ url = "http://localhost:3000"; }];
|
||||
};
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
package = pkgs.nginxMainline;
|
||||
recommendedTlsSettings = lib.mkDefault true;
|
||||
recommendedProxySettings = lib.mkDefault true;
|
||||
recommendedOptimisation = lib.mkDefault true;
|
||||
recommendedGzipSettings = lib.mkDefault true;
|
||||
};
|
||||
networking.firewall = { enable = true; allowedTCPPorts = [ 80 443 ]; };
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
listen = [{ addr = "0.0.0.0"; port = 80; }];
|
||||
serverName = "guard.xenia.me.uk";
|
||||
locations = { "/" = { proxyPass = "http://localhost:3000"; }; };
|
||||
}
|
14
server/traefik.nix
Normal file
14
server/traefik.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.traefik = {
|
||||
enable = true;
|
||||
staticConfigOptions = {
|
||||
api = { insecure = true; };
|
||||
entryPoints = {
|
||||
http = { address = ":80"; };
|
||||
web = { address = ":30000"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
networking.firewall = { enable = true; allowedTCPPorts = [ 80 443 30000 ]; };
|
||||
}
|
Loading…
Reference in a new issue