nixos/netbox: don't force use of sudo in netbox-manage (#419237)

authored by Rémi NICOLE and committed by GitHub 17f82c3c 8715ab82

+10 -1
+2
nixos/doc/manual/release-notes/rl-2511.section.md
··· 66 67 - The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x. 68 69 - `services.dwm-status.extraConfig` was replaced by [RFC0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md)-compliant [](#opt-services.dwm-status.settings), which is used to generate the config file. `services.dwm-status.order` is now moved to [](#opt-services.dwm-status.settings.order), as it's a part of the config file. 70 71 - `gitversion` was updated to 6.3.0, which includes a number of breaking changes, old configurations may need updating or they will cause the tool to fail to run.
··· 66 67 - The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x. 68 69 + - `netbox-manage` script created by the `netbox` module no longer uses `sudo -u netbox` internally. It can be run as root and will change it's user to `netbox` using `runuser` 70 + 71 - `services.dwm-status.extraConfig` was replaced by [RFC0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md)-compliant [](#opt-services.dwm-status.settings), which is used to generate the config file. `services.dwm-status.order` is now moved to [](#opt-services.dwm-status.settings.order), as it's a part of the config file. 72 73 - `gitversion` was updated to 6.3.0, which includes a number of breaking changes, old configurations may need updating or they will cause the tool to fail to run.
+8 -1
nixos/modules/services/web-apps/netbox.nix
··· 39 (writeScriptBin "netbox-manage" '' 40 #!${stdenv.shell} 41 export PYTHONPATH=${pkg.pythonPath} 42 - sudo -u netbox ${pkg}/bin/netbox "$@" 43 ''); 44 45 in
··· 39 (writeScriptBin "netbox-manage" '' 40 #!${stdenv.shell} 41 export PYTHONPATH=${pkg.pythonPath} 42 + case "$(whoami)" in 43 + "root") 44 + ${util-linux}/bin/runuser -u netbox -- ${pkg}/bin/netbox "$@";; 45 + "netbox") 46 + ${pkg}/bin/netbox "$@";; 47 + *) 48 + echo "This must be run by either by root 'netbox' user" 49 + esac 50 ''); 51 52 in