A simple API to request you're public IP
|
squirl
df825e030e
All checks were successful
build / build (push) Successful in 1m51s
|
||
|---|---|---|
| .forgejo/workflows | updated packages and ci version | |
| scripts | User services only run when the user is logged in, thus breaking on headless systems. removed auto updates, as i'm not running online code as root | |
| src | Refactored the getting of environment variables with defaults | |
| .gitignore | Initial commit | |
| Cargo.lock | updated packages and ci version | |
| Cargo.toml | updated packages and ci version | |
| readme.md | User services only run when the user is logged in, thus breaking on headless systems. removed auto updates, as i'm not running online code as root | |
IP finder
An API to get you're ip address.
Installation
To install the API and updater services run cargo build --release --locked && sudo -E ./scripts/service_install.sh.
To uninstall run sudo ./scripts/service_uninstall.sh.
To update run cargo build --release --locked && sudo ./scripts/service_update.sh.
Once installed the services will reference some parts of the repo and build output. Please uninstall before (re)moving or renaming the parent folder, then reinstall.
Environment
| Name | Default value | Description |
|---|---|---|
| LISTEN_ADDRESS | 0.0.0.0:8080 | The address and port the api will be listening on |
| IP_HEADER | X-Real-IP | The header in the request to respond, set to this value for use with nginx |
When installed via the service scripts, the variables are stored in a .env file in the root of the repo.
Documentation
API documentation is found on the endpoint /docs.