I’m on 23.05 channel now. I installed Pure-FTPd to run FTP server on my machine, because I’m kinda familiar with it.
I could not found any options for that package. I had to use overrideAttrs
to add PureDB support, however I’m still not sure if it is now available, because starting Pure-FTPd via systemd service gives that in log:
pure-ftpd[151275]: (?@?) [ERROR] Unknown authentication method: puredb:/path/to/pure-ftpd.pdb
BTW package did not contain systemd service file configuration.
I ended up with pure-ftpd.nix configuration file like this:
{ pkgs, config, ... }:
{
environment.systemPackages = [
(pkgs.pure-ftpd.overrideAttrs (oldAttrs: {
configureFlags = oldAttrs.configureFlags ++ [ "--with-puredb" ];
}))
];
systemd.services.pure-ftpd = {
description = "PureFTPD Server";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.pure-ftpd}/bin/pure-ftpd --noanonymous --notruncate --login puredb:/path/to/pure-ftpd.pdb --prohibitdotfilesread --maxdiskusagepct 90% --bind 21 --chrooteveryone --nochmod --customerproof --dontresolve --passiveportrange 30000:30020";
User = "ftp";
Group = "ftp";
};
};
users.extraGroups.ftp.gid = config.ids.gids.ftp;
users.extraUsers.ftp = {
uid = config.ids.uids.ftp;
group = "ftp";
description = "FTP user";
home = "/path/to/ftp/root/";
};
networking.firewall.allowedTCPPortRanges = [ { from = 30000; to = 30020; } ];
}
What is more strange: I’ve created passwd and pdb files following Arch guide. Now when running:
$ pure-pw list -f /path/to/pure-ftpd.passwd
I get:
Unable to open the passwd file: No such file or directory
despite file existence and being (probably) valid password file.
Can anyone help me with setting up Pure-FTPd on NixOS?