{"id":16781319,"url":"https://github.com/romantomjak/knock-knock","last_synced_at":"2026-06-22T16:32:23.492Z","repository":{"id":64303386,"uuid":"238951445","full_name":"romantomjak/knock-knock","owner":"romantomjak","description":"Utility for obtaining database credentials from Consul and Vault","archived":false,"fork":false,"pushed_at":"2020-05-27T20:15:50.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T23:33:27.738Z","etag":null,"topics":["consul","credentials","database-access","password","utility","vault"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romantomjak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-07T14:59:58.000Z","updated_at":"2020-05-27T20:15:53.000Z","dependencies_parsed_at":"2023-01-15T10:00:48.071Z","dependency_job_id":null,"html_url":"https://github.com/romantomjak/knock-knock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/romantomjak/knock-knock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romantomjak%2Fknock-knock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romantomjak%2Fknock-knock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romantomjak%2Fknock-knock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romantomjak%2Fknock-knock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romantomjak","download_url":"https://codeload.github.com/romantomjak/knock-knock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romantomjak%2Fknock-knock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34657893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consul","credentials","database-access","password","utility","vault"],"created_at":"2024-10-13T07:42:42.118Z","updated_at":"2026-06-22T16:32:23.473Z","avatar_url":"https://github.com/romantomjak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"logo.svg\" alt=\"knock-knock\" title=\"knock-knock\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eUtility for obtaining database credentials from \u003ca href=\"https://github.com/hashicorp/consul\"\u003eConsul\u003c/a\u003e and \u003ca href=\"https://github.com/hashicorp/vault\"\u003eVault\u003c/a\u003e.\u003c/p\u003e\n\n## Getting started\n\n### Installation\n\nDownload and install using go get:\n\n```sh\ngo get -u github.com/romantomjak/knock-knock\n```\n\nor grab a binary from [releases](https://github.com/romantomjak/knock-knock/releases/latest) section!\n\n### Configuration\n\nConfiguration by default is read from `~/.knock-knock.conf`. It is based on the [INI](https://en.wikipedia.org/wiki/INI_file) file format which is rendered by Go [template](https://golang.org/pkg/html/template/).\n\n```ini\n[myservice]\nhost = {{ key \"services/myservice/db/host\" }}\nport = 5432\nusername = {{ with secret \"secret/services/myservice/db\" }}{{ .Data.username }}{{ end }}\npassword = {{ with secret \"secret/services/myservice/db\" }}{{ .Data.password }}{{ end }}\ndbname = {{ key \"services/myservice/db/database\" }}\n```\n\nSections are your service names. They appear on a line by itself, in square\nbrackets ([ and ]). `key` retrieves values from Consul and likewise `secret`\nis for retrieving secrets from Vault.\n\n#### Autocomplete\n\nknock-knock supports configuration section autocomplete. Autocomplete can be\ninstalled or uninstalled by running the following on bash or zsh shells:\n\n```sh\nknock-knock -autocomplete-install\nknock-knock -autocomplete-uninstall\n```\n\n#### Vault K/V version 2 backend\n\nVersion 2 of the K/V backend can retain a configurable number of versions for\neach key. Here's how to access a versioned secret value:\n\n```hcl\npassword = {{ with secret \"secret/services/myservice/db\" }}{{ .Data.data.password }}{{ end }}\n```\n\nNote the nested `.Data.data` syntax when referencing the secret value. For more\ninformation about using the K/V v2 backend, see the [Vault Documentation](https://www.vaultproject.io/docs/secrets/kv/kv-v2/).\n\n### Usage\n\nRunning the application requires you to specify a service name from the\nconfiguration file:\n\n```sh\nexport VAULT_AUTH_GITHUB_TOKEN=\u003cmygithubtoken\u003e\nexport VAULT_ADDR=http://127.0.0.1:8200\nexport CONSUL_HTTP_ADDR=127.0.0.1:8500\n$ knock-knock myservice\nhost = myexampledb.a1b2c3d4wxyz.us-west-2.rds.amazonaws.com\nport = 5432\nusername = awsuser\npassword = awssecretpassword\ndbname = awsdatabase\n```\n\nMagic! :sparkles:\n\n## Contributing\n\nYou can contribute in many ways and not just by changing the code! If you have\nany ideas, just open an issue and tell me what you think.\n\nContributing code-wise - please fork the repository and submit a pull request.\n\n## Credits\n\nLogo made by Ely Wahib from [http://wahib.me](http://wahib.me)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromantomjak%2Fknock-knock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromantomjak%2Fknock-knock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromantomjak%2Fknock-knock/lists"}