CLI account management + Directory refactoring
This commit is contained in:
17
resources/config/directory/internal.toml
Normal file
17
resources/config/directory/internal.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
#############################################
|
||||
# Internal Directory configuration
|
||||
#############################################
|
||||
|
||||
[directory."internal"]
|
||||
type = "internal"
|
||||
store = "sqlite"
|
||||
|
||||
[directory."internal".options]
|
||||
catch-all = true
|
||||
#catch-all = { map = "(.+)@(.+)$", to = "info@${2}" }
|
||||
subaddressing = true
|
||||
#subaddressing = { map = "^([^.]+)\.([^.]+)@(.+)$", to = "${2}@${3}" }
|
||||
|
||||
[directory."internal".cache]
|
||||
entries = 500
|
||||
ttl = {positive = '1h', negative = '10m'}
|
||||
@@ -2,46 +2,51 @@
|
||||
# LDAP Directory configuration
|
||||
#############################################
|
||||
|
||||
[directory."default"]
|
||||
[directory."ldap"]
|
||||
type = "ldap"
|
||||
address = "ldap://localhost:389"
|
||||
base-dn = "dc=example,dc=org"
|
||||
|
||||
[directory."default".bind]
|
||||
[directory."ldap".bind]
|
||||
dn = "cn=serviceuser,ou=svcaccts,dc=example,dc=org"
|
||||
secret = "mysecret"
|
||||
|
||||
[directory."default".cache]
|
||||
[directory."ldap".bind.auth]
|
||||
enable = false
|
||||
dn = "cn=?,ou=svcaccts,dc=example,dc=org"
|
||||
|
||||
[directory."ldap".tls]
|
||||
enable = false
|
||||
allow-invalid-certs = false
|
||||
|
||||
[directory."ldap".cache]
|
||||
entries = 500
|
||||
ttl = {positive = '1h', negative = '10m'}
|
||||
|
||||
[directory."default".options]
|
||||
[directory."ldap".options]
|
||||
catch-all = true
|
||||
#catch-all = { map = "(.+)@(.+)$", to = "info@${2}" }
|
||||
subaddressing = true
|
||||
#subaddressing = { map = "^([^.]+)\.([^.]+)@(.+)$", to = "${2}@${3}" }
|
||||
superuser-group = "superusers"
|
||||
|
||||
[directory."default".pool]
|
||||
[directory."ldap".pool]
|
||||
max-connections = 10
|
||||
min-connections = 0
|
||||
max-lifetime = "30m"
|
||||
idle-timeout = "10m"
|
||||
connect-timeout = "30s"
|
||||
|
||||
[directory."default".filter]
|
||||
[directory."ldap".pool.timeout]
|
||||
create = "30s"
|
||||
wait = "30s"
|
||||
recycle = "30s"
|
||||
|
||||
[directory."ldap".filter]
|
||||
name = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(uid=?))"
|
||||
email = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(|(mail=?)(mailAlias=?)(mailList=?)))"
|
||||
verify = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(|(mail=*?*)(mailAlias=*?*)))"
|
||||
expand = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(mailList=?))"
|
||||
domains = "(&(|(objectClass=posixAccount)(objectClass=posixGroup))(|(mail=*@?)(mailAlias=*@?)))"
|
||||
|
||||
[directory."default".object-classes]
|
||||
user = "posixAccount"
|
||||
group = "posixGroup"
|
||||
|
||||
[directory."default".attributes]
|
||||
[directory."ldap".attributes]
|
||||
name = "uid"
|
||||
type = "objectClass"
|
||||
description = ["principalName", "description"]
|
||||
secret = "userPassword"
|
||||
groups = ["memberOf", "otherGroups"]
|
||||
|
||||
@@ -2,54 +2,55 @@
|
||||
# In-Memory Directory configuration
|
||||
#############################################
|
||||
|
||||
[directory."default"]
|
||||
[directory."memory"]
|
||||
type = "memory"
|
||||
|
||||
[directory."default".options]
|
||||
[directory."memory".options]
|
||||
catch-all = true
|
||||
#catch-all = { map = "(.+)@(.+)$", to = "info@${2}" }
|
||||
subaddressing = true
|
||||
#subaddressing = { map = "^([^.]+)\.([^.]+)@(.+)$", to = "${2}@${3}" }
|
||||
superuser-group = "superusers"
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "admin"
|
||||
type = "admin"
|
||||
description = "Superuser"
|
||||
secret = "changeme"
|
||||
email = ["postmaster@%{DEFAULT_DOMAIN}%"]
|
||||
member-of = ["superusers"]
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "john"
|
||||
type = "individual"
|
||||
description = "John Doe"
|
||||
secret = "12345"
|
||||
email = ["john@%{DEFAULT_DOMAIN}%", "jdoe@%{DEFAULT_DOMAIN}%", "john.doe@%{DEFAULT_DOMAIN}%"]
|
||||
email-list = ["info@%{DEFAULT_DOMAIN}%"]
|
||||
member-of = ["sales"]
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "jane"
|
||||
type = "individual"
|
||||
description = "Jane Doe"
|
||||
secret = "abcde"
|
||||
email = ["jane@%{DEFAULT_DOMAIN}%", "jane.doe@%{DEFAULT_DOMAIN}%"]
|
||||
email-list = ["info@%{DEFAULT_DOMAIN}%"]
|
||||
member-of = ["sales", "support"]
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "bill"
|
||||
type = "individual"
|
||||
description = "Bill Foobar"
|
||||
secret = "$2y$05$bvIG6Nmid91Mu9RcmmWZfO5HJIMCT8riNW0hEp8f6/FuA2/mHZFpe"
|
||||
quota = 50000000
|
||||
email = ["bill@%{DEFAULT_DOMAIN}%", "bill.foobar@%{DEFAULT_DOMAIN}%"]
|
||||
email-list = ["info@%{DEFAULT_DOMAIN}%"]
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "sales"
|
||||
type = "group"
|
||||
description = "Sales Team"
|
||||
|
||||
[[directory."default".principals]]
|
||||
[[directory."memory".principals]]
|
||||
name = "support"
|
||||
type = "group"
|
||||
description = "Support Team"
|
||||
|
||||
[directory."default".lookup]
|
||||
domains = ["%{DEFAULT_DOMAIN}%"]
|
||||
|
||||
@@ -2,39 +2,22 @@
|
||||
# SQL Directory configuration
|
||||
#############################################
|
||||
|
||||
[directory."default"]
|
||||
[directory."sql"]
|
||||
type = "sql"
|
||||
address = "sqlite://%{BASE_PATH}%/data/accounts.sqlite3?mode=rwc"
|
||||
store = "sqlite"
|
||||
|
||||
[directory."default".options]
|
||||
[directory."sql".options]
|
||||
catch-all = true
|
||||
#catch-all = { map = "(.+)@(.+)$", to = "info@${2}" }
|
||||
subaddressing = true
|
||||
#subaddressing = { map = "^([^.]+)\.([^.]+)@(.+)$", to = "${2}@${3}" }
|
||||
superuser-group = "superusers"
|
||||
|
||||
[directory."default".pool]
|
||||
max-connections = 10
|
||||
min-connections = 0
|
||||
#idle-timeout = "10m"
|
||||
|
||||
[directory."default".cache]
|
||||
[directory."sql".cache]
|
||||
entries = 500
|
||||
ttl = {positive = '1h', negative = '10m'}
|
||||
|
||||
[directory."default".query]
|
||||
name = "SELECT name, type, secret, description, quota FROM accounts WHERE name = ? AND active = true"
|
||||
members = "SELECT member_of FROM group_members WHERE name = ?"
|
||||
recipients = "SELECT name FROM emails WHERE address = ?"
|
||||
emails = "SELECT address FROM emails WHERE name = ? AND type != 'list' ORDER BY type DESC, address ASC"
|
||||
verify = "SELECT address FROM emails WHERE address LIKE '%' || ? || '%' AND type = 'primary' ORDER BY address LIMIT 5"
|
||||
expand = "SELECT p.address FROM emails AS p JOIN emails AS l ON p.name = l.name WHERE p.type = 'primary' AND l.address = ? AND l.type = 'list' ORDER BY p.address LIMIT 50"
|
||||
domains = "SELECT 1 FROM emails WHERE address LIKE '%@' || ? LIMIT 1"
|
||||
|
||||
[directory."default".columns]
|
||||
name = "name"
|
||||
description = "description"
|
||||
secret = "secret"
|
||||
email = "address"
|
||||
quota = "quota"
|
||||
[directory."sql".columns]
|
||||
type = "type"
|
||||
secret = "secret"
|
||||
description = "description"
|
||||
quota = "quota"
|
||||
|
||||
Reference in New Issue
Block a user