treefmt + samba dir changed
nixos flake checks / invariant-checks (push) Failing after 7s
test-runner / smoke (push) Successful in 1s

This commit is contained in:
oqyude committed 2026-11-07 18:37:42 +03:00
1 parent d1b1b07903
commit d6d64d21c3
29 files changed
+998 -1122

No files matched your search

+1 -2
View File
@@ -91,8 +91,7 @@
# В otreca аналогичный юнит определён в `modules/vds/default.nix` с
# другим `PANEL_URL`/`apiToken`.
systemd.services."3xui-reconfig" = {
description =
"Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
description = "Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
serviceConfig = {
Type = "oneshot";
ExecStart = lib.getExe config.modules."3x-ui".reconfig;
+12 -4
View File
@@ -208,11 +208,14 @@ in
documentation = [ "https://github.com/oqyude/engipy" ];
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" "engipy-install.service" ];
after = [
"network-online.target"
"engipy-install.service"
];
wants = [ "network-online.target" ];
requires = [ "engipy-install.service" ];
environment = {
environment = {
PYTHONUNBUFFERED = "1";
PYTHONDONTWRITEBYTECODE = "1";
VIRTUAL_ENV = "${cfg.dataDir}/venv";
@@ -261,7 +264,8 @@ environment = {
User = cfg.user;
Group = cfg.user;
WorkingDirectory = cfg.dataDir;
ExecStart = "${cfg.dataDir}/venv/bin/uvicorn --factory app.main:create_app"
ExecStart =
"${cfg.dataDir}/venv/bin/uvicorn --factory app.main:create_app"
+ " --host ${cfg.bindAddress} --port ${toString cfg.port} --no-access-log";
Restart = "on-failure";
RestartSec = "5s";
@@ -279,7 +283,11 @@ environment = {
RestrictRealtime = true;
LockPersonality = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_UNIX"
];
};
};
};
+15 -15
View File
@@ -18,9 +18,9 @@ in
# ----- Static user for the runner ----------------------------------------
users.users.gitea-runner = {
isSystemUser = true;
group = "gitea-runner";
home = "/var/lib/gitea-runner";
description = "Gitea Actions Runner (sapphira host executor)";
group = "gitea-runner";
home = "/var/lib/gitea-runner";
description = "Gitea Actions Runner (sapphira host executor)";
};
users.groups.gitea-runner = { };
@@ -39,21 +39,21 @@ in
# decoded to a YAML body that EnvironmentFile could not parse, so
# the runner received no $TOKEN at all and Gitea replied
# "runner registration token not found".
path = "/var/lib/gitea-runner/registration-token";
format = "dotenv";
path = "/var/lib/gitea-runner/registration-token";
format = "dotenv";
sopsFile = ../../secrets/gitea-runner-registration.env;
owner = "gitea-runner";
group = "gitea-runner";
mode = "0440";
owner = "gitea-runner";
group = "gitea-runner";
mode = "0440";
};
# ----- The runner itself -------------------------------------------------
services.gitea-actions-runner.instances."${name}" = {
enable = true;
name = name;
url = "https://git.zeroq.su/"; # matches modules/server/gitea.nix ROOT_URL
enable = true;
name = name;
url = "https://git.zeroq.su/"; # matches modules/server/gitea.nix ROOT_URL
tokenFile = config.sops.secrets.gitea-runner-registration.path;
labels = [ "native:host" ]; # only host-executor; no docker required
labels = [ "native:host" ]; # only host-executor; no docker required
settings = {
runner = {
@@ -112,9 +112,9 @@ in
# tmpfiles setup. We still add a tmpfiles rule for /tmp/gitea-runner-work
# so successive deployments don't briefly see an empty target.
systemd.tmpfiles.rules = xlib.helpers.mkTmpDirs {
dir = "/tmp/gitea-runner-work";
mode = "1777"; # sticky so different runner invocations don't clobber
user = "root";
dir = "/tmp/gitea-runner-work";
mode = "1777"; # sticky so different runner invocations don't clobber
user = "root";
group = "root";
};
+1 -1
View File
@@ -374,7 +374,7 @@ in
# patch that reads X-Forwarded-Host (fork + plugin link) — the
# same-origin check assumes direct loopback or Tailscale serve,
# both of which give request.url a host that matches the browser.
"herdr.zeroq.su" = {
"herdr.zeroq.su" = {
forceSSL = true;
enableACME = true;
locations = {
+32 -17
View File
@@ -137,8 +137,20 @@ let
# realm = AD.ZEROQ.SU (realm Kerberos, верхний регистр)
# dnsDomain = ad.zeroq.su (AD DNS-зона, нижний регистр)
# Можно задать любой один, второй выводится.
realm = if cfg.realm != null then lib.strings.toUpper cfg.realm else if cfg.dnsDomain != null then lib.strings.toUpper cfg.dnsDomain else null;
dnsDomain = if cfg.dnsDomain != null then lib.strings.toLower cfg.dnsDomain else if cfg.realm != null then lib.strings.toLower cfg.realm else null;
realm =
if cfg.realm != null then
lib.strings.toUpper cfg.realm
else if cfg.dnsDomain != null then
lib.strings.toUpper cfg.dnsDomain
else
null;
dnsDomain =
if cfg.dnsDomain != null then
lib.strings.toLower cfg.dnsDomain
else if cfg.realm != null then
lib.strings.toLower cfg.realm
else
null;
# Заглушки на случай, когда не задано ни то, ни другое (закрыто assertion'ом).
realmValue = if realm != null then realm else "<unset>";
@@ -162,16 +174,22 @@ let
cache directory = ${stateDir}/cache
binddns dir = ${stateDir}/bind-dns
idmap_ldb:use rfc2307 = yes
${lib.optionalString (cfg.dnsBackend == "SAMBA_INTERNAL") ''
dns port = ${toString cfg.dnsPort}
''}${lib.optionalString (cfg.dnsForwarder != null) ''
dns forwarder = ${cfg.dnsForwarder}
''}${lib.optionalString (cfg.dnsBackend == "NONE") ''
# dnsBackend = NONE: DC не поднимает DNS-сервер вовсе, порт 53 он
# не трогает. Тогда AD-зоны должны обслуживать кто-то другой —
# см. note-файл.
server services = -dns
''}
${
lib.optionalString (cfg.dnsBackend == "SAMBA_INTERNAL") ''
dns port = ${toString cfg.dnsPort}
''
}${
lib.optionalString (cfg.dnsForwarder != null) ''
dns forwarder = ${cfg.dnsForwarder}
''
}${
lib.optionalString (cfg.dnsBackend == "NONE") ''
# dnsBackend = NONE: DC не поднимает DNS-сервер вовсе, порт 53 он
# не трогает. Тогда AD-зоны должны обслуживать кто-то другой —
# см. note-файл.
server services = -dns
''
}
[sysvol]
path = ${sysvolPath}
read only = no
@@ -430,9 +448,7 @@ in
}
{
assertion =
cfg.dnsBackend != "SAMBA_INTERNAL"
|| cfg.dnsPort != 53
|| !config.services.coredns.enable;
cfg.dnsBackend != "SAMBA_INTERNAL" || cfg.dnsPort != 53 || !config.services.coredns.enable;
message = ''
host.samba-ad: КОНФЛИКТ ПОРТА 53. Встроенный DNS AD DC
(dnsBackend = "SAMBA_INTERNAL", dnsPort = 53) и coredns оба хотят
@@ -451,8 +467,7 @@ in
'';
}
{
assertion =
!(config.services.samba.enable && config.services.samba.smbd.enable);
assertion = !(config.services.samba.enable && config.services.samba.smbd.enable);
message = ''
host.samba-ad: КОНФЛИКТ ПОРТА 445. AD DC обязан отдавать sysvol по
SMB (без этого не работает групповая политика), поэтому DC занимает
+1 -1
View File
@@ -58,7 +58,7 @@ in
"force group" = "root";
};
"${xlib.device.username}" = {
"path" = "${xlib.dirs.server-home}";
"path" = "${xlib.dirs.user-home}";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${xlib.device.username}";