Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: building and readme outdated #114

Open
ChrisChoke opened this issue May 20, 2022 · 2 comments
Open

docs: building and readme outdated #114

ChrisChoke opened this issue May 20, 2022 · 2 comments

Comments

@ChrisChoke
Copy link

hey there,

i did playing around with certmgr and cfssl to build internal CA for my homelab, and my first impression is : wow, what great toolset!
but i got a bit confusing while reading docs and making own experience with certmgr.

Can anybody explain how to build the binary of certmgr with go tools?! i am using golang 1.18.2.
go get is deprecated and replaced by go install. but go install github.com/cloudflare/certmgr/cmd/...@latest only build version 1.6.5 how to see here.

since i am using the newest version, the "ca" key in my specs.json works fine and a deprecated info will show if i use the "ca" setting under "authority" like here:

certmgr/README.md

Lines 152 to 156 in 4af0d77

"file": {
"path": "/etc/myservice/ca.pem",
"owner": "www-data",
"group": "www-data"
},

so is there a reason why it still in readme.md at the newest version?!
it confused me while get started with this really nice peace of application.

i think the docs thing is not much important, but how to build can help me and other people a lot. hoping for a short explanation.

Chris

@ChrisChoke
Copy link
Author

ChrisChoke commented May 22, 2022

is it possible that v3.0.3 has some issues?!
i downloaded the prebuilded binarys from the release, unzip it and tried to initialize the config directorys with certmgr genconfig
but this is not possible. in v1.6.5 it is possible.

root@sslca:/opt# ./certmgr-linux-amd64-v3.0.3 genconfig 
FATA[0000] Config File "certmgr" Not Found in "[/etc/certmgr]"

edit:

i have playing around and compare some things with version 1.6.5. in version 1.6.5 in root.go:

certmgr/cli/root.go

Lines 115 to 117 in e872f72

if err := viper.ReadInConfig(); err == nil {
log.Info("certmgr: loading from config file ", viper.ConfigFileUsed())
}

and on version 3.0.3 and master:

certmgr/certmgr/cmd/root.go

Lines 171 to 173 in 4af0d77

if err := viper.ReadInConfig(); err != nil {
log.Fatal(err)
}

if i change it to:

if err := viper.ReadInConfig(); err == nil { 
 	log.Fatal(err) 
 } 

the fatal error is gone and i can execute certmgr version, genconfig, help without having the configdir and configfile create before.

i can build binary with:

GOFLAGS=-mod=vendor go build -o /opt/certmgr -gcflags="-trimpath=/home/user/gopath" -ldflags="-X github.com/cloudflare/certmgr/certmgr/cmd.currentVersion=$(git describe --tags)" ./certmgr/

if i changed directory to repo's root dir.

so i am not sure if its right. my progamming knowledge isnt much great :-)
because of that i dont know if i should create a PR.

edit:

okay it is not so much easy :-) after creating configdir and configfile, no command can execute successful

root@sslca:/opt# ./certmgr help
FATA[0000] <nil>                                        
root@sslca:/opt# ./certmgr version
FATA[0000] <nil>                                        
root@sslca:/opt# ./certmgr check
FATA[0000] <nil>                                        
root@sslca:/opt# ./certmgr ensure
FATA[0000] <nil>                                        
root@sslca:/opt# ./certmgr
FATA[0000] <nil>

that is not the solution alone :-)

Chris

@ChrisChoke
Copy link
Author

can this a way to fix that issue?!

ChrisChoke@428234d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant