From 62302d19fafab244f8231776fac79023ebf47457 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Sat, 31 Aug 2024 03:47:46 +0700 Subject: [PATCH] README upd --- README.md | 17 +++++++++++++---- docs/API.md | 42 ++++++++++++++++++++++++++++++++++++++++++ docs/BCRYPT.md | 15 --------------- 3 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 docs/API.md delete mode 100644 docs/BCRYPT.md diff --git a/README.md b/README.md index 65d70d0..f80de36 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,11 @@ Lightweight network IP scanner with web GUI > [!WARNING] -> This README is about version 2.0. Version 1.0 can be found in this brunch: [v1](https://github.com/aceberg/WatchYourLAN/tree/v1) - -> [!BREAKING CHANGES] -> Version 2.0 is not compatible with v1.0. For now v2.0 docker images will be released under `v2` tag. It will be tagged `latest` in a few weeks (probably, in October), to give everyone enough time for a smooth migration. +> This is version 2.0. Version 1.0 can be found in this brunch: [v1](https://github.com/aceberg/WatchYourLAN/tree/v1) +> +> Breaking Changes +> +> Version 2.0 is not compatible with v1.0. For now v2.0 docker images will be released under `v2` tag. It will be tagged `latest` in a few weeks (probably, in October). ![Screenshot_1](https://raw.githubusercontent.com/aceberg/WatchYourLAN/main/assets/Screenshot_1.png) @@ -147,6 +148,14 @@ Or use [docker-compose](docker-compose-local.yml) +## API + +
+ Expand + +Moved to [docs/API.md](./docs/API.md) +
+ ## Thanks
Expand diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..c0bbcbb --- /dev/null +++ b/docs/API.md @@ -0,0 +1,42 @@ +## API +```http +GET /api/all +``` +Returns all hosts in `json`. + + +```http +GET /api/history/*mac +``` +Returns all History. If `mac` is not empty, returns only history of a device with this `mac`. + + +```http +GET /api/host/:id +``` +Returns host with this `id` in `json`. + + +```http +GET /api/port/:addr/:port +``` +Gets state of one `port` of `addr`. Returns `true` if port is open or `false` otherwise. +
+ Request example + +```bash +curl http://0.0.0.0:8840/api/port/192.168.2.2/8844 +``` +

+ + +```http +GET /api/edit/:id/:name/*known +``` +Edit host with ID `id`. Can change `name`. `known` is optional, when set to `toggle` will change Known state. + + +```http +GET /api/host/del/:id +``` +Remove host with ID `id`. \ No newline at end of file diff --git a/docs/BCRYPT.md b/docs/BCRYPT.md deleted file mode 100644 index 98285aa..0000000 --- a/docs/BCRYPT.md +++ /dev/null @@ -1,15 +0,0 @@ -# How to encrypt password with bcrypt? - -It is not safe to store password unencrypted, so this app uses `bcrypt` encryption. There are several ways to encrypt your password. - -## 1. Set password through web GUI -Then the app will encrypt it for you. - -## 2. Encrypt password yourself -On Linux encryption can be done with `htpasswd` command: -```sh -htpasswd -nbBC 10 USER YourSecretPassword | sed 's/USER://' -``` - -## 3. Encrypt password online -There are online tools for `bcrypt` encryption. \ No newline at end of file