{"id":17134138,"url":"https://github.com/fernandes/caco","last_synced_at":"2025-10-06T12:54:27.893Z","repository":{"id":48730422,"uuid":"222715594","full_name":"fernandes/caco","owner":"fernandes","description":"Caco, The Frog 🐸","archived":false,"fork":false,"pushed_at":"2025-08-09T11:57:16.000Z","size":1163,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T12:54:27.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fernandes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-19T14:30:40.000Z","updated_at":"2025-08-09T11:57:20.000Z","dependencies_parsed_at":"2024-05-03T22:38:30.366Z","dependency_job_id":"4328726a-432d-47c8-bcc5-946c0b676139","html_url":"https://github.com/fernandes/caco","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fernandes/caco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Fcaco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Fcaco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Fcaco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Fcaco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandes","download_url":"https://codeload.github.com/fernandes/caco/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandes%2Fcaco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278614462,"owners_count":26015967,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2024-10-14T19:43:59.697Z","updated_at":"2025-10-06T12:54:27.859Z","avatar_url":"https://github.com/fernandes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caco\n\nConfigure your machines like you develop your web apps\n\n## Usage aka Control Repo\n\nTo start using `Caco`, you need a control repo, that is where you add your node config files, keys, certs, whatever makes sense to you.\n\nCreate a new `Gemfile` with `bundle init` and add to it:\n\n```ruby\ngem 'caco'\n```\n\nAfter you can add your config files under `nodes` folder, with each file being the hostname of your machines:\n\n```\nnodes/\n  web.example.com.rb\n  db.example.com.rb\n```\n\nThis is the minimum you need to start using Caco, a hello world example would be, in `nodes/\u003chostname\u003e.rb` add\n\n```ruby\nCaco.file \"/root/hello.txt\",\n  content: \"Hello World From Caco :)\"\n```\n\nSync your control repo to your remote machine and run `./bin/caco` inside its folder, it will create the `/root/hello.txt` file with `Hello World From Caco :)` content\n\n## Data\n\nIt's useful to share data between your nodes, you can do this on the `data` folder, you can add yaml files and access inside your config files.\n\nIt also has a hierarchy, most specific values overwrite more generic value, files from common to specific are:\n\n- data/common.yaml\n- data/\u003cos_name\u003e.yaml\n- data/\u003cos_name\u003e/\u003cdistro_name\u003e.yaml\n- data/nodes/\u003chostname\u003e.yaml\n\nYou can also encrypt values with your keys, for the first time you can create them with `eyaml createkeys` command, you add the files:\n\n- keys/private_key.pkcs7.pem\n- keys/public_key.pkcs7.pem\n\nAfter that you can edit your yaml files with the command `eyaml edit path/to/file.yaml`\n\nIt's safe to commit your encrypted yaml files, but remember to never commit your keys, the `keys` folder is also on gitignore.\n\nOn your server you also need to sync the `keys` folder to be able to read the values when configuring the nodes.\n\nTo read the values, as they are organized as yaml files, considering the structure:\n\n```yaml\n# common.yaml\n---\nprefix:\n  name: Common\n```\n\n```yaml\n# nodes/hostname.yaml\n---\nprefix:\n  name: Hostname\n```\n\n(as node file is more specific it overwrites the common.yaml value)\n\n```ruby\nCaco::Facter.(\"prefix\", \"name\")\n# =\u003e 'Hostname'\n```\n\n## Configuration\n\nCaco configuration can be set using environment variables, all variables should have the prefix `CACO_`, eg. to change the `LOG_FILE` value, use `CACO_LOG_FILE=/path/to/caco.log`\n\nSee a better description to each config option after the list\n\n- `INTERACTIVE_WRITES` : Ask what action should take when changing an existing file\n- `LOG_FILE` : Path to log file\n\n### INTERACTIVE_WRITES\n\nThis is useful to understand how Caco is executing, on the images we have an example when file is being changed. The second one if after is confirmed to change the file\n\n![Caco Interactive Writes Asking for Operation](./docs/images/interactive_write_ask.jpg)\n![Caco Interactive Writes After Confirmation](./docs/images/interactive_write_ask.jpg)\n\n### LOG_FILE\n\nBy default we log to `/var/log/caco.log`, but sometimes you maybe want to log to a different location, so here is the place to point to your destination\n\n## Roadmap\n\n- [ ] Bootstrap control repo via CLI\n- [ ] Sync remote control repo\n- [ ] Run automatically from developer machine\n- [ ] Add operations to run as a _health check_ after the config process to ensure it's working as expected (that can also be used as acceptance test in development environment)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Caco project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fernandes/caco/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandes%2Fcaco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandes%2Fcaco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandes%2Fcaco/lists"}