Summary Files Commits Branches @commit @diff @stats
path: root / modules
diff options
context:
space:
mode:
Commitc8b42534d8e4e0f136afb3a3639e2b47644e748e (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-02 14:21:07 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-02 14:21:07 +0300
Filesc9846b5cbb5482beb15ba9ccd5e7aa6a01a690f6 /modules
nix-c8b42534d8e4e0f136afb3a3639e2b47644e748e.tar
nix-c8b42534d8e4e0f136afb3a3639e2b47644e748e.tar.gz
nix-c8b42534d8e4e0f136afb3a3639e2b47644e748e.zip
Parent53193f4b940ee3139922dd6d11a1bd7ab3f88263 (diff)
feat(modules/server): Add ftp module for home-server group
1 files changed, 33 insertions, 0 deletions
-rw-r--r--modules/server/ftp.nix33
diff --git a/modules/server/ftp.nix b/modules/server/ftp.nix
new file mode 100644
index 0000000..4341e56
--- /dev/null
+++ b/modules/server/ftp.nix
@@ -0,0 +1,33 @@
+{
+ networking.firewall.allowedTCPPorts = [ 21 ] ++ /* passive mode ports */ builtins.genList (x: x + 2100) 10;
+ services.vsftpd = {
+ enable = true;
+ writeEnable = true;
+ allowWriteableChroot = true;
+ chrootlocalUser = true;
+
+ anonymousUser = true;
+ anonymousUserNoPassword = true;
+ anonymousUploadEnable = true;
+ anonymousMkdirEnable = true;
+ # Do note, anonymous users cannot write in their home (chroot) directory, period.
+ # The home dir must have non-write permissions and instead there should be a write-able subdirectory inside.
+ anonymousUserHome = "/home/ftp";
+ anonymousUmask = "0";
+
+ extraConfig = ''
+ # Enable passive mode, it seems most GUI tools use it
+ # Thanks https://serverfault.com/a/421169
+ pasv_enable=YES
+ pasv_min_port=2100
+ pasv_max_port=2109
+
+ # More anonymous user permissions
+ anon_world_readable_only=NO
+ anon_other_write_enable=YES
+
+ # Other
+ ftpd_banner=Мрежова папка
+ '';
+ };
+}