Go to file
Jakub Sokołowski 16bc968e21
cloudflare: handle init failures properly
Otherwise the process explodes with:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x656b1b]

goroutine 1 [running]:
infra-sshfp-cf/cloudflare.(*service).FindHostByName(0xc000436600, {0xc00030c510, 0x18})
	/home/admin/sshfp-generator/cloudflare/service.go:25 +0x15b
main.main()
	/home/admin/sshfp-generator/main.go:89 +0x8d0
exit status 2
```
Due to inability to find the configured zone.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-08-01 18:00:34 +02:00
cloudflare cloudflare: handle init failures properly 2022-08-01 18:00:34 +02:00
config sshfp: added support for calling consul binary directly 2022-07-29 17:08:08 +02:00
consul sshfp: added support for calling consul binary directly 2022-07-29 17:08:08 +02:00
sshfp sshfp-generator: initial commit. 2022-06-24 02:47:20 +02:00
statestore Added configurable storage file + some cosmetic changes 2022-07-27 13:36:51 +02:00
.dockerignore Added Dockerfile and .dockerignore 2022-07-15 18:52:40 +02:00
.gitignore sshfp-generator: initial commit. 2022-06-24 02:47:20 +02:00
Dockerfile Added Dockerfile and .dockerignore 2022-07-15 18:52:40 +02:00
README.md sshfp-generator: New features and fixes 2022-06-27 17:47:07 +02:00
go.mod sshfp: added support for calling consul binary directly 2022-07-29 17:08:08 +02:00
go.sum sshfp: added support for calling consul binary directly 2022-07-29 17:08:08 +02:00
main.go cloudflare: handle init failures properly 2022-08-01 18:00:34 +02:00

README.md

Description

SSHFP Tool is a tool created in Golang to glue Consul DB and Cloudflare.

Main purpose is creating SSHFP records to get rid of "host key verification failed".

Building

go mod -vendor
go build -mod vendor

Usage

Supported env variables: DOMAIN_NAME - Domain name which will be working on CF_TOKEN - CloudFlare Token with write access to above domain HOST_LIVENESS_TIMEOUT - number in seconds after which host is considered as removed and dns records can be deleted

It's possible to create json formatted config file (example in testcfg)

As it has been designed to work with consul watches passing proper .json file to STDIN is required. Ex: cat watches.dump | ./infra-sshfp-cf

Current state

  • CloudFlare integration is fully implemented
  • SSHFP Record creation based on tag in Consul form.
  • Implemented Consul watches integration
  • Implemented logic to manipulate states (merging config, etc)

TODO:

  • A few major changes