Skip to content

설정 가이드

SirrMesh는 TOML 형식의 설정 파일을 사용하여 유연하고 읽기 쉬운 설정 옵션을 제공합니다.

설정 파일 위치

기본 설정 파일 경로:

  • Linux: ~/.sirrmeshd/config.toml
  • 커스텀 경로: --config 매개변수를 사용하여 지정

기본 설정

서버 설정

toml
[server]
# 서버 호스트명
hostname = "mail.example.com"

# SMTP 포트
smtp_port = 25
submission_port = 587

# IMAP 포트
imap_port = 143
imaps_port = 993

TLS 설정

toml
[tls]
# Let's Encrypt 인증서 자동 획득
acme = true

# DNS 제공업체 (DNS-01 검증용)
dns_provider = "cloudflare"

# Cloudflare API 토큰
[tls.cloudflare]
api_token = "your-cloudflare-api-token"

데이터베이스 설정

toml
[database]
# 데이터베이스 유형: sqlite, postgres, mysql
type = "postgres"

# PostgreSQL 연결 문자열
dsn = "postgresql://user:password@localhost/sirrchat"

스토리지 설정

toml
[storage]
# 스토리지 유형: local, s3
type = "local"

# 로컬 스토리지 경로
local_path = "/var/mail"

# S3 설정 (S3 사용 시)
[storage.s3]
endpoint = "s3.amazonaws.com"
bucket = "sirrchat-storage"
access_key = "your-access-key"
secret_key = "your-secret-key"

인증 설정

블록체인 인증

toml
[auth.blockchain]
enabled = true

# 지원되는 블록체인 네트워크
networks = ["ethereum", "bsc", "polygon"]

# RPC 엔드포인트
[auth.blockchain.rpc]
ethereum = "https://mainnet.infura.io/v3/YOUR-PROJECT-ID"
bsc = "https://bsc-dataseed.binance.org"

LDAP 인증

toml
[auth.ldap]
enabled = true
server = "ldap://ldap.example.com:389"
bind_dn = "cn=admin,dc=example,dc=com"
bind_password = "password"
user_base = "ou=users,dc=example,dc=com"

보안 설정

DKIM 설정

toml
[dkim]
enabled = true
selector = "default"
private_key_path = "/etc/sirrmeshd/dkim/private.key"

SPF 설정

toml
[spf]
enabled = true
check_incoming = true

속도 제한

toml
[rate_limit]
# 시간당 최대 발송 수
max_emails_per_hour = 100

# 분당 최대 연결 수
max_connections_per_minute = 10

로그 설정

toml
[logging]
# 로그 레벨: debug, info, warn, error
level = "info"

# 로그 형식: text, json
format = "json"

# 로그 출력
output = "/var/log/sirrmeshd/app.log"

고급 설정

성능 조정

toml
[performance]
# 워커 스레드 수
workers = 4

# 데이터베이스 커넥션 풀 크기
db_pool_size = 10

# 캐시 크기 (MB)
cache_size = 256

모니터링 설정

toml
[monitoring]
# Prometheus 메트릭 엔드포인트
metrics_enabled = true
metrics_port = 9090

# 헬스 체크 엔드포인트
health_check_port = 8080

전체 설정 예제

toml
[server]
hostname = "mail.example.com"
smtp_port = 25
submission_port = 587
imap_port = 143
imaps_port = 993

[tls]
acme = true
dns_provider = "cloudflare"

[tls.cloudflare]
api_token = "your-cloudflare-api-token"

[database]
type = "postgres"
dsn = "postgresql://sirrchat:password@localhost/sirrchat"

[storage]
type = "local"
local_path = "/var/mail"

[auth.blockchain]
enabled = true
networks = ["ethereum", "bsc"]

[auth.blockchain.rpc]
ethereum = "https://mainnet.infura.io/v3/YOUR-PROJECT-ID"
bsc = "https://bsc-dataseed.binance.org"

[dkim]
enabled = true
selector = "default"
private_key_path = "/etc/sirrmeshd/dkim/private.key"

[logging]
level = "info"
format = "json"
output = "/var/log/sirrmeshd/app.log"

설정 검증

시작 전 설정 검증:

bash
sirrmeshd config verify

환경 변수

모든 설정은 환경 변수로 재정의할 수 있습니다:

bash
export SIRRCHAT_SERVER_HOSTNAME=mail.example.com
export SIRRCHAT_DATABASE_DSN=postgresql://user:pass@localhost/db

자세한 정보:

Released under the GPL 3.0 License.