forked from abraham1901/adamjlow-proftpd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_sql.conf.erb
53 lines (52 loc) · 1.82 KB
/
mod_sql.conf.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Proftpd sample configuration for SQL-based authentication.
#
# (This is not to be used if you prefer a PAM-based SQL authentication)
#
<IfModule mod_sql.c>
#
# Choose a SQL backend among MySQL or PostgreSQL.
# Both modules are loaded in default configuration, so you have to specify the backend
# or comment out the unused module in /etc/proftpd/modules.conf.
# Use 'mysql' or 'postgres' as possible values.
#
SQLBackend <%= @sql_backend %>
#
SQLEngine <%= @sql_engine %>
SQLAuthenticate on
#
#
# Use a backend-crypted or a crypted password
SQLAuthTypes <%= @sql_auth_types %>
#
# Connection
SQLConnectInfo <%= @sql_dbname %>@<%= @sql_host %> <%= @sql_username %> <%= @sql_password %>
#SQLLogFile /var/log/proftpd/sql.log
#
# Describes both users/groups tables
#
SQLUserInfo users userid passwd uid gid homedir shell
SQLGroupInfo ftpgroups groupname gid members
#
<% if @sql_min_user_gid != false -%>
SQLMinUserGID <%= @sql_min_user_gid %>
<% end -%>
<% if @sql_min_user_uid != false -%>
SQLMinUserUID <%= @sql_min_user_uid %>
<% else -%>
SQLMinID 64000
<% end -%>
CreateHome on 770
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "login_count=login_count+1, last_login=now() WHERE userid='%u'" users
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "last_modified=now() WHERE userid='%u'" users
# SQLLog RETR bytes-out-count
# SQLNamedQuery bytes-out-count UPDATE "bytes_out_used=bytes_out_used+%b WHERE userid='%u'" users
# SQLLog RETR files-out-count
# SQLNamedQuery files-out-count UPDATE "files_out_used=files_out_used+1 WHERE userid='%u'" users
# SQLLog STOR bytes-in-count
# SQLNamedQuery bytes-in-count UPDATE "bytes_in_used=bytes_in_used+%b WHERE userid='%u'" users
# SQLLog STOR files-in-count
# SQLNamedQuery files-in-count UPDATE "files_in_used=files_in_used+1 WHERE userid='%u'" users
</IfModule>