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

Add support for environment variables #34

Closed
Angelmmiguel opened this issue Nov 21, 2022 · 1 comment · Fixed by #42
Closed

Add support for environment variables #34

Angelmmiguel opened this issue Nov 21, 2022 · 1 comment · Fixed by #42
Assignees
Labels
🚀 enhancement New feature or request

Comments

@Angelmmiguel
Copy link
Contributor

Environment variables will be configured in TOML files. Every worker will define its own set of environment variable, which will be accessible only for them.

As a tentative API, we will include a new .env resource in the TOML config file:

name = "test"
version = "1"

[env]
MY_ENV_VAR = "Testing!"

Then, the environment variables will be passed to the inner modules via WASI. The environment variables will be accessible via default env methods from the different languages.

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Nov 21, 2022
@Angelmmiguel Angelmmiguel self-assigned this Nov 23, 2022
@Angelmmiguel
Copy link
Contributor Author

We will be able to inject environments variables by using setting the variable value to $XXX:

name = "test"
version = "1"

[env]
TOKEN = "$TOKEN"
MY_ENV_VAR = "VALUE"

In the future, we may add a more complete definition of variables. However, for now we will go with a single section to keep it simple.

name = "test"
version = "1"

[env]
MY_ENV_VAR = "VALUE"

[env.from]
environment = ["TOKEN"]
dotenv = ".env"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant