{"id":20560321,"url":"https://github.com/andreaskoch/postdeploy","last_synced_at":"2025-09-08T14:44:27.020Z","repository":{"id":57578696,"uuid":"12066383","full_name":"andreaskoch/postdeploy","owner":"andreaskoch","description":"postdeploy is a cross-platform deployment-hook listener written in go","archived":false,"fork":false,"pushed_at":"2016-10-31T22:24:49.000Z","size":106,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T11:07:36.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreaskoch.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":"2013-08-12T21:07:51.000Z","updated_at":"2019-01-23T09:03:13.000Z","dependencies_parsed_at":"2022-09-26T19:11:02.861Z","dependency_job_id":null,"html_url":"https://github.com/andreaskoch/postdeploy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/andreaskoch/postdeploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fpostdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fpostdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fpostdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fpostdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreaskoch","download_url":"https://codeload.github.com/andreaskoch/postdeploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fpostdeploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274201493,"owners_count":25240294,"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-08T02:00:09.813Z","response_time":121,"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-11-16T03:54:13.493Z","updated_at":"2025-09-08T14:44:26.963Z","avatar_url":"https://github.com/andreaskoch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postdeploy\n\npostdeploy is a http service that listens for deployment requests and executes a predefined command when the request arrives\n\n## Build Status\n\n[![Build Status](https://travis-ci.org/andreaskoch/postdeploy.png?branch=master)](https://travis-ci.org/andreaskoch/postdeploy)\n\n## Build\n\nIf you have [go installed](http://golang.org/doc/install) you can build postdeploy yourself:\n\n```bash\ngit clone git@github.com:andreaskoch/postdeploy.git \u0026\u0026 cd postdeploy\nmake\n```\n\nor with `go get`:\n\n```bash\ngo get github.com/andreaskoch/postdeploy\n```\n\n## Docker\n\nYou can also use docker to run postdeploy.\n\n**Build the postdeploy image**:\n\n```\ngit clone git@github.com:andreaskoch/postdeploy.git \u0026\u0026 cd postdeploy\ndocker build -t postdeploy .\n```\n\n**Run the postdeploy image**:\n\n```bash\ndocker run postdeploy\n```\n\n\n## Cross-Compilation\n\nIf you want to cross-compile postdeploy for macOS (amd64), Linux (arm5, arm6, arm7 and amd64) and Windows (amd64) you can use the `crosscompile` action of the make script:\n\n```bash\nmake crosscompile\n```\n\n## Usage\n\nFor running postdeploy you must specify an ip binding (e.g. \"127.0.0.1:80\") and the path to a JSON configurtion file (e.g. \"postdeploy.conf.js\"):\n\n```bash\npostdeploy -binding \":7070\" -config \"postdeploy.conf.js\"\n```\n\npostdeploy will spawn a http server and listen for POST requests to `/deploy/\u003cprovider-name\u003e/\u003croute-name\u003e` and will then execute the commands that have been configured for this route.\n\n## The Configuration File\n\nThe postdeploy configuration has the following JSON structure:\n\n```json\n{\n    \"hooks\": [\n        {\n            \"provider\": \"\u003cprovider-name\u003e\",\n            \"route\": \"some/route\",\n            \"directory\": \"/the/working/directory\",\n            \"commands\": [\n                {\n                    \"name\": \"\u003cSome command\u003e\",\n                    \"args\": [\n                        \"arg1\",\n                        \"arg2\",\n                        \"...\"\n                    ]\n                }\n            ]\n        }\n    ]\n}\n```\n\nAssuming you bind postdeploy to port `7070` a POST request to `http://127.0.0.1:7070/deploy/\u003cprovider-name\u003e/some/route` will execute the command `\u003cSome command\u003e` in the specified directory `/the/working/directory`.\n\n### Examples\n\n#### A simple ping\n\nWrite the current date and time to a log file every time the ping route is executed:\n\n```json\n{\n    \"hooks\": [\n        {\n            \"provider\": \"generic\",\n            \"route\": \"ping\",\n            \"directory\": \"\",\n            \"commands\": [\n                {\n                    \"name\": \"bash\",\n                    \"args\": [\n                        \"-c\",\n                        \"echo $(date) \u003e\u003e ping.log\"\n                    ]\n                }\n            ]\n        }\n    ]\n}\n```\n\n```bash\ncurl -X POST http://127.0.0.1:7070/deploy/generic/ping\n```\n\n### Security\n\n**Do not run this tool on mission critical components!**\n\nI've tried to build the system in a way that the worst thing that could happen is that someone who knows your routes can trigger the deployment hook associated with that route. But this can be bad enough. So please keep in mind that this is just a convenience tool and nothing you should deploy to your production servers.\n\n**Routes**\n\nAs of now there is **no security**. Everybody who knows your configured routes will be able to trigger the action.\n\n**Code Execution**\n\nThe system will only execute the commands specified in the config file and nothing else. Attackers should not be able trigger any other commands than the ones you specified.\n\n## Roadmap\n\n- Providers\n    - Add a github provider\n- Security\n    - Make sure postdeploy executes every hook only once every x seconds.\n    - Block IP addresses that try to find deployment hooks (e.g. block after 3 attempts)\n\n## Contribute\n\nIf you have an idea how to make this little tool better please send me a message or a pull request.\n\nAll contributions are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Fpostdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaskoch%2Fpostdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Fpostdeploy/lists"}