xray: restart only when its own config changes
All checks were successful
nixos / nixos (push) Successful in 1m15s
All checks were successful
nixos / nixos (push) Successful in 1m15s
Xray restarted whenever anything in services' secrets file changed, because its restart trigger was the whole sops file; the runner token change just now restarted it. Xray may carry the admin's uplink. Tie the restart to its own secret. Assisted-by: Claude:opus-5-5
This commit is contained in:
parent
b7414c2ad1
commit
c9ac900b3d
1 changed files with 4 additions and 2 deletions
|
|
@ -1,14 +1,16 @@
|
||||||
# Xray VLESS Reality on :443. The whole config is a secret (keys, UUIDs).
|
# Xray VLESS Reality on :443. The whole config is a secret (keys, UUIDs).
|
||||||
{ config, unstable, ... }:
|
{ config, unstable, ... }:
|
||||||
{
|
{
|
||||||
sops.secrets."xray/config" = { };
|
# Restart on a change of this secret only: Xray may carry the admin's
|
||||||
|
# uplink, and anything else changing in the secrets file must not
|
||||||
|
# interrupt it
|
||||||
|
sops.secrets."xray/config".restartUnits = [ "xray.service" ];
|
||||||
|
|
||||||
services.xray = {
|
services.xray = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = unstable.xray; # 26.05 has 26.3, production runs 26.11
|
package = unstable.xray; # 26.05 has 26.3, production runs 26.11
|
||||||
settingsFile = config.sops.secrets."xray/config".path;
|
settingsFile = config.sops.secrets."xray/config".path;
|
||||||
};
|
};
|
||||||
systemd.services.xray.restartTriggers = [ config.sops.secrets."xray/config".sopsFile ];
|
|
||||||
networking.firewall.allowedTCPPorts = [ 443 ];
|
networking.firewall.allowedTCPPorts = [ 443 ];
|
||||||
asxpio.security.ports = [
|
asxpio.security.ports = [
|
||||||
"tcp/443/.xray-wrapped"
|
"tcp/443/.xray-wrapped"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue