FNNDSC / ChRIS_store

Backend for ChRIS plugin apps store
MIT License
11 stars 19 forks source link

Swift storage service has hardcoded secrets. These must be possible to pass in to the Swift container as env variables. #20

Closed jbernal0019 closed 3 years ago

jennydaman commented 3 years ago

Related repo: https://github.com/FNNDSC/docker-swift-onlyone

Task: allow the user and password of swift service to be customized, preferably using docker secrets. https://docs.docker.com/engine/swarm/secrets/

Docker secrets are (text) files made securely visible to containers under /run/secret/<name>. Example:

version: '3.7'

services:
  swift:
    image: fnndsc/docker-swift-onlyone:latest
    init: true
    ports:
      - "8080:8080"
    volumes:
      - swift_storage:/srv
    environment:
      SWIFT_CREDENTIALS_FILE: /run/secret/swift-credentials
    secrets:
      - swift-credentials
    restart: unless-stopped

secrets:
  swift-credentials:
    file: ./my-swift-credentials.env

Example ./my-swift-credentials.env

SWIFT_USERNAME=myusername:password5
SWIFT_KEY=mycoolkey
zrthxn commented 3 years ago

I'd like to try this one to get started with the backend if you think it's beginner friendly.

jennydaman commented 3 years ago

It'll be a challenge, but doable in 1-7 days after getting acquainted with the code. You should be familiar with Linux and Docker if you want to take this task.

Start here: https://github.com/FNNDSC/docker-swift-onlyone/blob/master/swift/dispersion.conf