Yet Another Cross Clipboard
Go to file
2023-06-14 21:22:05 +02:00
.github/workflows (Fixed) GitHub Actions 2021-04-05 12:09:42 +02:00
assets [ImgBot] Optimize images 2023-01-13 17:01:41 +00:00
cmd Implemented Whitelist checking 2021-06-01 23:03:43 +02:00
internal Use golang-jwt/jwt instead of dgrijalva/jwt-go (![CVE-2020-26160 2021-07-27 12:10:09 +02:00
.deepsource.toml Add .deepsource.toml 2021-05-16 20:59:15 +00:00
.gitignore Updated .gitignore 2021-05-10 15:44:47 +02:00
build.sh oops 2021-05-17 18:12:51 +02:00
CONCEPT.md chore: updated dependencies 2021-09-08 21:17:23 +02:00
docker-compose.yml tty for color 2021-05-15 12:37:53 +02:00
Dockerfile oops fuck 2021-05-17 18:15:06 +02:00
go.mod Bump github.com/gofiber/fiber/v2 from 2.39.0 to 2.43.0 2023-06-14 14:58:30 +00:00
go.sum Bump github.com/gofiber/fiber/v2 from 2.39.0 to 2.43.0 2023-06-14 14:58:30 +00:00
LICENSE cobra init 2021-03-22 13:40:09 +01:00
main.go Implemented encryption (#2) 2021-03-25 14:11:01 +01:00
Makefile Updated Makefile, implemented upx compressing 2021-05-13 20:39:56 +02:00
README.md More Code-Style 2021-05-16 23:22:36 +02:00
swagger.yml Implemented Whitelist checking 2021-06-01 23:03:43 +02:00

Deploy to docker hub (v-tag) | .github/workflows/test.yml | DeepSource

yaxc

YAxC

Yet Another Cross Clipboard

[ 📦 Download | 📚 API-Docs | 🎥 Demo | ⌨️ Usage ]

Introduction

YAxC is my attempt to develop a cross-platform clipboard that is as simple as possible. YAxC consists of two components:

Server

The server was kept very minimalistic and simple:

The server accepts a POST request (text/plain) to any path /{anywhere} (except / and /hash) and stores the sent data there for 5 minutes by default, but this can be changed with the ttl query-parameter. An MD5 hash is then generated and can be retrieved at /hash/{anywhere}.

This hash is used to see if the data has changed on the server. This hash can also be specified during the upload, e.g. if you want to use a different hash method.

For more information, see the 📚 API docs here

🖥 Host Your Own Server

EXAMPLE

$ yaxc serve -b :80
# INFO | Started clipboard-server. Press CTRL-C to stop.

HELP

Usage:
  yaxc serve [flags]

Flags:
  -b, --bind string                 Bind-Address (default ":1332")
  -t, --default-ttl duration        Default TTL (default 1m0s)
  -e, --enable-encryption           Enable Encryption (default true)
  -h, --help                        help for serve
  -x, --max-body-length int         Max Body Length (default 8192)
  -s, --max-ttl duration            Max TTL (default 1h0m0s)
  -l, --min-ttl duration            Min TTL (default 5s)
      --proxy-header string         Proxy Header
  -r, --redis-addr string           Redis Address
      --redis-db int                Redis Database
      --redis-pass string           Redis Password
      --redis-prefix-hash string    Redis Prefix (Hash) (default "yaxc::hash::")
      --redis-prefix-value string   Redis Prefix (Value) (default "yaxc::val::")

Client

The client is a command line interface that provides the following functions:

👉 Send Clipboard (one-time)

EXAMPLE

$ yaxc force push -a mypath [-s mypassword]
# INFO | Sent -> hello wor... -> /mypath
# INFO | 🔐 mypassword
# DBUG | URL: https://yaxc.d2a.io/mypath?secret=mypassword

HELP

Usage:
  yaxc force push [flags]
  
Global Flags:
  -a, --anywhere string   Anywhere Path
  -b, --base64            Use Base64
      --config string     config file (default is $HOME/.yaxc.yaml)
  -S, --hide-secret       Hide Secret
  -U, --hide-url          Hide URL
  -s, --secret string     Encryption Key
      --server string     URL of API-Server (default "https://yaxc.d2a.io")

👈 Receive Data And Paste To Clipboard (one-time)

EXAMPLE

$ yaxc force pull -a mypath [-s mypassword]
# INFO | Read <- hello wor...

HELP

Usage:
  yaxc force pull [flags]

Global Flags:
  -a, --anywhere string   Anywhere Path
  -b, --base64            Use Base64
      --config string     config file (default is $HOME/.yaxc.yaml)
  -S, --hide-secret       Hide Secret
  -U, --hide-url          Hide URL
  -s, --secret string     Encryption Key
      --server string     URL of API-Server (default "https://yaxc.d2a.io")

👈 Receive data and output them (one-time)

EXAMPLE

$ yaxc get -a mypath [-s mypassword]
# Hello world!

HELP

Usage:
  yaxc get [flags]

Flags:
  -a, --anywhere string     Path (Anywhere)
  -h, --help                help for get
  -s, --passphrase string   Encryption Key

♻️ Watch Clipboard (Clipboard Sync)

EXAMPLE

$ yaxc watch -a mypath [-b -s mypassword]
INFO | Started clipboard-watcher. Press CTRL-C to stop.
UPDT | Server <- Hello Wor...

HELP

Usage:
  yaxc watch [flags]

Flags:
  -a, --anywhere string     Path (Anywhere)
  -b, --base64              Use Base64?
  -h, --help                help for watch
      --ignore-client       Ignore Client Updates
      --ignore-server       Ignore Server Updates
  -s, --passphrase string   Encryption Key

Useful aliases

# PUSH
# push clipboard contents (one-time) to /anywhere
alias yfsh='yaxc force push -a anywhere'

# push clipboard contents (one-time) encrypted to /anywhere
alias yfshs='yaxc force push -a anywhere -s secret'

# PULL
# pull clipboard contents (one-time) to /anywhere
alias yfll='yaxc force pull -a anywhere'

# pull encrypted clipboard contents (one-time) to /anywhere
alias yflls='yaxc force pull -a anywhere -s secret'