{"id":20017583,"url":"https://github.com/foomo/config-bob","last_synced_at":"2025-05-04T22:31:59.098Z","repository":{"id":48674468,"uuid":"47558512","full_name":"foomo/config-bob","owner":"foomo","description":"build configs. mixin secrets.","archived":false,"fork":false,"pushed_at":"2024-05-28T13:45:02.000Z","size":2793,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-08T13:50:00.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foomo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-07T14:55:27.000Z","updated_at":"2024-05-28T13:36:18.000Z","dependencies_parsed_at":"2024-05-28T16:36:13.092Z","dependency_job_id":"488f9d11-d9a3-4ae2-9f91-a5d063910f29","html_url":"https://github.com/foomo/config-bob","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fconfig-bob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fconfig-bob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fconfig-bob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fconfig-bob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foomo","download_url":"https://codeload.github.com/foomo/config-bob/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252408453,"owners_count":21743123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T08:16:22.374Z","updated_at":"2025-05-04T22:31:58.810Z","avatar_url":"https://github.com/foomo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Travis CI](https://travis-ci.org/foomo/config-bob.svg?branch=master)](https://travis-ci.org/foomo/config-bob)\n\n# Bob renders config hierarchies\n\nBob helps you to render directory trees of configurations using [golangs templating engine](http://golang.org/pkg/text/template). He renders recursively over an arbitrary number of directory hierarchies executing all files as templates.\n\nThe result will be written into one target directory.\n\n## Motivation / why config Bob\n\nWe needed a simple tool to populate our app configurations with data and **secrets** to run in docker environments.\n\n## Building\n\n```bash\nconfig-bob build path/to/data.json path/to/src/dir/a path/to/src/dir/b path/to/target/dir\n```\n\n### Bobs template helpers\n\nApart from standard template functions we have added a few extra ones, which should come in handy, when writing configurations:\n\n```\n// secrets helpers\n{{ secret \"secret/path/to/secret.prop\" }}\n\n// combining secrets with escaping might come in handy\n{{ json (secret \"secret/path/to/secret.prop\") }}\n```\n\nData in this example\n\n```go\ndata := map[string]interface{}{\n    \"hello\": \"test\",\n    \"nested\": map[string]string{\n        \"foo\": \"bar\",\n    },\n}\n```\n\n```\n// template dump some yaml into a file\n{{ yaml . }}\n// output\nhello: test\nnested:\n  foo: bar\n\n// template indent sth - yaml in this case\n{{ indent (yaml .) \"  \" }}\n// output\n  hello: test\n  nested:\n    foo: bar\n\n\n// template json\n{{ json . }}\n\n// output\n{\"hello\":\"test\",\"nested\":{\"foo\":\"bar\"}}\n\n// json indented parameters are prefix and indent\n{{ jsonindent . \"////\" \"+++|\" }}\n\n// output - note that there is no prefix in the first line also see https://golang.org/pkg/encoding/json/#MarshalIndent\n{\n////\"hello\": \"test\",\n////+++|\"nested\": {\n////+++|+++|\"foo\": \"bar\"\n////+++|}\n////}\n\n// template substr, which is essentially string slice access\n{{ substr .hello \":2\"}}`\n// output\nte\n\n{{ substr .hello \"1:\"}}`\n// output\nest\n\n{{ substr .hello \"1:2\"}}`\n// output\ne\n\n```\n\nWe expect this list of helpers to grow.\n\n## Updating htpasswd files\n\n```bash\nconfig-bob vault-htpasswd path/to/htpasswd.yml\n```\n\nConfig bob knows how to sync vault with htpasswd files.\n\nExample config file contents:\n\n```yaml\n# example htpasswd.yml\nrelative/path/to/htpasswd-file:\n  - secret/foo\n  - secret/bar\n/absolute/path/to/other/htpasswd-file:\n  - secret/baz\n```\n\nBehaviour:\n\n- creates all necessary folder and files\n- updates existing files with passwords from vault\n- fails, if passwords can not be updated\n- fails, if existing files can not be parsed\n\nHow to add a compatible vault entry:\n\n```bash\nvault write secret/foo user=foo password=secret\n```\n\n## Intergration with [vault](https://vaultproject.io/)\n\nWhen using the secret templating syntax metioned above Bob will be looking up those secrets in a vault server using vault http interface v1.\n\nBob expects the environment variables `VAULT_ADDR` and `VAULT_TOKEN` to be set to know to which vault server to talk to.\n\n### Running a local vault with Bobs help\n\nIf you want to keep your secrets under version control and you do not want to run a vault server permanently config-bob has a little helper for you.\n\n```bash\nconfig-bob vault-local path/to/vault-folder\n```\n\n## Integration with 1Password\n\nWe have added a template helper to get fields from 1Password\n\n```yaml\nsecret-from-1password: {{ op \"name-uuid-or-url-of-entry\" \"field-name\" }}\n```\n\nIn order to make this work follow this document [https://support.1password.com/command-line-getting-started/](https://support.1password.com/command-line-getting-started/)\n\n## Requirements\n\nSo far Bob has been running on OSX and Linux.\n\n- [vault](https://vaultproject.io) tested with Vault v0.3.1, but as long as REST API v1 is there I do not expect\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoomo%2Fconfig-bob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoomo%2Fconfig-bob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoomo%2Fconfig-bob/lists"}