mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-23 10:26:44 +00:00
GODT-1779: Remove go-imap
This commit is contained in:
88
internal/vault/types.go
Normal file
88
internal/vault/types.go
Normal file
@ -0,0 +1,88 @@
|
||||
package vault
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/updater"
|
||||
)
|
||||
|
||||
type Data struct {
|
||||
Settings Settings
|
||||
Users []UserData
|
||||
Cookies []byte
|
||||
Certs Certs
|
||||
}
|
||||
|
||||
type Certs struct {
|
||||
Bridge Cert
|
||||
Installed bool
|
||||
}
|
||||
|
||||
type Cert struct {
|
||||
Cert, Key []byte
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
GluonDir string
|
||||
|
||||
IMAPPort int
|
||||
SMTPPort int
|
||||
IMAPSSL bool
|
||||
SMTPSSL bool
|
||||
|
||||
UpdateChannel updater.Channel
|
||||
UpdateRollout float64
|
||||
|
||||
ColorScheme string
|
||||
ProxyAllowed bool
|
||||
ShowAllMail bool
|
||||
Autostart bool
|
||||
AutoUpdate bool
|
||||
|
||||
LastVersion *semver.Version
|
||||
FirstStart bool
|
||||
FirstStartGUI bool
|
||||
}
|
||||
|
||||
// UserData holds information about a single bridge user.
|
||||
// The user may or may not be logged in.
|
||||
type UserData struct {
|
||||
UserID string
|
||||
Username string
|
||||
|
||||
GluonID string
|
||||
GluonKey []byte
|
||||
BridgePass string
|
||||
|
||||
AuthUID string
|
||||
AuthRef string
|
||||
KeyPass []byte
|
||||
|
||||
EventID string
|
||||
HasSync bool
|
||||
}
|
||||
|
||||
func newDefaultSettings(gluonDir string) Settings {
|
||||
return Settings{
|
||||
GluonDir: gluonDir,
|
||||
|
||||
IMAPPort: 1143,
|
||||
SMTPPort: 1025,
|
||||
IMAPSSL: false,
|
||||
SMTPSSL: false,
|
||||
|
||||
UpdateChannel: updater.DefaultUpdateChannel,
|
||||
UpdateRollout: rand.Float64(),
|
||||
|
||||
ColorScheme: "",
|
||||
ProxyAllowed: true,
|
||||
ShowAllMail: true,
|
||||
Autostart: false,
|
||||
AutoUpdate: true,
|
||||
|
||||
LastVersion: semver.MustParse("0.0.0"),
|
||||
FirstStart: true,
|
||||
FirstStartGUI: true,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user