Compare commits

..

1 Commits

Author SHA1 Message Date
DerLinkman
2efc4b93cc feat: Extend OpenAPI/Swagger documentation with missing endpoints
- Add 60+ previously undocumented API endpoints
- Add missing POST /api/v1/add/ endpoints (rsetting, filter, global-filter, alias-domain, mailbox-policy, admin, dkim_import, mta-sts, mailbox/template)
- Add missing POST /api/v1/delete/ endpoints (rsetting, filter, alias-domain, mailbox-policy, time_limited_alias, eas_cache, sogo_profile, admin, rlhash, identity-provider)
- Add missing GET /api/v1/get/ endpoints (alias/all, alias-domain/all, relayhost/all, transport/all, rsetting/all, filters/all, bcc/all, recipient_map/all, tls-policy-map/all, oauth2-client/all, app-passwd/all, domain/all, mailbox/all, admin/all, passwordpolicy, status/host, status/container, identity-provider)
- Add missing POST /api/v1/edit/ endpoints (relayhost, transport, rsetting, filter, alias-domain, bcc, recipient_map, tls-policy-map, oauth2-client, app-passwd, admin, passwordpolicy, mta-sts)
- Improve existing endpoint documentation with detailed examples
- Organize endpoints by tags: Rspamd, Filters, Domain Aliases, Policies, Admins, OAuth2, MTA-STS, Configuration, Authentication
- Fix YAML parser errors (removed duplicate cors and identity-provider endpoints)

The documentation now covers ~200 API endpoints, up from ~140.
File size increased from 6,096 to 8,252 lines (+35%).
2025-12-17 11:54:57 +01:00
5 changed files with 2168 additions and 8 deletions

View File

@@ -14,7 +14,6 @@ migrate_config_options() {
FLATCURVE_EXPERIMENTAL
DISABLE_IPv6
ACME_CONTACT
SOGO_URL_ENCRYPTION_KEY
)
for key in "${KEYS[@]}"; do
@@ -63,12 +62,6 @@ migrate_config_options() {
sed -i '/^ACME_CONTACT=.*/d' mailcow.conf
sed -i '/^#ACME_CONTACT=.*/d' mailcow.conf
;;
SOGO_URL_ENCRYPTION_KEY)
echo "Removing ${key} in mailcow.conf (moved to sogo.conf)"
sed -i '/^# SOGo URL encryption key/d' mailcow.conf
sed -i '/^# This key is used to encrypt email addresses within SOGo URLs/d' mailcow.conf
sed -i '/^SOGO_URL_ENCRYPTION_KEY=.*/d' mailcow.conf
;;
esac
fi
done

View File

@@ -43,6 +43,7 @@ adapt_new_options() {
"ALLOW_ADMIN_EMAIL_LOGIN"
"SKIP_HTTP_VERIFICATION"
"SOGO_EXPIRE_SESSION"
"SOGO_URL_ENCRYPTION_KEY"
"REDIS_PORT"
"REDISPASS"
"DOVECOT_MASTER_USER"
@@ -286,6 +287,11 @@ adapt_new_options() {
REDISPASS)
echo "REDISPASS=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c 28)" >> mailcow.conf
;;
SOGO_URL_ENCRYPTION_KEY)
echo '# SOGo URL encryption key (exactly 16 characters, limited to AZ, az, 09)' >> mailcow.conf
echo '# This key is used to encrypt email addresses within SOGo URLs' >> mailcow.conf
echo "SOGO_URL_ENCRYPTION_KEY=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c 16)" >> mailcow.conf
;;
*)
echo "${option}=" >> mailcow.conf
;;

File diff suppressed because it is too large Load Diff

View File

@@ -213,6 +213,7 @@ services:
- ALLOW_ADMIN_EMAIL_LOGIN=${ALLOW_ADMIN_EMAIL_LOGIN:-n}
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
- SOGO_EXPIRE_SESSION=${SOGO_EXPIRE_SESSION:-480}
- SOGO_URL_ENCRYPTION_KEY=${SOGO_URL_ENCRYPTION_KEY:-SOGoSuperSecret0}
- SKIP_SOGO=${SKIP_SOGO:-n}
- MASTER=${MASTER:-y}
- REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-}

View File

@@ -405,6 +405,10 @@ MAILDIR_SUB=Maildir
# SOGo session timeout in minutes
SOGO_EXPIRE_SESSION=480
# SOGo URL encryption key (exactly 16 characters, limited to AZ, az, 09)
# This key is used to encrypt email addresses within SOGo URLs
SOGO_URL_ENCRYPTION_KEY=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c 16)
# DOVECOT_MASTER_USER and DOVECOT_MASTER_PASS must both be provided. No special chars.
# Empty by default to auto-generate master user and password on start.
# User expands to DOVECOT_MASTER_USER@mailcow.local