fix: wow-minecraft: mirror on bfs.band
runner nix smoke / nix label and flake smoke (push) Failing after 22s
runner nix smoke / nix label and flake smoke (push) Failing after 22s
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{ ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.minecraft-public-relay;
|
||||
in {
|
||||
options.services.minecraft-public-relay = {
|
||||
enable = lib.mkEnableOption "restricted SSH relay for Minecraft";
|
||||
publicPort = lib.mkOption { type = lib.types.port; default = 25568; };
|
||||
tunnelPort = lib.mkOption { type = lib.types.port; default = 25577; };
|
||||
publicKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Public SSH key of the Minecraft tunnel client";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
networking.firewall.allowedTCPPorts = [ cfg.publicPort ];
|
||||
users.groups.mc-wow-relay = { };
|
||||
users.users.mc-wow-relay = {
|
||||
isSystemUser = true;
|
||||
group = "mc-wow-relay";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"restrict,port-forwarding,permitlisten=\"127.0.0.1:${toString cfg.tunnelPort}\" ${cfg.publicKey}"
|
||||
];
|
||||
};
|
||||
services.openssh.extraConfig = ''
|
||||
Match User mc-wow-relay
|
||||
ClientAliveInterval 15
|
||||
ClientAliveCountMax 3
|
||||
AllowTcpForwarding remote
|
||||
PermitListen 127.0.0.1:${toString cfg.tunnelPort}
|
||||
AllowAgentForwarding no
|
||||
X11Forwarding no
|
||||
PermitTTY no
|
||||
ForceCommand ${pkgs.coreutils}/bin/false
|
||||
Match all
|
||||
'';
|
||||
systemd.sockets.minecraft-wow-proxy = {
|
||||
description = "WorldOfSosal WoW public Minecraft port";
|
||||
wantedBy = [ "sockets.target" ];
|
||||
listenStreams = [ "0.0.0.0:${toString cfg.publicPort}" ];
|
||||
};
|
||||
systemd.services.minecraft-wow-proxy = {
|
||||
description = "Forward Minecraft to the neuro reverse tunnel";
|
||||
requires = [ "minecraft-wow-proxy.socket" ];
|
||||
after = [ "minecraft-wow-proxy.socket" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd 127.0.0.1:${toString cfg.tunnelPort}";
|
||||
DynamicUser = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
matrixClusterSopsFile = flake + "/sus/matrix-cluster.yaml";
|
||||
in {
|
||||
imports = [
|
||||
./minecraft-wow.nix
|
||||
self.nixosModules.xray-system
|
||||
self.nixosModules.matrix-cluster
|
||||
self.nixosModules.matrix-cluster-users
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ (import ../../module/generic/minecraft-public-relay.nix { }) ];
|
||||
services.minecraft-public-relay = {
|
||||
enable = true;
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNWWegOVTOF3EOmam32iP7sMybULMTxsXuC+cEGITQ8 minecraft-wow-relay";
|
||||
};
|
||||
systemd.tmpfiles.rules = [ "d /var/www/store/minecraft/world-of-sosal 0755 root root -" ];
|
||||
services.nginx.virtualHosts."bfs.band".locations = {
|
||||
"= /minecraft".return = "302 /minecraft/world-of-sosal/";
|
||||
"= /minecraft/".return = "302 /minecraft/world-of-sosal/";
|
||||
"^~ /minecraft/" = {
|
||||
root = "/var/www/store";
|
||||
extraConfig = ''
|
||||
autoindex off;
|
||||
add_header Cache-Control "no-cache";
|
||||
try_files $uri $uri/ =404;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,43 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
# Public entry point; the backend arrives through a restricted reverse tunnel.
|
||||
networking.firewall.allowedTCPPorts = [ 25568 ];
|
||||
users.groups.mc-wow-relay = { };
|
||||
users.users.mc-wow-relay = {
|
||||
isSystemUser = true;
|
||||
group = "mc-wow-relay";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"restrict,port-forwarding,permitlisten=\"127.0.0.1:25577\" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNWWegOVTOF3EOmam32iP7sMybULMTxsXuC+cEGITQ8 minecraft-wow-relay"
|
||||
];
|
||||
};
|
||||
services.openssh.extraConfig = ''
|
||||
Match User mc-wow-relay
|
||||
ClientAliveInterval 15
|
||||
ClientAliveCountMax 3
|
||||
AllowTcpForwarding remote
|
||||
PermitListen 127.0.0.1:25577
|
||||
AllowAgentForwarding no
|
||||
X11Forwarding no
|
||||
PermitTTY no
|
||||
ForceCommand ${pkgs.coreutils}/bin/false
|
||||
Match all
|
||||
'';
|
||||
systemd.sockets.minecraft-wow-proxy = {
|
||||
description = "WorldOfSosal WoW public Minecraft port";
|
||||
wantedBy = [ "sockets.target" ];
|
||||
listenStreams = [ "0.0.0.0:25568" ];
|
||||
};
|
||||
systemd.services.minecraft-wow-proxy = {
|
||||
description = "Forward Minecraft to the neuro reverse tunnel";
|
||||
requires = [ "minecraft-wow-proxy.socket" ];
|
||||
after = [ "minecraft-wow-proxy.socket" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd 127.0.0.1:25577";
|
||||
DynamicUser = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
};
|
||||
imports = [ (import ../../module/generic/minecraft-public-relay.nix { }) ];
|
||||
services.minecraft-public-relay = {
|
||||
enable = true;
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNWWegOVTOF3EOmam32iP7sMybULMTxsXuC+cEGITQ8 minecraft-wow-relay";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
let
|
||||
mkTunnel = relay: {
|
||||
description = "WorldOfSosal WoW reverse tunnel to ${relay.name}";
|
||||
startLimitIntervalSec = 0;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
User = "mc-wow-tunnel";
|
||||
Group = "mc-wow-tunnel";
|
||||
ExecStart = "${pkgs.openssh}/bin/ssh -NT -i ${config.sops.secrets."minecraft/wow-tunnel-key".path} -o IPQoS=none -o Ciphers=aes256-ctr -o MACs=hmac-sha2-256-etm@openssh.com -o KexAlgorithms=curve25519-sha256 -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/etc/ssh/ssh_known_hosts -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o ConnectTimeout=10 -R 127.0.0.1:25577:127.0.0.1:25567 mc-wow-relay@${relay.address}";
|
||||
Restart = "always";
|
||||
RestartSec = 10;
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
users.groups.mc-wow-tunnel = { };
|
||||
users.users.mc-wow-tunnel = {
|
||||
isSystemUser = true;
|
||||
@@ -15,22 +34,16 @@
|
||||
hostNames = [ "128.140.75.58" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAFpr4DPSaJt0xeuGIfcZBJD3LsJHTdIRIs2Tt9HF+CT";
|
||||
};
|
||||
systemd.services.minecraft-wow-tunnel = {
|
||||
description = "WorldOfSosal WoW reverse tunnel to hectic-lab";
|
||||
startLimitIntervalSec = 0;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
User = "mc-wow-tunnel";
|
||||
Group = "mc-wow-tunnel";
|
||||
ExecStart = "${pkgs.openssh}/bin/ssh -NT -i ${config.sops.secrets."minecraft/wow-tunnel-key".path} -o IPQoS=none -o Ciphers=aes256-ctr -o MACs=hmac-sha2-256-etm@openssh.com -o KexAlgorithms=curve25519-sha256 -o BatchMode=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/etc/ssh/ssh_known_hosts -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o ConnectTimeout=10 -R 127.0.0.1:25577:127.0.0.1:25567 mc-wow-relay@128.140.75.58";
|
||||
Restart = "always";
|
||||
RestartSec = 10;
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
};
|
||||
programs.ssh.knownHosts.minecraft-wow-relay-bfs = {
|
||||
hostNames = [ "91.198.166.181" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcCn57nlWY5QyEz17kxuAbIX9PkjPwtlGzdJyhy+SQQ";
|
||||
};
|
||||
systemd.services.minecraft-wow-tunnel = mkTunnel {
|
||||
name = "hectic-lab";
|
||||
address = "128.140.75.58";
|
||||
};
|
||||
systemd.services.minecraft-wow-tunnel-bfs = mkTunnel {
|
||||
name = "bfs.band";
|
||||
address = "91.198.166.181";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user