Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umutbasal/whoami
request, system, environment info web service
https://github.com/umutbasal/whoami
container cpu debug disk environment network rust sysinfo system
Last synced: 3 months ago
JSON representation
request, system, environment info web service
- Host: GitHub
- URL: https://github.com/umutbasal/whoami
- Owner: umutbasal
- License: mit
- Created: 2023-08-18T19:20:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-25T18:18:59.000Z (5 months ago)
- Last Synced: 2024-08-25T19:29:18.490Z (5 months ago)
- Topics: container, cpu, debug, disk, environment, network, rust, sysinfo, system
- Language: Rust
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# whoami
```sh
docker pull umutbasal/whoami:latestdocker run -p 8080:8080 --rm -it --name wh umutbasal/whoami:latest
```## Output
- Request Remote Address
- Request Headers
- Environment Variables
- System Information
- CPU
- Disk
- Memory
- Network
- Hostname
- Users
- OS Information
- Boot Time
- ... (see [sysinfo](https://docs.rs/sysinfo/latest/sysinfo/) crate)### Output types
- JSON
- if `Accept: application/json` header is present
- if user agent is `curl`
- if path or query includes "j" (eg /j, /?j)
- HTML
- default behavior when visiting from browser
- if path or query includes "h" (eg /h, /?h)### Example
```sh
curl http://localhost:8080/ | jq '.sysinfo.host_name'"ubuntu"
``````sh
# best way to work with cli
curl http://localhost:8080/ | yq -P | lessenvironment:
CARGO: /Users/user/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo
CARGO_HOME: /Users/user/.cargo
....
``````sh
# same html view for cli
curl http://localhost:8080/h | lessenvironment
+--------------------------------------+-------------------------------------------------------------------------+
| CARGO | /Users/user/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo |
+--------------------------------------+-------------------------------------------------------------------------+
| CARGO_HOME | /Users/user/.cargo |
+--------------------------------------+-------------------------------------------------------------------------+
...
```![image](https://github.com/umutbasal/whoami/assets/21194079/0712ee8e-c63b-464f-be32-47b2d6bce258)