A Node.js application that fetches secrets from 1Password using the official SDK and encrypts them for use with Renovate.
- Fetches secrets from 1Password using the official 1Password SDK
- Uses modern ES modules and latest JavaScript features
- Encrypts secrets using OpenPGP for Renovate configuration
- Configurable via environment variables
- Node.js 18 or higher
- A 1Password account with a service account token
- A Renovate configuration that requires encrypted secrets
-
Clone this repository:
git clone <repository-url> cd renovate-encrypter -
Install dependencies:
npm install -
Create a
.envfile based on the.env.examplefile:cp .env.example .env -
Edit the
.envfile with your configuration:# 1Password SDK Configuration OP_SERVICE_ACCOUNT_TOKEN=your-service-account-token-here # 1Password Secret Reference # Format: op://vault-name/item-name/field-name OP_SECRET_REFERENCE=op://your-vault/your-item/password # Renovate Configuration RENOVATE_ORG=your-organization RENOVATE_REPO=your-repository-optional # PGP Public Key (replace with your public key) PGP_PUBLIC_KEY="-----BEGIN PGP PUBLIC KEY BLOCK----- ... -----END PGP PUBLIC KEY BLOCK-----"
Run the application:
npm start
The application will:
- Fetch the secret from 1Password using the provided secret reference
- Encrypt the secret using the provided PGP public key
- Output the encrypted value that can be used in your Renovate configuration
This project includes a Dockerfile to run the application in a container:
docker build -t renovate-encrypter .The Docker image reads all configuration from environment variables. You can run it using:
# Using an env file
docker run --env-file .env renovate-encrypterOr by specifying the environment variables directly:
docker run \
-e OP_SERVICE_ACCOUNT_TOKEN=your-token \
-e OP_SECRET_REFERENCE=op://vault/item/field \
-e RENOVATE_ORG=your-organization \
-e RENOVATE_REPO=your-repository \
-e PGP_PUBLIC_KEY="$(cat public-key.asc)" \
renovate-encrypterThe encrypted value will be output to stdout.
- The application uses the 1Password SDK to securely fetch secrets from your 1Password account
- It then encrypts the secret using OpenPGP with the Renovate public key
- The encrypted value is formatted according to Renovate's requirements
- You can use this encrypted value in your Renovate configuration
MIT