mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
feat(forgejo): masquerade and dnat sentinel:9922 to forgejo vm
This commit is contained in:
parent
0abd08a7be
commit
7f8c5689e0
3 changed files with 26 additions and 0 deletions
|
@ -30,6 +30,28 @@ in {
|
|||
nodes.sentinel = {
|
||||
networking.providedDomains.forgejo = forgejoDomain;
|
||||
|
||||
# Make sure to masquerade 9922 (wan) -> 22 (proxy-sentinel)
|
||||
networking.nftables.chains = {
|
||||
forward.dnat = {
|
||||
after = ["conntrack"];
|
||||
rules = ["ct status dnat accept"];
|
||||
};
|
||||
postrouting.to-forgejo = {
|
||||
after = ["hook"];
|
||||
rules = [
|
||||
"iifname wan ip daddr ${config.meta.wireguard.proxy-sentinel.ipv4} tcp dport 22 masquerade random"
|
||||
"iifname wan ip6 daddr ${config.meta.wireguard.proxy-sentinel.ipv6} tcp dport 22 masquerade random"
|
||||
];
|
||||
};
|
||||
prerouting.to-forgejo = {
|
||||
after = ["hook"];
|
||||
rules = [
|
||||
"iifname wan tcp dport 9922 dnat ip to ${config.meta.wireguard.proxy-sentinel.ipv4}:22"
|
||||
"iifname wan tcp dport 9922 dnat ip6 to ${config.meta.wireguard.proxy-sentinel.ipv6}:22"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
upstreams.forgejo = {
|
||||
servers."${config.meta.wireguard.proxy-sentinel.ipv4}:${toString config.services.gitea.settings.server.HTTP_PORT}" = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue