2024-10-11 23:27:07 +03:00
|
|
|
{
|
2024-11-04 04:37:29 +03:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
util,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.module.ftpd;
|
2024-10-11 23:27:07 +03:00
|
|
|
in
|
2024-11-04 04:37:29 +03:00
|
|
|
{
|
|
|
|
options.module.ftpd = {
|
|
|
|
enable = lib.mkEnableOption "the FTP server";
|
|
|
|
storage = lib.mkOption {
|
|
|
|
default = null;
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
};
|
2024-06-25 04:04:39 +03:00
|
|
|
|
2024-11-04 04:37:29 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.vsftpd = {
|
|
|
|
enable = true;
|
|
|
|
allowWriteableChroot = true;
|
|
|
|
anonymousMkdirEnable = true;
|
|
|
|
anonymousUmask = "000";
|
|
|
|
anonymousUploadEnable = true;
|
|
|
|
anonymousUser = true;
|
|
|
|
anonymousUserHome = cfg.storage;
|
|
|
|
anonymousUserNoPassword = true;
|
|
|
|
localUsers = false;
|
|
|
|
writeEnable = true;
|
|
|
|
extraConfig = util.trimTabs ''
|
|
|
|
anon_other_write_enable=YES
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
}
|