#----------------------------------------------------------
# This is the main server configuration. This configuration
# shows the use of ratios and bandwith limiters.

[section] main

# allow connections from port 21
ftpport 21

# set maximum users to 200
maxusers 200

# log everything execpt debugging logs
logstrength 63

# set logfile
logfile /var/log/muddleftpd.log

# set default timeout to 300 seconds
timeout 300

# set the file displayed on login
logindump /etc/issue.ftp

# allow anyhost to connect
ipacl A:*

# set admin email address
email user@hostname

# set groups to run through. one group is to catch invalid usernames
# like root and uucp. The next catches anyone else and sees if they
# are a person that has a ratio.
group badusers
group ratiogroup

# set scratchfile for inetd operation
scratchfile /var/lock/muddleftpd.scratch 

# set hostname to something reasonable
hostname testserver

# set the greeting
greeting Welcome to the ratio Test server.

#----------------------------------------------------------
# This configures badusers. It catches any bad usernames that
# should not be logged into

[section] badusers

	# tell it to accept the usernames root, uucp and news
	nameacl A:root
	nameacl A:uucp
	nameacl A:news
	
	# accept these usernames from any host.
	ipacl A:*

	# tell the server these usernames are disabled
	authmethod disabled

	# set the maxuser count of this group to 0 so it isn't
	# added to the stats
	maxusers 0

#----------------------------------------------------------
# This configures the users that will use ratios.

[section] ratiogroup

	# tell the group that it can accept any host that the last group
	# didn't get
	ipacl A:*

	# tell the server to accept any username for this group
	nameacl A:*

	# tell the server to use chroot to the user's rootdir. Also
	# drop root privledges.
	chroot 1
	droproot 1
	
	# set the root directory to /home/mp3s
	rootdir /home/mp3s
	
	# set the users homedir to /, so he ends up in his own homedir
	homedir /

	# tell the server to use the unix authenticator, useful against
	# normal password files
	authmethod unix
	uid mp3
	gid mp3

	# only allow users to list and change directories.
	access /:LC

	# the first option only lets users upload mp3's to the upload
	# directory. The second allows downloads of mp3 from anywhere else.
	fnaccess /upload/*.mp3:A
	fnaccess *.mp3:R

	# now set ratios up. Give no credits to start off with. Setup 
	# so user gets 5 files for 1 upload and 10 bytes for every byte
	# uploaded

	ratios 1
	ratiofile /etc/ratios
	fileratios 5:1
	byteratios 10:1
	initalbytes 0
	initalfiles 0

	# now set up file download/upload limits to 16K per second per
	# connection.

	maxspeed 16384

	# now specify a line showing ratios whenever a user chdir's

	cddumpdata You have %A file credits/nYou have %a byte credits
	quitdumpdata You have downloaded %f file for %b bytes/nYou have uploaded %F files for %B bytes./nYou have %A file credits./nYou have %a byte credits./n/nThank you for using this archive./n

