{"id":16301919,"url":"https://github.com/nxadm/ctwrapper","last_synced_at":"2025-09-25T19:57:13.810Z","repository":{"id":57588589,"uuid":"136303076","full_name":"nxadm/ctwrapper","owner":"nxadm","description":"A git wrapper for consul-template","archived":false,"fork":false,"pushed_at":"2020-01-07T11:37:54.000Z","size":4075,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-27T02:41:51.233Z","etag":null,"topics":["consul-template","containers","devops","docker","nomad","vault"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nxadm.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":"2018-06-06T09:09:55.000Z","updated_at":"2020-01-07T11:37:56.000Z","dependencies_parsed_at":"2022-09-15T17:40:11.097Z","dependency_job_id":null,"html_url":"https://github.com/nxadm/ctwrapper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nxadm/ctwrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2Fctwrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2Fctwrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2Fctwrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2Fctwrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nxadm","download_url":"https://codeload.github.com/nxadm/ctwrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2Fctwrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276975602,"owners_count":25738503,"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-09-25T02:00:09.612Z","response_time":80,"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-template","containers","devops","docker","nomad","vault"],"created_at":"2024-10-10T20:55:55.537Z","updated_at":"2025-09-25T19:57:13.790Z","avatar_url":"https://github.com/nxadm.png","language":"Go","readme":"# ctwrapper\n[![Build Status](https://travis-ci.com/nxadm/ctwrapper.svg?branch=master)](https://travis-ci.com/nxadm/ctwrapper)\n\nctwrapper is a small git wrapper to interface with Hashicorp's\n[consul-template](https://github.com/hashicorp/consul-template). The use case\nfor this tool is providing remote configuration and secrets to containers that\nrequire a complex configuration. Many orchestrators and tools, like\nHashicorp's [nomad](https://github.com/hashicorp/nomad), only provide\nmechanisms to provision containers with simple 1-file configuration\nrequirements, e.g. by the\n[template stanza](https://www.nomadproject.io/docs/job-specification/template.html).\n\nAs an alternative, ctwrapper retrieves a git repository with static files and\ntemplates. Templates are passed as arguments to consul-template in order to\nlet consul-template run them and, by example, inject secrets from Vault.\nOptions can be passed to consul-template after \"--\", e.g. \"-exec\" to run the\nactual application. In order to disable Vault support (e.g. when you inject\nsecret by environment variables), pass the \"-vault-renew-token=false\" option\nto consul-template.\n\nIn order to use the\n[consul](https://github.com/hashicorp/consul) and\n[vault](https://github.com/hashicorp/vault) backends you need to define the\nnecessary environment variables (like VAULT_ADDR, VAULT_TOKEN and/or\nCONSUL_TOKEN) or pass the '-consul-addr' and/or '-vault-addr' options to\nconsul-template (as passthrough after the '--'). Consult the\n[consul-template documentation](https://github.com/hashicorp/consul-template)\nfor the parameters for consul-template.\n\nAnonymous and authenticated git cloning is supported through SSH and HTTP(s).\nNext to SSH (where the authentication is done by an SSH agent), HTTP(S) Basic\nAuthentication can use the username/password combination supplied on the command\nline or retrieve the password from Vault. If no authentication is provided,\nthe repo will be retrieved anonymously.\n\nctwrapper, being a wrapper for consul-template, expects the latter to be in the\nPATH or in the working directory. When run from a Docker container, use\n[the exec variant of ENTRYPOINT and not the shell variant](https://docs.docker.com/engine/reference/builder/#entrypoint).\nThis allows ctwrapper to to preserve the signals received by the container and\npass it to consul-template and your application.\n\n## Usage\n\n```\nUsage:\n  ctwrapper [-r \u003cURL\u003e] [-b \u003cbranch\u003e] [-c \u003ccommit\u003e] [-g \u003cgitDepth\u003e] [-d \u003cdir\u003e]\n            [-e \u003cextension\u003e] [-u \u003cgit user\u003e]\n\t\t\t[-p \u003cgit password\u003e | -s \u003cvault path for git password\u003e]\n            [-- \u003cextra consul-template parameters\u003e]\n  ctwrapper [-h]\n  ctwrapper [-v]\n\n\nParameters:\n  -r  | --repo                : Git repo URL.\n  -d  | --dir                 : Directory to download the repo [default: /project].\n  -b  | --branch              : Git branch [default: master]\n  -c  | --commit              : Git commit [default: HEAD].\n  -g  | --git-depth           : Git depth  [default: 0 (unlimited)].\n  -u  | --git-user            : Git HTTPS username (when not using SSH).\n  -p  | --git-password        : Git HTTPS password (when not using SSH).\n  -s  | --git-pass-vault-path : Retrieve the git HTTPS password at Vault path\n                                (including the backend).\n  -e  | --ext                 : Template extension [defaul: .tmpl].\n  -h  | --help                : This help message.\n  -v  | --version             : Version message.\n  --                          : Extra consul-template parameters, e.g. -exec.\n\nBesides the default values when applicable, all the parameters can be\npassed as environment variables by using the full parameter name in capitals\nwithout '-':\nREPO, DIR, BRANCH, COMMIT, GITDEPTH, GITUSER, GITPASSWORD, VAULTPATH, EXT.\n\nWhen both command line parameters and environment variables are defined,\nthe first type take precedence.\n\nFor the Vault parameters used in templates, these are retrieved from\nenvironment values like VAULT_ADDR, VAULT_TOKEN and other VAULT_* variables).\n\nExamples:\n  $ ctwrapper -- \"echo lala\"\n  $ ctwrapper -r git@github.com:nxadm/ctwrapper.git\n  $ ctwrapper -r https://github.com/nxadm/ctwrapper.git -d /var/tmp/project \\\n    -s \"secret/production/third-party/repo-password\"\n  $ ctwrapper -r https://github.com/nxadm/ctwrapper.git -u foo -p bar \\\n    -d /project -- -vault-addr 'https://10.5.32.5:8200 -exec /sbin/my-server\n```\n\nYou may want to set the depth to a low number (e.g.) in order not to\nunnecessarily retrieve the complete history of the repo. The `--commit` and\n`--git-depth` options were included in order to prevent a race condition\nbetween CI systems and git commits. If your setup ensures that the specified\ncommit is the last one, you can set `--git-depth` to 1.\n\nEverything after `--` is directly passed as-is to consul-template. In the most\ncases you'll pass an `-exec` command to consul-template to start your\napplication this way (quote the command).\n\n## Releases\n\nThe creation of binaries found on the\n[releases tab](https://github.com/nxadm/ctwrapper/releases) is completely\nautomated by Travis CI and created from a version tag in the repo. The\nsha512 checkums files can be verified with the output of the\n[Travis build](https://travis-ci.com/nxadm/ctwrapper/branches).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxadm%2Fctwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxadm%2Fctwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxadm%2Fctwrapper/lists"}