updated app data storage and AIO docker setup
This commit is contained in:
+10
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user