Deploy by Docker
GCopy provides a single container image with frontend embedded in the Go binary.
Quick Start
The browser Clipboard API requires HTTPS. The following example uses a self-signed certificate:
# 1. Generate a self-signed certificate
curl -sSL https://raw.githubusercontent.com/llaoj/gcopy/main/scripts/gen-cert.sh | bash
# 2. Start the container
docker run -d \
--name gcopy \
--restart unless-stopped \
-p 3375:3375 \
-v $(pwd)/cert.pem:/cert.pem:ro \
-v $(pwd)/key.pem:/key.pem:ro \
-e GCOPY_APP_KEY=your-secret-key-min-16-chars \
-e GCOPY_TLS_CERT_FILE=/cert.pem \
-e GCOPY_TLS_KEY_FILE=/key.pem \
llaoj/gcopy:latestVisit https://<host>:3375. The browser will warn about the self-signed certificate — proceed to continue.
You can also use a valid certificate or a reverse proxy for HTTPS. See TLS Configuration below.
Configuration
All configuration is done via environment variables with the GCOPY_ prefix.
Rate limiting: GCopy has no built-in rate limiting. If it is exposed to untrusted clients, apply traffic control at the edge (nginx, Istio, sidecar, ...), especially for
POST /api/v1/user/token/generate,POST /api/v1/user/token/verifyandPOST /api/v1/clipboard.
Token Authentication
Users authenticate with an 8-character token.
# docker run equivalent
-e GCOPY_APP_KEY=your-secret-key-min-16-charsTLS (Built-in HTTPS)
GCopy can load certificates to serve HTTPS directly, no reverse proxy needed:
-e GCOPY_TLS_CERT_FILE=/path/to/cert.pem
-e GCOPY_TLS_KEY_FILE=/path/to/key.pem
# Mount the certificate files into the container
-v /path/to/cert.pem:/path/to/cert.pem:ro
-v /path/to/key.pem:/path/to/key.pem:roBoth GCOPY_TLS_CERT_FILE and GCOPY_TLS_KEY_FILE must be set to enable TLS.
Reverse Proxy
Run GCopy with HTTP and let a reverse proxy (Nginx, Caddy, etc.) handle TLS:
-e GCOPY_LISTEN=127.0.0.1:3375
# No TLS environment variables neededConfigure the reverse proxy to forward HTTPS traffic to port 3375.
Environment Variables Reference
| Variable | Description | Default | Required |
|---|---|---|---|
GCOPY_APP_KEY | Encryption key (min 16 characters) | - | Yes |
GCOPY_LISTEN | Listen address | :3375 | No |
GCOPY_TLS_CERT_FILE | TLS certificate file path | - | No |
GCOPY_TLS_KEY_FILE | TLS key file path | - | No |
GCOPY_MAX_CONTENT_LENGTH | Max clipboard size (MiB) | 10 | No |
GCOPY_DEBUG | Debug mode | false | No |