Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
psidex committed Jul 21, 2023
1 parent e42f30d commit d648a9b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ipmon

[![client-ci](https://github.com/psidex/ipmon/actions/workflows/client.yml/badge.svg)](https://github.com/psidex/ipmon/actions/workflows/client.yml)
[![server-ci](https://github.com/psidex/ipmon/actions/workflows/server.yaml/badge.svg)](https://github.com/psidex/ipmon/actions/workflows/server.yaml)

A super simple app and web server to monitor my LANs public IP and notify me of a renewal using a forwardable text.

## Client
Expand All @@ -10,7 +13,7 @@ Currently the Dockerfile and GitHub action are tailored for an ARM64 build (to r
cd ~
git clone https://github.com/psidex/ipmon.git
cd ipmon
docker build -t psidex/ipmon:latest .
docker build -t psidex/ipmon:latest Dockerfile.client
cd /your/working/directory
cp ~/ipmon/ipmon.env .
vi ipmon.env
Expand All @@ -21,3 +24,20 @@ docker run -d --name ipmon \
-v $(pwd)/ipmon.cache:/app/ipmon.cache \
psidex/ipmon:latest
```

## Server

A web server that replies with the value of (in order of enumeration):
- X-Real-Ip
- X-Forwarded-For
- Connection IP

```bash
cd ~
git clone https://github.com/psidex/ipmon.git
cd ipmon
docker build -t psidex/ipmon-server:latest Dockerfile.server
docker run -d --name ipmon-server \
--restart unless-stopped \
psidex/ipmon-server:latest
```
4 changes: 1 addition & 3 deletions src/bin/ipmon-server.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use std::net::SocketAddr;

use axum::{extract::ConnectInfo, http::header::HeaderMap, routing::get, Router};

use ipmon::platform;

#[tokio::main]
async fn main() {
simple_logger::init_with_level(log::Level::Info).unwrap();

// build our application with a route
let app = Router::new().route("/", get(handler));

let ip = match platform::is_debug() {
Expand Down

0 comments on commit d648a9b

Please sign in to comment.