Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Cloak env variables in Docker definition .yaml files #82

Open
akulmehta opened this issue Mar 8, 2023 · 5 comments
Open

Comments

@akulmehta
Copy link

akulmehta commented Mar 8, 2023

Very nice extension. It would be great if the extension could also cloak the environment variables in .yaml files.

@motdotla
Copy link
Member

Interesting. @akulmehta, can you share an example .yaml file like that?

@akulmehta
Copy link
Author

akulmehta commented Mar 22, 2023

Below is an example of the .yaml file:

runtime: php
env: flex
  document_root: public
skip_files:
  - .env
env_variables: # the values for fields under this heading would be sensitive information like the DB information
  APP_ENV: local
  APP_DEBUG : true
  DB_CONNECTION: mysql
  DB_HOST: localhost
  DB_DATABASE: instance_id
  DB_USERNAME: database_user_name
  DB_PASSWORD: database_password
beta_settings:
  setting1: project:cloud-instance

The nested fields are indicated by indentation and the environment variables are put under the heading of env_variables for this case, however it can be different for different applications/pipelines.

@motdotla
Copy link
Member

What frameworks or languages use this .yaml approach? I'm just curious before we start work on this. Why not just use a .env file?

@akulmehta
Copy link
Author

@motdotla .yaml is used in Docker for containerized apps and serverless apps. Docker in turn is used by several frameworks and apps for deployment.

@motdotla
Copy link
Member

I see. You're using environment variables inside a docker yaml definition file.

Optionally, you could reference a .env file from there instead. We recommend this because it is safer and also more flexible (you can now swap in different .env files and manage them from a secrets manager like dotenv-vault or others)

version: '3.8'
services:
  my-service:
    image: your-image
    env_file:
      - .env

BUT I acknowledge this is also a common and convenient way to define them. I've done it myself many times.

We'll consider this feature as others request it as well. It would be nice to have.

@motdotla motdotla changed the title Feature Request: Cloak env variables in .yaml files Feature Request: Cloak env variables in Docker definition .yaml files Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants