-
Notifications
You must be signed in to change notification settings - Fork 13
Design Docs
Guilherme Gwadera edited this page Sep 7, 2020
·
5 revisions
Currently there is no way for an user to set environment variables for their apps if they need to. This feature would enable a new configuration option for the apps, so an user can add, edit, or remove environment variables for an app.
- Add new button in the client frontend that an user can click and then add, edit, or remove environment variables for their app.
- Handle the environment variables modifications through a new API endpoint in the server.
To modify the environment variables for a existing container, we have to recreate the container with the new variables. In summary, the steps are:
- User presses the edit variables button.
- The client queries the server for the container existing environment variables.
- The app environment variables are stored inside the container config file generated by Docker.
- Server queries docker to inspect the container and get the container info back.
- Server filters out the default environment variables like
NODE_ENV
andPORT
, then returns the filtered variables.
- The client shows the input fields to insert or edit the environment variables.
- Display in the same page, modal, or in a new page?
- User presses the update button to send the new environment variables to the server.
- If the container is running, warns the user to confirm that the app will be restarted and asks if it's OK.
- The server stops and removes the existing container.
- The server recreates the container with the new environment variables and starts the container.