Skip to content

Secret files

Jingpeng Wu edited this page Aug 3, 2017 · 1 revision

We have three secret files (one of which is less important) which have to be stored with a precise path.

/secrets/google-secret.json:

{
  "type": "service_account",
  "project_id": "",
  "private_key_id": "",
  "private_key": "-----BEGIN PRIVATE KEY-----
something long here
---END PRIVATE KEY-----\n",
  "client_email": "",
  "client_id": "",
  "auth_uri": "",
  "token_uri": "",
  "auth_provider_x509_cert_url": "",
  "client_x509_cert_url": ""
}

/secrets/aws-secret.json:

{
   "AWS_ACCESS_KEY_ID":"",
   "AWS_SECRET_ACCESS_KEY":""
}

/secrets/boss-secret.json

{
    "protocol": "https",
    "host": "api.theboss.io",
    "token": "TOKEN"
}

Mounting secrets inside your docker container

docker run -it -v /secrets:/secrets tartavull/neuroglancer bash

If you want to run Kubernetes with secrets, consult this link.

Make the credentials available in travis so that tests can be run

tar -czf credentials.tar.gz /secrets/google-secret.json /secrets/aws-secret.json
travis login
travis encrypt-file credentials.tar.gz --add
credentials.tar.gz
git add credentials.tar.gz.enc
git add .travis.yml