Add MotD support.

Fixed config up.
Better handling of config variables
This commit is contained in:
2024-12-15 08:14:48 -06:00
parent bc88a30c0c
commit 28efbfb185
12 changed files with 261 additions and 109 deletions

View File

@@ -3,14 +3,19 @@
## This is the primary configuration file. Here is where you'll find all the
## necessary options to configure your FTP server.
## == String Formatting
#### Cheat Sheet
### String Variables
## These may be used in certain options to be runtime replaced.
## %a App Name
## %u Username
## %p Password
## %v Version
## %h Hostname
## == Booleans
## %d Date
## %t Time
## Example: %a %v: Hi %u. It is %t on %d.
## digFTP v1.0.0: Hi user on example.com, your password is h4ckm3.
##
### Booleans
## true | false
## ----- | -----
## 1 | 0
@@ -18,41 +23,38 @@
## yes | no
## Anything unrecognized will be treated as 'false'.
## CORE OPTIONS
## These affect the very core of the server.
[core]
## The name of the server it sends to the client.
## Syntax: server_name=<string>
server_name=digFTP %v
## Default: %a %v
server_name=%a %v
## MotD command to post the output to clients after log in.
## WARNING: This method can be insecure. Use with caution.
## Syntax: motd_command=<command>
#motd_command=cowsay -r Welcome %u.
## MotD file to post to clients after log in. Overrides `motd_command`.
## Syntax: motd_file=<path>
#motd_file=motd
## MotD text to post to clients after log in. Overrides `motd_command` and
## `motd_file`.
## Syntax: motd_text=<string>
#motd_text=
## Message of the Day to post to clients upon log in.
## Syntax: motd=<string>
## motd=file:<path>
## motd=cmd:<command>
## WARNING: Commands could be dangerous. Use with caution.
#motd=cmd:cowsay -r Welcome %u.
#motd=file:ftp.motd
#motd=Welcome.
## Path to digFTP plugins
## Syntax: plugin_path=<path>
## Default: /usr/lib/digftp/plugins
plugin_path=/usr/lib/digftp/plugins
## Authentication Engine to use for logging in.
## Syntax: auth_engine=<name>
[engines]
## These specify the interface to use for functions.
## Engines are provided through plugins.
## Syntax: <interface>=<plugin name>
auth_engine=local
## Filer engine to use for the clients file system.
## Syntax: file_engine=<name>
## Possible values are: local
filer_engine=local
## Engine used for authenticating users.
## Default: pam
auth=pam
## Engine used for handling the filesystem.
## Default: local
filer=local
[net]
## Network address and port to listen on.
@@ -60,6 +62,8 @@ filer_engine=local
listen=127.0.0.1:21
## Whether to support SSL. Server must be compiled with WITH_SSL=ON.
## This is highly recommended as it allows clients to secure their login
## credentials. SSL support is provided as explicit (AUTH command).
## Syntax: ssl=<bool>
ssl=on
@@ -67,9 +71,13 @@ ssl=on
utf8=off
[ssl]
## Configuration for FTPS (Explicit SSL)
certificate=cert.pem
private_key=key.pem
## Ciphers to use for SSL.
## Default: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
ciphers=ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
ssl_v2=no
@@ -81,9 +89,10 @@ tls_v1_3=yes
compression=yes
prefer_server_ciphers=yes
#### LOGGING
## Filenames for loglevels.
[logging]
## Log messages to file. Logging has multiple options pertaining to each
## loglevel. All values are paths.
## Log server output files.
## Syntax: [console|critical|error|warning|info|debug|all]=<path>
info=digftp.info.log
error=digftp.error.log
@@ -96,4 +105,7 @@ file=passdb
## Root of logged in user. Can use string formatting.
## Syntax: home_path=<path>
home_path=/home/%u/
home_path=/home/%u/
[pam]
chroot=yes

1
conf/ftp.motd Normal file
View File

@@ -0,0 +1 @@
Welcome %u!

View File

@@ -1 +0,0 @@
Welcome to my FTP server.