ugosan / vscode-openpgp

This extensions implements OpenPGP in VSCode, allowing you to encrypt and decrypt files using public and private keys.
3 stars 0 forks source link

Running in a devcontainer #10

Closed markNZed closed 1 month ago

markNZed commented 2 months ago

I have .devcontainer/devcontainer.json using "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye", and connecting a volume like

"mounts": [
    "source=${localEnv:HOME}/.vscode/openpgp-keys,target=/home/node/.vscode/openpgp-keys,type=bind" 

I can encrypt a file but get an error when trying to decrypt Error: Error decrypting message: Decryption error but I can decrypt the file from a terminal inside the container (after sudo apt-get install -y gnupg2). Iave the extension running in another project without a devcontainer, It is difficult to understand what the problem might be. Maybe the error message could have more details. Is there a verbose/debug mode I could use to get more information?

markNZed commented 1 month ago

This turns out to be quite complicated. When making a remote connection to a machine by default SSH will not forward the local GPG agent, however it seems VS Code forwards the remote servers agent into the container.