Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
  • Loading branch information
marceloneppel committed Aug 16, 2024
1 parent f8ea05c commit d3d2434
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion microceph/ceph/configwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ auth allow insecure global id reclaim = false
[client.radosgw.gateway]
rgw init timeout = 1200
rgw frontends = beast{{if or (ne .rgwPort 0) (not .sslCertificatePath) (not .sslPrivateKeyPath)}} port={{.rgwPort}}{{end}}{{if and .sslCertificatePath .sslPrivateKeyPath}} ssl_private_key={{.sslPrivateKeyPath}} ssl_port={{.sslPort}}{{end}}
rgw frontends = beast{{if or (ne .rgwPort 0) (not .sslCertificatePath) (not .sslPrivateKeyPath)}} port={{.rgwPort}}{{end}}{{if and .sslCertificatePath .sslPrivateKeyPath}} ssl_port={{.sslPort}} ssl_certificate={{.sslCertificatePath}} ssl_private_key={{.sslPrivateKeyPath}}{{end}}
`)),
configFile: "radosgw.conf",
configDir: configDir,
Expand Down
13 changes: 11 additions & 2 deletions microceph/ceph/rgw.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ceph
import (
"context"
"database/sql"
"encoding/base64"
"fmt"
"github.com/canonical/microceph/microceph/constants"
"github.com/canonical/microceph/microceph/interfaces"
Expand All @@ -21,12 +22,20 @@ func EnableRGW(s interfaces.StateInterface, port int, sslPort int, sslCertificat
sslPrivateKeyPath := ""
if sslCertificate != "" && sslPrivateKey != "" {
sslCertificatePath = filepath.Join(pathConsts.SSLFilesPath, "server.crt")
err := writeFile(sslCertificatePath, sslCertificate, 0755)
decodedSSLCertificate, err := base64.StdEncoding.DecodeString(sslCertificate)
if err != nil {
return err
}
err = writeFile(sslCertificatePath, string(decodedSSLCertificate), 0755)
if err != nil {
return err
}
sslPrivateKeyPath = filepath.Join(pathConsts.SSLFilesPath, "server.key")
err = writeFile(sslPrivateKeyPath, sslPrivateKey, 0755)
decodedSSLPrivateKey, err := base64.StdEncoding.DecodeString(sslPrivateKey)
if err != nil {
return err
}
err = writeFile(sslPrivateKeyPath, string(decodedSSLPrivateKey), 0755)
if err != nil {
return err
}
Expand Down

0 comments on commit d3d2434

Please sign in to comment.