Skip to content

Instantly share code, notes, and snippets.

@woss
Last active March 1, 2023 19:15
Show Gist options
  • Save woss/8a2e9921729280ce0e07bed459ecd7ef to your computer and use it in GitHub Desktop.
Save woss/8a2e9921729280ce0e07bed459ecd7ef to your computer and use it in GitHub Desktop.
Remote signer setup
COMPOSE_PROJECT_NAME=remote-signer
ENABLE_API_KEY_SUPPORT=true
APPROVED_API_KEY=( UUID4 or anything really as long as this is exported on the sender side )

The keys directory must have these files named exactly like this:

❯ tree .
.
├── docker-compose.yml
├── .env
└── keys
    ├── passphrase
    ├── private.key
    ├── public.key
    └── revocation.cert #not in use

1 directory, 6 files

This you can have in the INIT or as i do in my custom gitpod workspace image.

Remote signer CLI installation:

echo "***** Installing the Remote Signer"
sudo wget --no-verbose https://ipfs.anagolay.network/ipfs/bafybeiarhwobvpvz76iy6clqaf3ub7yc4rvvkydmimh652r2svdaznubrq -O /usr/local/bin/remote-signer

sudo chmod +x /usr/local/bin/remote-signer

git config --global gpg.program "remote-signer"
git config --global commit.gpgsign true
git config --global pull.rebase true

This above will work once you provide following env variables to the gitpod workspace

APPROVED_API_KEY= ( the KEY you created, exported and starte your server with ) 
GIT_REMOTE_SIGN_URL=https://YOUR_IP:49161
GPG_SIGN_KEY=(full length key fingerprint ) # this is NOT PUBLIC KEY, only the fingerprint

If you want to use this in ALL future workspaces do it globally in the User Settings -> Variables.

Important not is that the public key must be uploaded to https://keys.openpgp.org/upload because the CLI will fetch it from there and cache it

This is done like this in the spirit of PKI where you should propagate your public key and the fingerprint

version: "3"
services:
server:
image: woss/remote-signer-server:12d6194
restart: always
env_file: ./.env
volumes:
- ./keys:/keys # the keys
ports:
- 49161:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment