CLI account management + Directory refactoring
This commit is contained in:
17
resources/config/store/elastic.toml
Normal file
17
resources/config/store/elastic.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
#############################################
|
||||
# ElasticSearch FTS Store configuration
|
||||
#############################################
|
||||
|
||||
[store."elastic"]
|
||||
type = "elasticsearch"
|
||||
url = "https://localhost:9200"
|
||||
user = "elastic"
|
||||
password = "myelasticpassword"
|
||||
#cloud-id = "my-cloud-id"
|
||||
|
||||
[store."elastic".tls]
|
||||
allow-invalid-certs = true
|
||||
|
||||
[store."elastic".index]
|
||||
shards = 3
|
||||
replicas = 0
|
||||
11
resources/config/store/filesystem.toml
Normal file
11
resources/config/store/filesystem.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
#############################################
|
||||
# File System Blob Store configuration
|
||||
#############################################
|
||||
|
||||
[store."fs"]
|
||||
type = "fs"
|
||||
path = "%{BASE_PATH}%/data/blobs"
|
||||
depth = 2
|
||||
|
||||
[store."fs".purge]
|
||||
frequency = "0 3 *"
|
||||
17
resources/config/store/foundationdb.toml
Normal file
17
resources/config/store/foundationdb.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
#############################################
|
||||
# FoundationDB Store configuration
|
||||
#############################################
|
||||
|
||||
[store."foundationdb"]
|
||||
type = "foundationdb"
|
||||
#path = "/etc/foundationdb/fdb.cluster"
|
||||
|
||||
#[store."foundationdb".transaction]
|
||||
#timeout = "5s"
|
||||
#retry-limit = 10
|
||||
#max-retry-delay = "1s"
|
||||
#machine-id = "stalwart"
|
||||
#data-center-id = "my-datacenter"
|
||||
|
||||
[store."foundationdb".purge]
|
||||
frequency = "0 3 *"
|
||||
37
resources/config/store/mysql.toml
Normal file
37
resources/config/store/mysql.toml
Normal file
@@ -0,0 +1,37 @@
|
||||
#############################################
|
||||
# MySQL Store configuration
|
||||
#############################################
|
||||
|
||||
[store."mysql"]
|
||||
type = "mysql"
|
||||
host = "localhost"
|
||||
port = 3307
|
||||
database = "stalwart"
|
||||
user = "root"
|
||||
password = "password"
|
||||
|
||||
[store."mysql".timeout]
|
||||
wait = "15s"
|
||||
|
||||
#[store."postgresql".pool]
|
||||
#max-connections = 10
|
||||
#min-connections = 5
|
||||
|
||||
#[store."mysql".init]
|
||||
#execute = [
|
||||
# "CREATE TABLE IF NOT EXISTS accounts (name VARCHAR(32) PRIMARY KEY, secret VARCHAR(1024), description VARCHAR(1024), type VARCHAR(32) NOT NULL, quota INTEGER DEFAULT 0, active BOOLEAN DEFAULT 1)",
|
||||
# "CREATE TABLE IF NOT EXISTS group_members (name VARCHAR(32) NOT NULL, member_of VARCHAR(32) NOT NULL, PRIMARY KEY (name, member_of))",
|
||||
# "CREATE TABLE IF NOT EXISTS emails (name VARCHAR(32) NOT NULL, address VARCHAR(128) NOT NULL, type VARCHAR(32), PRIMARY KEY (name, address))"
|
||||
#]
|
||||
|
||||
[store."mysql".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 = ? ORDER BY name ASC"
|
||||
emails = "SELECT address FROM emails WHERE name = ? AND type != 'list' ORDER BY type DESC, address ASC"
|
||||
verify = "SELECT address FROM emails WHERE address LIKE CONCAT('%', ?, '%') 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 CONCAT('%@', ?) LIMIT 1"
|
||||
|
||||
[store."mysql".purge]
|
||||
frequency = "0 3 *"
|
||||
40
resources/config/store/postgresql.toml
Normal file
40
resources/config/store/postgresql.toml
Normal file
@@ -0,0 +1,40 @@
|
||||
#############################################
|
||||
# PostgreSQL Store configuration
|
||||
#############################################
|
||||
|
||||
[store."postgresql"]
|
||||
type = "postgresql"
|
||||
host = "localhost"
|
||||
port = 5432
|
||||
database = "stalwart"
|
||||
user = "postgres"
|
||||
password = "mysecretpassword"
|
||||
|
||||
[store."postgresql".timeout]
|
||||
connect = "15s"
|
||||
|
||||
[store."postgresql".tls]
|
||||
enable = false
|
||||
allow-invalid-certs = false
|
||||
|
||||
#[store."postgresql".pool]
|
||||
#max-connections = 10
|
||||
|
||||
#[store."postgresql".init]
|
||||
#execute = [
|
||||
# "CREATE TABLE IF NOT EXISTS accounts (name TEXT PRIMARY KEY, secret TEXT, description TEXT, type TEXT NOT NULL, quota INTEGER DEFAULT 0, active BOOLEAN DEFAULT 1)",
|
||||
# "CREATE TABLE IF NOT EXISTS group_members (name TEXT NOT NULL, member_of TEXT NOT NULL, PRIMARY KEY (name, member_of))",
|
||||
# "CREATE TABLE IF NOT EXISTS emails (name TEXT NOT NULL, address TEXT NOT NULL, type TEXT, PRIMARY KEY (name, address))"
|
||||
#]
|
||||
|
||||
[store."postgresql".query]
|
||||
name = "SELECT name, type, secret, description, quota FROM accounts WHERE name = $1 AND active = true"
|
||||
members = "SELECT member_of FROM group_members WHERE name = $1"
|
||||
recipients = "SELECT name FROM emails WHERE address = $1 ORDER BY name ASC"
|
||||
emails = "SELECT address FROM emails WHERE name = $1 AND type != 'list' ORDER BY type DESC, address ASC"
|
||||
verify = "SELECT address FROM emails WHERE address LIKE '%' || $1 || '%' 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 = $1 AND l.type = 'list' ORDER BY p.address LIMIT 50"
|
||||
domains = "SELECT 1 FROM emails WHERE address LIKE '%@' || $1 LIMIT 1"
|
||||
|
||||
[store."postgresql".purge]
|
||||
frequency = "0 3 *"
|
||||
15
resources/config/store/redis.toml
Normal file
15
resources/config/store/redis.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
#############################################
|
||||
# Redis Lookup Store configuration
|
||||
#############################################
|
||||
|
||||
[store."redis"]
|
||||
type = "redis"
|
||||
url = "redis://127.0.0.1"
|
||||
#urls = ["redis://192.168.1.1", "redis://192.168.1.1"] # for Redis cluster
|
||||
username = "my_username"
|
||||
password = "secretpassword"
|
||||
timeout = "10s"
|
||||
#retries = 3
|
||||
#max-retry-wait = "1s"
|
||||
#min-retry-wait = "500ms"
|
||||
#read-from-replicas = false
|
||||
17
resources/config/store/rocksdb.toml
Normal file
17
resources/config/store/rocksdb.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
#############################################
|
||||
# RocksDB Store configuration
|
||||
#############################################
|
||||
|
||||
[store."rocksdb"]
|
||||
type = "rocksdb"
|
||||
path = "%{BASE_PATH}%/data"
|
||||
|
||||
[store."rocksdb".settings]
|
||||
min-blob-size = 16834
|
||||
write-buffer-size = 134217728
|
||||
|
||||
#[store."rocksdb".pool]
|
||||
#workers = 10
|
||||
|
||||
[store."rocksdb".purge]
|
||||
frequency = "0 3 *"
|
||||
17
resources/config/store/s3.toml
Normal file
17
resources/config/store/s3.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
#############################################
|
||||
# S3/MinIO Blob Store configuration
|
||||
#############################################
|
||||
|
||||
[store."s3"]
|
||||
type = "s3"
|
||||
bucket = "stalwart"
|
||||
region = "eu-central-1"
|
||||
access-key = "minioadmin"
|
||||
secret-key = "minioadmin"
|
||||
#endpoint = ""
|
||||
#security-token = ""
|
||||
#profile = ""
|
||||
timeout = "30s"
|
||||
|
||||
[store."s3".purge]
|
||||
frequency = "0 3 *"
|
||||
30
resources/config/store/sqlite.toml
Normal file
30
resources/config/store/sqlite.toml
Normal file
@@ -0,0 +1,30 @@
|
||||
#############################################
|
||||
# SQLite Store configuration
|
||||
#############################################
|
||||
|
||||
[store."sqlite"]
|
||||
type = "sqlite"
|
||||
path = "%{BASE_PATH}%/data/index.sqlite3"
|
||||
|
||||
#[store."sqlite".pool]
|
||||
#max-connections = 10
|
||||
#workers = 10
|
||||
|
||||
#[store."sqlite".init]
|
||||
#execute = [
|
||||
# "CREATE TABLE IF NOT EXISTS accounts (name TEXT PRIMARY KEY, secret TEXT, description TEXT, type TEXT NOT NULL, quota INTEGER DEFAULT 0, active BOOLEAN DEFAULT 1)",
|
||||
# "CREATE TABLE IF NOT EXISTS group_members (name TEXT NOT NULL, member_of TEXT NOT NULL, PRIMARY KEY (name, member_of))",
|
||||
# "CREATE TABLE IF NOT EXISTS emails (name TEXT NOT NULL, address TEXT NOT NULL, type TEXT, PRIMARY KEY (name, address))"
|
||||
#]
|
||||
|
||||
[store."sqlite".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"
|
||||
|
||||
[store."sqlite".purge]
|
||||
frequency = "0 3 *"
|
||||
Reference in New Issue
Block a user