Skip to content

Commit

Permalink
rename ca cert
Browse files Browse the repository at this point in the history
Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp>
  • Loading branch information
YZ775 committed Oct 11, 2023
1 parent 3590be5 commit 686ecd5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mtest/ignitions/worker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
passwd: passwd.yml
files:
- /etc/hostname
- /etc/sabakan/neco.crt
- /etc/sabakan/sabakan-tls-ca.crt
networkd:
- 10-eth0.network
systemd:
Expand Down
2 changes: 1 addition & 1 deletion pkg/sabakan-cryptsetup/cmd/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Driver struct {
// It may return nil when the serial code of the machine cannot be identified,
// or sabakanURL is not valid.
func NewDriver(sabakanURL, cipher string, keySize int, tpmdev string, disks []Disk) (*Driver, error) {
crt, err := os.ReadFile("/etc/sabakan/neco.crt")
crt, err := os.ReadFile(opts.caCert)
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/sabakan-cryptsetup/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
defaultTPMDev = "/dev/tpm0"
defaultCipher = "aes-xts-plain64"
defaultKeySize = 512
defaultCACert = "/etc/sabakan/sabakan-tls-ca.crt"
)

var opts struct {
Expand All @@ -22,6 +23,7 @@ var opts struct {
tpmdev string
keySize int
excludes []string
caCert string
}

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -71,10 +73,11 @@ func init() {
if sabaURL == "" {
sabaURL = defaultSabakanURL
}

rootCmd.Flags().StringVar(&opts.sabakanURL, "server", sabaURL, "URL of sabakan server")
rootCmd.Flags().StringVar(&opts.tpmdev, "tpmdev", defaultTPMDev, "device file path of tpm")
rootCmd.Flags().StringVar(&opts.cipher, "cipher", defaultCipher, "cipher specification")
rootCmd.Flags().IntVar(&opts.keySize, "keysize", defaultKeySize, "key size in bits")
rootCmd.Flags().StringArrayVar(&opts.excludes, "excludes", nil, `disk name patterns to be excluded, e.g. "nvme*"`)
rootCmd.Flags().StringVar(&opts.caCert, "cert", defaultCACert, "location of sabakan CA certificate")

}
1 change: 0 additions & 1 deletion web/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func newTestServer(m sabakan.Model) *Server {
_, ipnet, _ := net.ParseCIDR("192.0.2.1/24")
u, _ := url.Parse(testMyURL)
us, _ := url.Parse(testMyURLHTTPS)

return NewServer(m, "", "", u, us, []*net.IPNet{ipnet}, false, nil, false)
}

Expand Down

0 comments on commit 686ecd5

Please sign in to comment.