Skip to content

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

  1. Create local env file to hold the token: cp .env.local.example .env.local
  2. Obtain access token:
    1. Login to Bitwarden
    2. Navigate to 'Secrets Manager' (bottom left of the screen)
    3. Select 'Machine Accounts'
    4. Select 'Local Development'
    5. Click 'Create access token' in the top right corner
    6. Choose a name that identifies who owns it and which machine it is generated for, e.g. 'Morten-Macbook'
    7. Copy the token and paste it into BWS_ACCESS_TOKEN in .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.