services: init loadbalancers, forgejo, etc

This commit is contained in:
notohh 2023-05-15 03:49:48 -04:00
parent e0bbc198a7
commit 82cfd6220b
Signed by: notohh
GPG key ID: BD47506D475EE86D
8 changed files with 61 additions and 14 deletions

View file

@ -6,5 +6,6 @@
./hugo.nix ./hugo.nix
./stash.nix ./stash.nix
./foundryvtt.nix ./foundryvtt.nix
./forgejo.nix
]; ];
} }

View file

@ -0,0 +1,16 @@
{pkgs, ...}: {
services.gitea = {
enable = true;
package = pkgs.forgejo;
stateDir = "/sakura/forjo";
settings = {
# service.DISABLE_REGISTRATION = true;
server = {
HTTP_PORT = 3000;
DOMAIN = "git.notohh.dev";
ROOT_URL = "https://git.notohh.dev";
LANDING_PAGE = "/explore/repos";
};
};
};
}

View file

@ -10,5 +10,8 @@
/run/secrets/foundry-username /run/secrets/foundry-username
/run/secrets/foundry-password /run/secrets/foundry-password
]; ];
ports = [
"30000:30000"
];
}; };
} }

View file

@ -1,9 +1,12 @@
{pkgs, ...}: { {config, ...}: {
virtualisation.oci-containers.containers.homepage = { virtualisation.oci-containers.containers.homepage = {
image = "ghcr.io/benphelps/homepage"; image = "ghcr.io/benphelps/homepage";
volumes = [ volumes = [
"/home/notoh/docker/homepage:/app/config" "/home/notoh/docker/homepage:/app/config"
"/var/run/docker.sock:/var/run/docker.sock:ro" "/var/run/docker.sock:/var/run/docker.sock:ro"
]; ];
ports = [
"3005:3000"
];
}; };
} }

View file

@ -6,5 +6,8 @@
volumes = [ volumes = [
"/home/notoh/docker/hugo:/src" "/home/notoh/docker/hugo:/src"
]; ];
ports = [
"1313:1313"
];
}; };
} }

View file

@ -7,5 +7,8 @@
environment = { environment = {
INSTANCE_NAME = "SearXNG"; INSTANCE_NAME = "SearXNG";
}; };
ports = [
"8085:8080"
];
}; };
} }

View file

@ -16,5 +16,8 @@
"/home/notoh/docker/stash/cache:/cache" "/home/notoh/docker/stash/cache:/cache"
"/home/notoh/docker/stash/generated:/generated" "/home/notoh/docker/stash/generated:/generated"
]; ];
ports = [
"9999:9999"
];
}; };
} }

View file

@ -12,9 +12,16 @@
}; };
services.traefik = { services.traefik = {
enable = true; enable = true;
group = "docker";
dynamicConfigOptions = { dynamicConfigOptions = {
http = { http = {
services = {
homepage.loadBalancer.servers = [{url = "http://localhost:3005";}];
searxng.loadBalancer.servers = [{url = "http://localhost:8085";}];
hugo.loadBalancer.servers = [{url = "http://localhost:1313";}];
stash.loadBalancer.servers = [{url = "http://localhost:9999";}];
foundryvtt.loadBalancer.servers = [{url = "http://localhost:30000";}];
gitea.loadBalancer.servers = [{url = "http://localhost:3000";}];
};
routers = { routers = {
api = { api = {
rule = "PathPrefix(`/api/`)"; rule = "PathPrefix(`/api/`)";
@ -24,29 +31,36 @@
homepage = { homepage = {
rule = "Host(`dashboard.lab`)"; rule = "Host(`dashboard.lab`)";
entrypoints = ["web"]; entrypoints = ["web"];
service = "homepage@docker"; service = "homepage";
}; };
searxng = { searxng = {
rule = "Host(`searxng.lab`)"; rule = "Host(`searxng.lab`)";
entrypoints = ["web"]; entrypoints = ["web"];
service = "searxng@docker"; service = "searxng";
};
hugo = {
rule = "Host(`notohh.dev`)";
entryPoints = ["websecure"];
service = "hugo@docker";
tls.domains = [{main = "*.notohh.dev";}];
tls.certresolver = "staging";
}; };
stash = { stash = {
rule = "Host(`stash.lab`)"; rule = "Host(`stash.lab`)";
entrypoints = ["web"]; entrypoints = ["web"];
service = "stash@docker"; service = "stash";
};
hugo = {
rule = "Host(`notohh.dev`)";
entryPoints = ["websecure"];
service = "hugo";
tls.domains = [{main = "*.notohh.dev";}];
tls.certresolver = "staging";
}; };
foundryvtt = { foundryvtt = {
rule = "Host(`foundry.notohh.dev`)"; rule = "Host(`foundry.notohh.dev`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
service = "foundryvtt@docker"; service = "foundryvtt";
tls.domains = [{main = "*.notohh.dev";}];
tls.certresolver = "staging";
};
gitea = {
rule = "Host(`git.notohh.dev`)";
entrypoints = ["websecure"];
service = "gitea";
tls.domains = [{main = "*.notohh.dev";}]; tls.domains = [{main = "*.notohh.dev";}];
tls.certresolver = "staging"; tls.certresolver = "staging";
}; };
@ -57,7 +71,6 @@
log.level = "DEBUG"; log.level = "DEBUG";
api.dashboard = true; api.dashboard = true;
api.insecure = true; api.insecure = true;
providers.docker = true;
global = { global = {
checkNewVersion = false; checkNewVersion = false;
sendAnonymousUsage = false; sendAnonymousUsage = false;
@ -73,6 +86,7 @@
caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"; caServer = "https://acme-staging-v02.api.letsencrypt.org/directory";
dnsChallenge = { dnsChallenge = {
provider = "cloudflare"; provider = "cloudflare";
resolvers = ["1.1.1.1:53" "1.0.0.1:53"];
delayBeforeCheck = "0"; delayBeforeCheck = "0";
}; };
}; };
@ -82,6 +96,7 @@
caServer = "https://acme-v02.api.letsencrypt.org/directory"; caServer = "https://acme-v02.api.letsencrypt.org/directory";
dnsChallenge = { dnsChallenge = {
provider = "cloudflare"; provider = "cloudflare";
resolvers = ["1.1.1.1:53" "1.0.0.1:53"];
delayBeforeCheck = "0"; delayBeforeCheck = "0";
}; };
}; };