Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
mk config dir if doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Mar 20, 2018
1 parent 138e7cb commit a733242
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.03.2-dev
18.03.3-dev
6 changes: 6 additions & 0 deletions server/utils.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"os"
"path/filepath"

"github.com/kabukky/httpscerts"
Expand All @@ -10,11 +11,16 @@ import (

// GenerateCerts generates SSL certs for vm-proxy server
func GenerateCerts(host string) error {

home, err := homedir.Dir()
if err != nil {
return errors.Wrap(err, "could not detect users home directory")
}

if _, err := os.Stat(filepath.Join(home, ".vmproxy")); os.IsNotExist(err) {
os.Mkdir(filepath.Join(home, ".vmproxy"), os.ModePerm)
}

certPath := filepath.Join(home, ".vmproxy", "cert.pem")
keyPath := filepath.Join(home, ".vmproxy", "key.pem")

Expand Down

0 comments on commit a733242

Please sign in to comment.