From cb939661a1b38ea18f681dd17d95147da44aa066 Mon Sep 17 00:00:00 2001 From: morgajel Date: Wed, 3 Sep 2014 10:57:36 -0400 Subject: [PATCH] new parameters to increase config flexibility There were several available parameters that I use that weren't passible; This adds them along with sane defaults --- manifests/init.pp | 6 ++++++ templates/vsftpd.conf.erb | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index fce36de..cce416e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -39,6 +39,12 @@ $ascii_upload_enable = 'NO', $ascii_download_enable = 'NO', $ftpd_banner = undef, + $guest_enable = 'NO', + $virtual_use_local_privs = 'YES', + $log_ftp_protocol = 'NO', + # intentionally not interpolated + $user_sub_token = '$USER', + $local_root = '/ftp/virtual/$USER', $chroot_local_user = 'NO', $chroot_list_enable = 'NO', $chroot_list_file = '/etc/vsftpd/chroot_list', diff --git a/templates/vsftpd.conf.erb b/templates/vsftpd.conf.erb index b6594fa..31ca251 100644 --- a/templates/vsftpd.conf.erb +++ b/templates/vsftpd.conf.erb @@ -13,7 +13,25 @@ anonymous_enable=<%= @anonymous_enable %> # # Uncomment this to allow local users to log in. local_enable=<%= @local_enable %> -# + +# If enabled, all non-anonymous logins are classed as "guest" logins. i +# A guest login is remapped to the user specified in the guest_username setting. +guest_enable=<%= @guest_enable %> + +# If enabled, virtual users will use the same privileges as local users. +# By default, virtual users will use the same privileges as anonymous users, +# which tends to be more restrictive (especially in terms of write access). +virtual_use_local_privs=<%=@virtual_use_local_privs%> + +# It is used to automatically generate a home directory for each virtual user, based on a template. +user_sub_token=<%=@user_sub_token%> + +# This option represents a directory which vsftpd will try to change into after a local (i.e. non-anonymous) login. +local_root=<%=@local_root%> + +# When enabled, all FTP requests and responses are logged, providing the option xferlog_std_format is not enabled. Useful for debugging. +log_ftp_protocol=<%=@log_ftp_protocol%> + # Uncomment this to enable any form of FTP write command. write_enable=<%= @write_enable %> #