{"id":13451668,"url":"https://github.com/traefik/whoami","last_synced_at":"2025-05-14T22:10:07.738Z","repository":{"id":37705274,"uuid":"42946496","full_name":"traefik/whoami","owner":"traefik","description":"Tiny Go server that prints os information and HTTP request to output","archived":false,"fork":false,"pushed_at":"2025-03-13T14:25:08.000Z","size":68,"stargazers_count":1167,"open_issues_count":19,"forks_count":232,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T18:44:40.963Z","etag":null,"topics":["go","golang","whoami"],"latest_commit_sha":null,"homepage":"https://traefik.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traefik.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,"zenodo":null}},"created_at":"2015-09-22T16:32:22.000Z","updated_at":"2025-04-12T22:21:23.000Z","dependencies_parsed_at":"2025-04-13T18:34:34.013Z","dependency_job_id":"0c38a07d-2fbd-4b62-8c79-11e5c044d3e8","html_url":"https://github.com/traefik/whoami","commit_stats":{"total_commits":70,"total_committers":18,"mean_commits":3.888888888888889,"dds":0.6142857142857143,"last_synced_commit":"f3f17505276a40958d485ce530b695f0a8f35af6"},"previous_names":["containous/whoami"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fwhoami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fwhoami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fwhoami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fwhoami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traefik","download_url":"https://codeload.github.com/traefik/whoami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235701,"owners_count":22036964,"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":["go","golang","whoami"],"created_at":"2024-07-31T07:00:58.578Z","updated_at":"2025-05-14T22:10:02.711Z","avatar_url":"https://github.com/traefik.png","language":"Go","readme":"# whoami\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/traefik/whoami.svg)](https://hub.docker.com/r/traefik/whoami/)\n[![Build Status](https://github.com/traefik/whoami/workflows/Main/badge.svg?branch=master)](https://github.com/traefik/whoami/actions)\n\nTiny Go webserver that prints OS information and HTTP request to output.\n\n## Usage\n\n### Paths\n\n#### `/[?wait=d]`\n\nReturns the whoami information (request and network information).\n\nThe optional `wait` query parameter can be provided to tell the server to wait before sending the response.\nThe duration is expected in Go's [`time.Duration`](https://golang.org/pkg/time/#ParseDuration) format (e.g. `/?wait=100ms` to wait 100 milliseconds).\n\nThe optional `env` query parameter can be set to `true` to add the environment variables to the response.\n\n#### `/api`\n\nReturns the whoami information (and some extra information) as JSON.\n\nThe optional `env` query parameter can be set to `true` to add the environment variables to the response.\n\n#### `/bench`\n\nAlways return the same response (`1`).\n\n#### `/data?size=n[\u0026unit=u]`\n\nCreates a response with a size `n`.\n\nThe unit of measure, if specified, accepts the following values: `KB`, `MB`, `GB`, `TB` (optional, default: bytes).\n\n#### `/echo`\n\nWebSocket echo.\n\n#### `/health`\n\nHeath check.\n\n- `GET`, `HEAD`, ...: returns a response with the status code defined by the `POST`\n- `POST`: changes the status code of the `GET` (`HEAD`, ...) response.\n\n### Flags\n\n| Flag      | Env var              | Description                             |\n|-----------|----------------------|-----------------------------------------|\n| `cert`    |                      | Give me a certificate.                  |\n| `key`     |                      | Give me a key.                          |\n| `cacert`  |                      | Give me a CA chain, enforces mutual TLS |\n| `port`    | `WHOAMI_PORT_NUMBER` | Give me a port number. (default: `80`)  |\n| `name`    | `WHOAMI_NAME`        | Give me a name.                         |\n| `verbose` |                      | Enable verbose logging.                 |\n\n## Examples\n\n```console\n$ docker run -d -P --name iamfoo traefik/whoami\n\n$ docker inspect --format '{{ .NetworkSettings.Ports }}'  iamfoo\nmap[80/tcp:[{0.0.0.0 32769}]]\n\n$ curl \"http://0.0.0.0:32769\"\nHostname :  6e0030e67d6a\nIP :  127.0.0.1\nIP :  ::1\nIP :  172.17.0.27\nIP :  fe80::42:acff:fe11:1b\nGET / HTTP/1.1\nHost: 0.0.0.0:32769\nUser-Agent: curl/7.35.0\nAccept: */*\n```\n\n```console\n# updates health check status\n$ curl -X POST -d '500' http://localhost:80/health\n\n# calls the health check\n$ curl -v http://localhost:80/health\n*   Trying ::1:80...\n* TCP_NODELAY set\n* Connected to localhost (::1) port 80 (#0)\n\u003e GET /health HTTP/1.1\n\u003e Host: localhost:80\n\u003e User-Agent: curl/7.65.3\n\u003e Accept: */*\n\u003e \n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 500 Internal Server Error\n\u003c Date: Mon, 16 Sep 2019 22:52:40 GMT\n\u003c Content-Length: 0\n```\n\n```console\ndocker run -d -P -v ./certs:/certs --name iamfoo traefik/whoami --cert /certs/example.cert --key /certs/example.key\n```\n\n```yml\nversion: '3.9'\n\nservices:\n  whoami:\n    image: traefik/whoami\n    command:\n       # It tells whoami to start listening on 2001 instead of 80\n       - --port=2001\n       - --name=iamfoo\n```\n","funding_links":[],"categories":["Go","命令行工具","Docker"],"sub_categories":["Observability"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fwhoami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraefik%2Fwhoami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fwhoami/lists"}