updated app data storage and AIO docker setup

This commit is contained in:
2026-08-16 09:24:21 +01:00
parent 5dce9f4bcb
commit 71758786cb
17 changed files with 418 additions and 106 deletions
+10 -4
View File
@@ -31,6 +31,13 @@ type App struct {
Relay *relay.Relay // used by the webmail client's compose/send (see webmail_compose.go)
Cfg *ini.File
ConfigPath string
// Root is the app's working directory at startup (os.Getwd() in main.go) — every
// relative path this package resolves on its own (uploaded cert/key files, the
// ACME data dir, the attachments-path tester) is joined against this, not against
// ConfigPath's own directory, so it always matches how main.go resolves the same
// kind of path (mailstore, attachments, TLS certs) regardless of where -config
// happens to point.
Root string
Logger *toolbox.Logger
SMTPUp func() bool // reports whether the SMTP listeners are currently running
@@ -58,12 +65,11 @@ type App struct {
// filesystem (embed.go), not disk, so no directory paths are needed for them.
// appSecret is loaded by the caller via LoadOrCreateAppSecret, mirroring how
// mailstore's master key is loaded in main.go and threaded in rather than resolved
// internally (both are file paths relative to the app's root working directory,
// which this package doesn't otherwise know).
func New(database *db.DB, dkimMgr *dkim.Manager, mstore *mailstore.Store, acmeMgr, acmeHTTPMgr *acmecert.Manager, relayer *relay.Relay, cfg *ini.File, configPath string, logger *toolbox.Logger, smtpUp func() bool, appSecret []byte) (*App, error) {
// internally (both are file paths relative to root — see the App.Root doc comment).
func New(database *db.DB, dkimMgr *dkim.Manager, mstore *mailstore.Store, acmeMgr, acmeHTTPMgr *acmecert.Manager, relayer *relay.Relay, cfg *ini.File, configPath, root string, logger *toolbox.Logger, smtpUp func() bool, appSecret []byte) (*App, error) {
trustedProxies := parseTrustedProxies(cfg.Section("Server").Key("trusted_proxies").MustString(""), logger)
a := &App{
DB: database, DKIM: dkimMgr, Mailstore: mstore, ACME: acmeMgr, ACMEHTTP: acmeHTTPMgr, Relay: relayer, Cfg: cfg, ConfigPath: configPath, Logger: logger, SMTPUp: smtpUp,
DB: database, DKIM: dkimMgr, Mailstore: mstore, ACME: acmeMgr, ACMEHTTP: acmeHTTPMgr, Relay: relayer, Cfg: cfg, ConfigPath: configPath, Root: root, Logger: logger, SMTPUp: smtpUp,
pgpKeys: newPGPKeyCache(), trustedProxies: trustedProxies, loginLimiter: newIPRateLimiter(20, time.Minute), appSecret: appSecret,
}
if err := a.loadTemplates(); err != nil {