Open ottobaer opened 8 months ago
This is a good idea and I am confused, why this hasn't come up earlier. Unfortunately, I am currently flooded with work, so It's going to be a good bit until I can find some time for it. In case you want to get familiar with go a bit, all of the necesarry pieces should be in main.go
.
If you have a go compiler installed, then you should be able to use make build
in order to build the project into the bin/
directory. If you have any questions about the process, feel free to reach out.
Looking at the code a bit more, the preferred solution would probably be
I just had a go at, but it won't compile because of an undefined variable - here I'm a bit lost because of go.
./main.go:131:13: undefined: defaultScheme
make: *** [Makefile:6: build] Error 1
If I understand it right defaultScheme gets declared and set to "https" - I'm missing something here I guess.
defaultScheme, _ := os.LookupEnv("MAILCOW_EXPORTER_SCHEME")
if defaultScheme == "" {
defaultScheme = "https"
flag.StringVar(&scheme, "scheme", defaultScheme, "Default connection scheme. Defaults to the MAILCOW_EXPORTER_SCHEME environment variable or 'https' otherwise")
scheme = defaultScheme
Hi,
Finally got around to take some time to read through the code and learn some go on the way. I created a PR, feel free to look into it when you have time.
Thank You,
Hi,
Since I'm using the docker container on a host that runs the mailcow (api) on an internal IP, it would be nice to be able to declare scheme as a variable, since https it not usable if it's a private IP.
or
I have looked into the sources, but I don't know go well enough to make a pull request.