config: changed default parameters and refactoring

This commit is contained in:
Ugo
2025-01-31 23:46:35 +00:00
parent 4565a14d2c
commit 7869d55f95

View File

@ -1,67 +1,68 @@
#FTP CONFIGURATION SAMPLE "/etc/uftpd.cfg" # FTP CONFIGURATION SAMPLE "/etc/uftpd.cfg"
####################################################### #######################################################
# UFTP SERVER SETTINGS # # UFTP SERVER SETTINGS #
####################################################### #######################################################
#MAXIMUM ALLOWED CONNECTIONS ON THE SERVER # NOTES:
MAXIMUM_ALLOWED_FTP_CONNECTION = 30 # restart uFTP to apply the configuration after changing parameters
#TCP/IP PORT SETTINGS (DEFAULT 21) # Maximum allowed FTP connections on the server
MAXIMUM_ALLOWED_FTP_CONNECTION = 50
# TCP/IP port settings (default: 21)
FTP_PORT = 21 FTP_PORT = 21
#Allow only one server instance (true or false) # Allow only one server instance (true or false)
SINGLE_INSTANCE = true SINGLE_INSTANCE = true
#Run in background, daemon mode ok # Run in background daemon mode (true or false)
DAEMON_MODE = true DAEMON_MODE = true
# Folder where to save the logs, use the same format below, the folder must terminate with / # Folder where logs are saved; must end with a '/'
LOG_FOLDER = /var/log/ LOG_FOLDER = /var/log/
# Maximum number of logs to keep, if 0 log functionality is disabled # Maximum number of logs to keep; set to 0 to disable logging
MAXIMUM_LOG_FILES = 0 MAXIMUM_LOG_FILES = 0
# Idle timeout in seconds, client are disconnected for inactivity after the # Idle timeout in seconds; clients are disconnected after this period of inactivity; set to 0 to disable
# specified amount of time in seconds, set to 0 to disable # some clients may fail if the timeout is too high https://github.com/kingk85/uFTP/issues/29
IDLE_MAX_TIMEOUT = 3600 IDLE_MAX_TIMEOUT = 330
#MAX CONNECTIONS PER IP # Maximum connections per IP address; set to 0 to disable
#LIMIT THE MAXIMUM NUMBER OF CONNECTION FOR EACH IP ADDRESS
# 0 TO DISABLE
MAX_CONNECTION_NUMBER_PER_IP = 10 MAX_CONNECTION_NUMBER_PER_IP = 10
#MAX LOGIN TRY PER IP # Maximum login attempts per IP (anti bruteforce feature); IP will be blocked for 5 minutes after exceeding this number of failed login attempts; set to 0 to disable
#THE IP ADDRESS WILL BE BLOCKED FOR 5 MINUTES AFTER WRONG LOGIN USERNAME AND PASSWORD
#0 TO DISABLE
MAX_CONNECTION_TRY_PER_IP = 10 MAX_CONNECTION_TRY_PER_IP = 10
#USE THE SERVER IP PARAMETER IF THE FTP SERVER IS UNDER NAT # Server IP address for NAT configurations; use commas instead of periods (e.g., 192,168,1,1); leave commented or blank if not used
#SERVER IP SHOULD BE SET TO ROUTER IP IN THIS CASE
#IF NOT IN USE LEAVE IT COMMENTED OR BLANK
#USE , instad of . eg: 192,168,1,1
#SERVER_IP = 192,168,1,1 #SERVER_IP = 192,168,1,1
#TLS CERTIFICATE FILE PATH # TLS certificate file paths
CERTIFICATE_PATH=/etc/uFTP/cert.pem CERTIFICATE_PATH=/etc/uFTP/cert.pem
PRIVATE_CERTIFICATE_PATH=/etc/uFTP/key.pem PRIVATE_CERTIFICATE_PATH=/etc/uFTP/key.pem
#Enable system authentication based on /etc/passwd # Enable system authentication based on /etc/passwd and /etc/shadow (true or false)
#and /etc/shadow
ENABLE_PAM_AUTH = false ENABLE_PAM_AUTH = false
# Force usage of the TLS # Force usage of TLS; if enabled, only TLS connections are allowed (true or false)
# If enabled, only TLS connections will be allowed
FORCE_TLS = false FORCE_TLS = false
# # Random port range for passive FTP connections
# Random port for passive FTP connections range
#
RANDOM_PORT_START = 10000 RANDOM_PORT_START = 10000
RANDOM_PORT_END = 50000 RANDOM_PORT_END = 50000
#USERS #######################################################
#START FROM USER 0 TO XXX # USER SETTINGS #
#######################################################
# Define users with the following parameters:
# USER_<n> = username
# PASSWORD_<n> = password
# HOME_<n> = home directory
# GROUP_NAME_OWNER_<n> = group ownership for new files (optional)
# USER_NAME_OWNER_<n> = user ownership for new files (optional)
USER_0 = username USER_0 = username
PASSWORD_0 = password PASSWORD_0 = password
HOME_0 = / HOME_0 = /
@ -78,7 +79,7 @@ USER_2 = anotherUsername
PASSWORD_2 = anotherPassowrd PASSWORD_2 = anotherPassowrd
HOME_2 = / HOME_2 = /
#blocked user that are not allowed to login # Blocked users who are not allowed to log in
BLOCK_USER_0 = user1 BLOCK_USER_0 = user1
BLOCK_USER_1 = user2 BLOCK_USER_1 = user2
BLOCK_USER_2 = user3 BLOCK_USER_2 = user3