Access secrets
All CustomOffice secrets are stored in Bitwarden.
To make your local development able to pull relevant secrets, you must obtain an access token.
Generate token¶
- Create local env file to hold the token:
cp .env.local.example .env.local - Obtain access token:
- Login to Bitwarden
- Navigate to 'Secrets Manager' (bottom left of the screen)
- Select 'Machine Accounts'
- Select 'Local Development'
- Click 'Create access token' in the top right corner
- Choose a name that identifies who owns it and which machine it is generated for, e.g. 'Morten-Macbook'
- Copy the token and paste it into
BWS_ACCESS_TOKENin.env.local
If you do not have access to the 'Secrets Manager' page in Bitwarden, ask a colleague to generate it for you.
Test¶
Test that it works:
docker run --rm --env-file .env.local ghcr.io/bitwarden/bws secret list c1788d05-2a72-431c-aa93-b46b005db8f1
This should print out a list of secrets.