https://github.com/johnmccabe/public-ip-watcher
https://github.com/johnmccabe/public-ip-watcher
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnmccabe/public-ip-watcher
- Owner: johnmccabe
- Created: 2022-02-17T10:26:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T02:35:49.000Z (about 3 years ago)
- Last Synced: 2025-03-19T07:59:43.104Z (over 1 year ago)
- Language: Go
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# public-ip-watcher
Keeps track of changes to your public IP by polling Cloudflares icanhazip endpoint.
Exposes two endpoints.
```
$ http localhost:8080/latest
{
"Addr": "11.22.33.01",
"Created": "2022-01-01 01:02:03"
}
```
```
$ http localhost:8080/history
[
{
"Addr": "44.55.66.01",
"Created": "2022-02-13 04:05:06"
},
{
"Addr": "11.22.33.01",
"Created": "2022-01-01 01:02:03"
}
]
```
## Building
Build a local binary with;
```
make
```
And a container image with (update the container tag as needed in the Makefile);
```
make image
```
## Running
Local binary;
```
./ipwatcher
```
In docker;
```
docker run --rm --name ipwatcher -p 8080:8080 -v db:/db johnmccabe/ipwatcher:dev
```