2021-12-05 23:53:32 +00:00
|
|
|
# LookAround
|
2021-12-06 00:17:05 +00:00
|
|
|
"I want to SSH into my laptop, but I keep forgetting its IP!!"
|
2021-12-05 23:53:32 +00:00
|
|
|
|
|
|
|
_Has this ever happened to you?_
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ lookaround client
|
|
|
|
|
|
|
|
Found 3 peers:
|
2021-12-08 02:19:56 +00:00
|
|
|
11:11:11:11:11:11 = 192.168.1.101 `laptop`
|
|
|
|
22:22:22:22:22:22 = 192.168.1.102 `desktop`
|
|
|
|
33:33:33:33:33:33 = 192.168.1.103 `old-laptop`
|
2021-12-05 23:53:32 +00:00
|
|
|
```
|
|
|
|
|
2021-12-09 03:53:27 +00:00
|
|
|
LookAround is a Rust program for looking up your computers' MAC and IP addresses
|
|
|
|
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
|
|
|
|
|
|
|
|
The client uses IP multicast to find servers within the
|
|
|
|
same multicast domain, similar to Avahi and Bonjour.
|
2021-12-05 23:53:32 +00:00
|
|
|
|
2021-12-09 03:53:27 +00:00
|
|
|
Systems self-identify by MAC address and nicknames. Public keys with
|
|
|
|
TOFU semantics are intended before v1.0.0.
|
2021-12-06 00:10:57 +00:00
|
|
|
|
2021-12-05 23:53:32 +00:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
Use the Cargo package manager from [Rust](https://rustup.rs/) to install LookAround.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo install lookaround
|
|
|
|
```
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
To auto-start the server as a normal user.
|
2021-12-05 23:53:32 +00:00
|
|
|
put this systemd unit in `~/.config/systemd/user/lookaround.service`:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[Unit]
|
|
|
|
Description=LookAround
|
|
|
|
|
|
|
|
[Service]
|
2021-12-08 02:19:56 +00:00
|
|
|
ExecStart=/home/user/.cargo/bin/lookaround server --nickname my-desktop
|
2021-12-05 23:53:32 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=default.target
|
|
|
|
```
|
|
|
|
|
|
|
|
Then start the service, check that it's running okay, and enable it for
|
|
|
|
auto-start:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
systemctl --user start lookaround
|
|
|
|
systemctl --user status lookaround
|
|
|
|
systemctl --user enable lookaround
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
2021-12-09 16:50:54 +00:00
|
|
|
Run the server manually: (If you didn't configure auto-start)
|
2021-12-05 23:53:32 +00:00
|
|
|
|
|
|
|
```bash
|
2021-12-09 03:53:27 +00:00
|
|
|
lookaround server --nickname my-desktop
|
2021-12-05 23:53:32 +00:00
|
|
|
```
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
On a client computer:
|
2021-12-09 16:46:55 +00:00
|
|
|
|
|
|
|
```bash
|
2021-12-09 16:50:54 +00:00
|
|
|
# Use the `find-nick` subcommnad to find an IP...
|
2021-12-09 16:46:55 +00:00
|
|
|
lookaround find-nick laptop
|
2021-12-09 16:50:54 +00:00
|
|
|
# Prints `192.168.1.101`
|
2021-12-09 16:46:55 +00:00
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
# Or ping it...
|
2021-12-09 16:46:55 +00:00
|
|
|
ping $(lookaround find-nick laptop)
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
# Or SSH to it...
|
2021-12-09 16:46:55 +00:00
|
|
|
ssh user@$(lookaround find-nick laptop)
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
# Or pull a file from it
|
|
|
|
# (after starting `nc -l -p 9000 < some-file` on the laptop)
|
2021-12-09 16:46:55 +00:00
|
|
|
nc $(lookaround find-nick laptop) 9000
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
# Use the `client` subcommand to find all servers in the same multicast domain
|
2021-12-05 23:53:32 +00:00
|
|
|
lookaround client
|
|
|
|
|
2021-12-09 16:50:54 +00:00
|
|
|
# Use a longer timeout if servers need more than 500 ms to respond
|
2021-12-09 15:34:42 +00:00
|
|
|
lookaround client --timeout-ms 1000
|
|
|
|
```
|
|
|
|
|
2021-12-05 23:53:32 +00:00
|
|
|
## Contributing
|
|
|
|
Pull requests are welcome. This is a hobby project, so I may reject
|
|
|
|
contributions that are too big to review.
|
|
|
|
|
|
|
|
Use the [kazupon Git commit message convention](https://github.com/kazupon/git-commit-message-convention)
|
|
|
|
|
|
|
|
## License
|
|
|
|
[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html)
|
2021-12-05 23:57:42 +00:00
|
|
|
|
|
|
|
## This Git repo
|
|
|
|
This repo's upstream is https://six-five-six-four.com/git/reactor/lookaround.
|
2021-12-08 02:19:56 +00:00
|
|
|
It's mirrored on my GitHub, https://github.com/ReactorScram/lookaround
|
2021-12-07 01:58:12 +00:00
|
|
|
|
|
|
|
I don't use GitHub issues, so issues are in issues.md in the repo.
|