Add initial tls support
Some checks are pending
/ docker (push) Waiting to run

- Uses certificate and key files provided by admin in config
- Let's Encrypt integration planned, but not even close to working
- Initial HTTP3 Support added
This commit is contained in:
Melody Becker 2025-05-27 14:06:08 +02:00
parent 68d7a5e8c3
commit 9151bfb3be
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
6 changed files with 250 additions and 42 deletions

View file

@ -14,8 +14,10 @@ type ConfigSSL struct {
HandleSSL bool `toml:"handle_ssl"` // Whether Linstrom should handle SSL encryption itself in case of http1/2
// If Linstrom is to handle SSL, whether it should use LetsEncrypt for certificates
UseLetsEncrypt *bool `toml:"use_lets_encrypt"`
// Path to the certificate if Linstrom is to handle SSL while not using LetsEncrypt
// Path to the certificate file (.crt) if Linstrom is to handle SSL while not using LetsEncrypt
CertificateFile *string `toml:"certificate_file"`
// Path to the certificate key file (.key) to handle SSL while not using LetsEncrypt
CertKeyFile *string `toml:"cert_key_file"`
// Mail adress to use in case of using LetsEncrypt
AdminMail *string `toml:"admin_mail"`
}
@ -251,6 +253,14 @@ func (gc *ConfigGeneral) GetFullPublicUrl() string {
return str
}
func (gc *ConfigGeneral) GetFinalPublicPort() int {
if gc.PublicPort != nil {
return *gc.PublicPort
} else {
return gc.PrivatePort
}
}
func (sc *ConfigStorage) BuildPostgresDSN() string {
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%d",