Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/app/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ Currently, you can only set values using string literals, `$PWD`, and `$PATH`. A

### Env From

Env from takes a string or list of strings for loading environment variables into your shells and scripts. Currently it supports loading from two sources: .env files, and Jetify Secrsts.
Env from takes a string for loading environment variables into your shells and scripts. Currently it supports loading from two sources: .env files, and Jetify Secrets.

#### .env Files

You can load environment variables from a `.env` file by adding the path to the file in the `env_from` field. This is useful for loading secrets or other sensitive information that you don't want to store in your `devbox.json`.
You can load environment variables from a `.env` file by adding the path to the file in the `env_from` field (the file must end with `.env`). This is useful for loading secrets or other sensitive information that you don't want to store in your `devbox.json`.

```json
{
Expand All @@ -198,15 +198,15 @@ This will load the environment variables from the `.env` file into your shell wh

#### Jetify Secrets

You can securely load secrets from Jetify Secrets by running `devbox secrets init` and creating a project in Jetify Cloud. This will add the `jetpack-cloud` field to `env_from` in your project.
You can securely load secrets from Jetify Secrets by running `devbox secrets init` and creating a project in Jetify Cloud. This will add the `jetify-cloud` field to `env_from` in your project.

```json
{
"env_from": "jetpack-cloud"
"env_from": "jetify-cloud"
}
```

Note that setting secrets securetly with Jetify Secrets requires a Jetify Cloud account. For more information, see the [Jetify Secrets](/docs/cloud/secrets/) guide.
Note that setting secrets securely with Jetify Secrets requires a Jetify Cloud account. For more information, see the [Jetify Secrets](/docs/cloud/secrets/) guide.

### Shell

Expand Down
5 changes: 3 additions & 2 deletions internal/devbox/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"go.jetpack.io/devbox/internal/devbox/envpath"
"go.jetpack.io/devbox/internal/devbox/generate"
"go.jetpack.io/devbox/internal/devconfig"
"go.jetpack.io/devbox/internal/devconfig/configfile"
"go.jetpack.io/devbox/internal/devpkg"
"go.jetpack.io/devbox/internal/devpkg/pkgtype"
"go.jetpack.io/devbox/internal/envir"
Expand Down Expand Up @@ -1009,9 +1010,9 @@ func (d *Devbox) configEnvs(
}
} else if d.cfg.Root.EnvFrom != "" {
return nil, usererr.New(
"unknown from_env value: %s. Supported value is: %q.",
"unknown env_from value: %s. Supported values are: \"%q\" or a path to a file ending in \".env\"",
d.cfg.Root.EnvFrom,
"jetpack-cloud",
configfile.JetifyCloudEnvFromValue,
)
}
for k, v := range d.cfg.Env() {
Expand Down
4 changes: 3 additions & 1 deletion internal/devconfig/configfile/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"github.com/hashicorp/go-envparse"
)

var JetifyCloudEnvFromValue = "jetify-cloud"

func (c *ConfigFile) IsEnvsecEnabled() bool {
// envsec for legacy. jetpack-cloud for legacy
return c.EnvFrom == "envsec" || c.EnvFrom == "jetpack-cloud" || c.EnvFrom == "jetify-cloud"
return c.EnvFrom == "envsec" || c.EnvFrom == "jetpack-cloud" || c.EnvFrom == JetifyCloudEnvFromValue
}

func (c *ConfigFile) IsdotEnvEnabled() bool {
Expand Down
Loading