mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/rsyncd: fix ini format for global section (#385064)
According to the manpage the rsyncd.conf has a global section without a module header. Settings for listening port or bind address must be put there and will not work if defined in a global submodule (i.e. below a "[global]" header). This commit changes the ini format generator for the rsyncd service to allow a global section in the config file without a submodule header. Fixes #304293 Credits to @nydragon * remove retrocompat, add incompat release notes
This commit is contained in:
parent
1de5bf89ee
commit
f46be21864
3 changed files with 28 additions and 19 deletions
|
@ -443,6 +443,10 @@
|
||||||
- `services.netbird.tunnels` was renamed to [`services.netbird.clients`](#opt-services.netbird.clients),
|
- `services.netbird.tunnels` was renamed to [`services.netbird.clients`](#opt-services.netbird.clients),
|
||||||
hardened (using dedicated less-privileged users) and significantly extended.
|
hardened (using dedicated less-privileged users) and significantly extended.
|
||||||
|
|
||||||
|
- `services.rsyncd.settings` now supports only two attributes `sections` and `globalSection`.
|
||||||
|
As a result, all sections previously defined under `services.rsyncd.settings` must now be put in `services.rsyncd.settings.sections`.
|
||||||
|
Global settings must now be placed in `services.rsyncd.settings.globalSection` instead of `services.rsyncd.settings.global`.
|
||||||
|
|
||||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||||
|
|
||||||
## Other Notable Changes {#sec-release-25.05-notable-changes}
|
## Other Notable Changes {#sec-release-25.05-notable-changes}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.rsyncd;
|
cfg = config.services.rsyncd;
|
||||||
settingsFormat = pkgs.formats.ini { };
|
settingsFormat = pkgs.formats.iniWithGlobalSection { };
|
||||||
configFile = settingsFormat.generate "rsyncd.conf" cfg.settings;
|
configFile = settingsFormat.generate "rsyncd.conf" cfg.settings;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -25,12 +25,14 @@ in
|
||||||
inherit (settingsFormat) type;
|
inherit (settingsFormat) type;
|
||||||
default = { };
|
default = { };
|
||||||
example = {
|
example = {
|
||||||
global = {
|
globalSection = {
|
||||||
uid = "nobody";
|
uid = "nobody";
|
||||||
gid = "nobody";
|
gid = "nobody";
|
||||||
"use chroot" = true;
|
"use chroot" = true;
|
||||||
"max connections" = 4;
|
"max connections" = 4;
|
||||||
|
address = "0.0.0.0";
|
||||||
};
|
};
|
||||||
|
sections = {
|
||||||
ftp = {
|
ftp = {
|
||||||
path = "/var/ftp/./pub";
|
path = "/var/ftp/./pub";
|
||||||
comment = "whole ftp area";
|
comment = "whole ftp area";
|
||||||
|
@ -45,6 +47,7 @@ in
|
||||||
"secrets file" = "/etc/rsyncd.secrets";
|
"secrets file" = "/etc/rsyncd.secrets";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
description = ''
|
description = ''
|
||||||
Configuration for rsyncd. See
|
Configuration for rsyncd. See
|
||||||
{manpage}`rsyncd.conf(5)`.
|
{manpage}`rsyncd.conf(5)`.
|
||||||
|
@ -81,7 +84,7 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
services.rsyncd.settings.global.port = toString cfg.port;
|
services.rsyncd.settings.globalSection.port = toString cfg.port;
|
||||||
|
|
||||||
systemd =
|
systemd =
|
||||||
let
|
let
|
||||||
|
|
|
@ -15,10 +15,11 @@ import ./make-test-python.nix (
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit socketActivated;
|
inherit socketActivated;
|
||||||
settings = {
|
settings = {
|
||||||
global = {
|
globalSection = {
|
||||||
"reverse lookup" = false;
|
"reverse lookup" = false;
|
||||||
"forward lookup" = false;
|
"forward lookup" = false;
|
||||||
};
|
};
|
||||||
|
sections = {
|
||||||
tmp = {
|
tmp = {
|
||||||
path = "/nix/store";
|
path = "/nix/store";
|
||||||
comment = "test module";
|
comment = "test module";
|
||||||
|
@ -26,6 +27,7 @@ import ./make-test-python.nix (
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
a = mkNode false;
|
a = mkNode false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue