Linux and the terminal
ccopy is one small program with nothing to install alongside it. It runs on
any Linux box (Unraid included), on macOS, and inside SSH sessions, where it's
handy for moving keys, configs and command output between machines. Like the
apps, it encrypts clips before they leave and decrypts them when they arrive.
cat ~/.ssh/id_ed25519.pub | ccopy push # send a file
kubectl get pods | ccopy push # send command output
ccopy pull > notes.txt # receive into a file
ccopy pull # print it
ccopy status # what's waiting, and from whom (doesn't fetch it)
ccopy clear # delete it from the server
ccopy name "Build server" # rename this machine (ccopy name shows it)
ccopy logout # sign out, removing this machine from your devices
ccopy update # update ccopy to the latest release
ccopy pull exits with code 3 when nothing is waiting, which is useful in scripts.
Install
Download the one for your machine from the
latest release:
ccopy-linux-amd64 (most PCs and servers), ccopy-linux-arm64 (Raspberry Pi and
other ARM boards), ccopy-macos-arm64 (Apple silicon) or ccopy-macos-amd64
(Intel Macs). For example:
mkdir -p ~/.local/bin
curl -fsSL -o ~/.local/bin/ccopy https://github.com/shifatul-i/CrossCopyPaste/releases/latest/download/ccopy-linux-amd64
chmod +x ~/.local/bin/ccopy
ccopy login
SHA256SUMS.txt on the release has the checksums.
On a Mac, a file downloaded with a browser (rather than
curl) is quarantined: runxattr -d com.apple.quarantine ccopyonce.
Sign in to Cross Copy Paste Cloud
ccopy login # asks for your email and password (the password isn't shown)
ccopy signup # no account yet? opens the sign-up page in your browser
ccopy login signs this machine in as one of your devices, named after it
(ccopy name changes that). Your password never leaves it: it makes the key that
opens your clips, right here. On a full plan it says so: remove a device at
crosscopypaste.com/app, or go Premium.
ccopy logout signs out and removes this machine from your devices, which frees
its place on your plan.
In a script, pipe the email and password in, a line each:
printf '%s\n%s\n' "$EMAIL" "$PASSWORD" | ccopy login.
Or set up with your own server
- In your server's web UI, choose Add device, name this machine, and copy its setup code.
- Run
ccopy setupand paste the code. It isn't shown as you paste, since it holds the key to your clips.
ccopy setup connects once, which uses up the code. (A setup code from the
Cloud's Add device works too.)
Either way, ccopy writes ~/.config/ccopy/config (mode 600) with the server
address, this machine's own token and the content key.
Using the server directly on your network (not through a Cloudflare
Tunnel)? The server then uses its own certificate. ccopy setup downloads it,
shows its SHA-256 fingerprint and asks you to check it against the one in the
server log before trusting it. It's saved as ca.crt next to the config. Or
give it yourself: ccopy setup --ca /path/to/ca.crt (from the server's data
folder).
On Unraid itself
Unraid rebuilds /root and /usr/local/bin at every boot, so keep ccopy and
its config on the flash drive:
mkdir -p /boot/config/ccopy
curl -fsSL -o /boot/config/ccopy/ccopy https://github.com/shifatul-i/CrossCopyPaste/releases/latest/download/ccopy-linux-amd64
install -m 755 /boot/config/ccopy/ccopy /usr/local/bin/ccopy
CCOPY_CONFIG=/boot/config/ccopy/config ccopy setup --ca /mnt/user/appdata/crosscopypaste/ca.crt
echo 'install -m 755 /boot/config/ccopy/ccopy /usr/local/bin/ccopy' >> /boot/config/go
Make its setup code in the web UI opened at the server's local address
(Unraid's WebUI button), so its clips stay on your network. A code made at a
public address through a Cloudflare Tunnel works too, without --ca. ccopy
finds /boot/config/ccopy/config by itself when there's no config in your home
folder.
Update
ccopy update
It checks the latest release,
downloads the file for your system, checks it against the release's
SHA256SUMS.txt, runs it once, and only then replaces itself. On Unraid it
also updates /boot/config/ccopy/ccopy, so the new version stays after a reboot.
If ccopy is somewhere only root can write to, like /usr/local/bin on most
Linux machines, run sudo ccopy update.
ccopy update contacts GitHub only when you run it.
Configuration
~/.config/ccopy/config (or $CCOPY_CONFIG) holds KEY=value lines, written by
ccopy login or ccopy setup:
| Key | |
|---|---|
CCOPY_URL |
The server, https://host[:port]. |
CCOPY_TOKEN |
This machine's own token. A secret. |
CCOPY_KEY |
The key your clips are encrypted with. A secret. |
CCOPY_CA |
The server's own certificate, when you use it directly on your network (relative to the config's folder). |
Config files from the old ccopy script (with a token but no key) don't work any
more: run ccopy setup again.
HTTPS proxies set in HTTPS_PROXY are used. Only the encrypted clip passes
through them.