{"id":16852678,"url":"https://github.com/deckarep/chameleon","last_synced_at":"2025-03-18T10:16:57.895Z","repository":{"id":146667884,"uuid":"56194202","full_name":"deckarep/chameleon","owner":"deckarep","description":"A small go webserver that masquerades as other services. For checking healthchecks without having to start lots of real services.","archived":false,"fork":false,"pushed_at":"2016-04-13T23:21:35.000Z","size":3208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T16:35:42.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deckarep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-04-14T00:08:36.000Z","updated_at":"2016-04-14T00:08:38.000Z","dependencies_parsed_at":"2023-04-14T16:14:23.257Z","dependency_job_id":null,"html_url":"https://github.com/deckarep/chameleon","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fchameleon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fchameleon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fchameleon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fchameleon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deckarep","download_url":"https://codeload.github.com/deckarep/chameleon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244198395,"owners_count":20414443,"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-10-13T13:48:13.928Z","updated_at":"2025-03-18T10:16:57.878Z","avatar_url":"https://github.com/deckarep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chameleon\nA small service we can use to emulate healthchecks for other services.\n\n# Usage\nBy default, chameleon will start a webserver on port 8080. Chameleon will handle two types of requests:\n\n## Health Checks\nReachable at `/healthcheck`, will always returns a 200. Normally checked via a Sensu plugin that parses the output to see if something is down enough to page someone.\n\n## Traffic Checks\nReachable at `/traffic_check`. Returns a 200 if healthy, otherwise returns a 400. Returns the same JSON block as above. Intended for use with load balancers.\n\n# Controlling Health\nIf chameleon receives a SIGUSR1, it will flip the \"healthiness\" of the service.\n\nHere's an example:\n```\n[~] curl -s localhost:8080/healthcheck | jq .\n{\n...\n  \"results\": {\n    \"chameleon\": {\n      \"message\": \"null\",\n      \"ok\": false\n    }\n  }\n}\n\n[~] kill -s SIGUSR1 81040\n[~] curl -s localhost:8080/healthcheck | jq .\n{\n...\n  \"results\": {\n    \"chameleon\": {\n      \"message\": \"null\",\n      \"ok\": true\n    }\n  }\n}\n```\n\nAnd here's the chameleon logs for this.\n```\n[~] ./chameleon                                                                                                                                                                            master  ✭ ✱\nRunning as pid 81040\nMasquerade: chameleon\nPort: 8080\nHealthy: false\nMinWait: 0\nMaxWait: 0\nlog1kal-2.local\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:   export GIN_MODE=release\n - using code:  gin.SetMode(gin.ReleaseMode)\n\n[GIN-debug] GET    /healthcheck              --\u003e main.func·002 (3 handlers)\n[GIN-debug] Listening and serving HTTP on :8080\n[GIN] 2016/04/13 - 14:48:10 | 200 |     144.916µs | ::1 |   GET     /healthcheck\nReceived USR1 signal\nMasquerade: chameleon\nPort: 8080\nHealthy: true\nMinWait: 0\nMaxWait: 0\n[GIN] 2016/04/13 - 14:48:32 | 200 |      40.646µs | ::1 |   GET     /healthcheck\n```\n\n# Configuration\nChameleon's configuration is environment based, and accepts the following ENV variables.\n\n| Variable | Description | Type |\n|----------|-------------|------|\n| `CHAMELEON_MASQUERADE` | the service name to masquerade as | string |\n| `CHAMELEON_PORT` | the port to listen on | integer |\n| `CHAMELEON_HEALTHY` | Is the service healthy? | boolean |\n| `CHAMELEON_MINWAIT` | unused | |\n| `CHAMELEON_MAXWAIT` | unused | |\n| `CHAMELEON_VERSION` | What version of the service is running? | string |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeckarep%2Fchameleon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeckarep%2Fchameleon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeckarep%2Fchameleon/lists"}