~fd/finger-ring

8b57b7c5efbfed3f0fe2b8e2f337e428628e0528 — Ersei Saggi 3 months ago d696374
Some semblance of documentation
1 files changed, 79 insertions(+), 2 deletions(-)

M README.md
M README.md => README.md +79 -2
@@ 1,5 1,82 @@
Building statically:
# The Finger Ring

A program that uses [Finger](<https://en.wikipedia.org/wiki/Finger_(protocol)>) to create a web/finger ring.

Try it out:

```
$ finger ersei@ersei.net
```

## Building

Building statically may be desired:

```
$ RUSTFLAGS='-C link-arg=-s' cargo build --release --target x86_64-unknown-linux-musl
```

Otherwise, build as usual for Rust programs.

```
$ cargo build --release
```
RUSTFLAGS='-C link-arg=-s' cargo build --release --target x86_64-unknown-linux-musl

## Configuring

```yaml
listen: '127.0.0.1:10079'
nonexistent: |-
  Hello {addr},
  You tried to finger non-existent user!!!
  Your attempt is logged and sent to C.I.A., K.G.B. and S.I.S.
  Expect a visit soon.

users:
  - name: 'user1'
    next: 'lily@lilysthings.org'
    description: |-
      User Name

      Hello {addr}, this is our dear user user1:
      Login: user1                          Name: User Name
      Directory: /home/user1                Shell: /bin/ksh
      Never logged in.
      No mail.
      Project:
      get computer to do the computer thing
      Plan:
                                                  ___           ___     
           _____        ___           ___        /  /\         /__/\    
          /  /::\      /  /\         /  /\      /  /:/         \  \:\   
         /  /:/\:\    /  /:/        /  /:/     /  /:/           \__\:\  
        /  /:/~/::\  /__/::\       /  /:/     /  /:/  ___   ___ /  /::\ 
       /__/:/ /:/\:| \__\/\:\__   /  /::\    /__/:/  /  /\ /__/\  /:/\:\
       \  \:\/:/~/:/    \  \:\/\ /__/:/\:\   \  \:\ /  /:/ \  \:\/:/__\/
        \  \::/ /:/      \__\::/ \__\/  \:\   \  \:\  /:/   \  \::/     
         \  \:\/:/       /__/:/       \  \:\   \  \:\/:/     \  \:\     
          \  \::/        \__\/         \__\/    \  \::/       \  \:\    
           \__\/                                 \__\/         \__\/    

      THE FINGERING next -> {next}
```

The program will automatically replace `{addr}` and `{next}` with the relevant values.

Change the `listen` parameter to listen on port 79. Do not run this program as root! Instead, set the proper capabilities for the program with a systemd service and CAP_NET_BIND:

```
[Unit]
Description=Finger Ring
Wants=networking.target
After=networking.target

[Service]
User=appliancering
Type=simple
ExecStart=/usr/bin/fingerringd --config /etc/fingerringd/fingerring.yaml
AmbientCapabilities = CAP_NET_BIND_SERVICE

[Install]
WantedBy = multi-user.target
```