netboard

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

README

Netboard

Netboard is a client/server application that allows to share your clipboard between different devices. It works by deploying a server, then running client on your devices to sync the clipboard.

The server uses chunked http encoding to push data to client, and while it is easier to handle the client part with the netboard client, it's perfectly possible to integrate it with anything else, like good old curl.

NOTE: netboard is NOT multi tenant. While it is possible to add it if there is any interest in the matter, for now it just assumes that anyone connecting with a valid certificate is willing to get its clipboard synchronized with the rest of the instance.

Installation

Getting the software

Using Go:

go install git.sr.ht/~primalmotion/netboard@latest

The software is also packaged for Arch Linux and derivatives from the AUR:

yay -S netboard-git
Certificates

Netboard uses mutual TLS to authenticate the clients. This is not optional, and you must generate several certificates:

  • one certificate for the server (https)
  • one certificate authority for the clients
  • as many client certificates signed by the CA as you have devices.

You can generate certificates with the tool you like. This example will use tg.

First, we will generate the server certificate. You need to know in advance the hostname or IP the server will use.

tg cert --name netboard-server --dns my.netboard.com --ip 127.0.0.1

NOTE: You can sign that certificate with a CA you maintain, or get a certificate from let's encrypt.

Then we will create the CA needed to authenticate the users:

tg cert --is-ca --name netboard-client-ca

And finally client certificates:

tg cert \
  --signing-cert netboard-client-ca-cert.pem \
  --signing-cert-key netboard-client-ca-key.pem \
  --auth-client \
  --name my-laptop

tg cert \
  --signing-cert netboard-client-ca-cert.pem \
  --signing-cert-key netboard-client-ca-key.pem \
  --auth-client \
  --name my-phone

NOTE: don't reuse the same certificate over several devices as the fingerprint will be used to prevent sending back data you just sent, resulting in a update larsen.

Server

Copy over the netboard-server-cert.pem and netboard-server-key.pem, as well as the netboard-client-ca-cert.pem to the machine hosting the server. We will put them in /etc/netboard. Then write a config.yaml file with the following content:

server:
  cert: /etc/netboard/netboard-server-cert.pem
  key: /etc/netboard/netboard-server-key.pem
  client-ca: /etc/netboard/netboard-client-ca-cert.pem

Then run the server:

netboard server
Clients

Copy the client certificate to the appropriate devices, in ~/.config/netboard, then write a config.yaml file with the following content:

listen:
  url: https://my.netboard.com:8989
  cert: $HOME/.config/netboard/my-laptop-cert.pem
  cert-key: $HOME/.config/netboard/my-laptop-key.pem

Then run the client:

netboard listen

Repeat the process for every other clients you want to have all their clipboard synced.

Modes

The netboard client can run using 2 modes, controlled by the --mode flag:

  • lib: Uses native clipboard management libraries. This requires CGO and only works partially under Wayland
  • wl-clipboard: Uses wl-copy and wl-paste utilities to handle the clipboard. This only works under Wayland.

More modes may come, as well as a smart way to choose the best for the current platform.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL