mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 16:28:40 +00:00
misc: added env support for the other cli flags
This commit is contained in:
@@ -47,12 +47,24 @@ var bootstrapCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
organization, _ := cmd.Flags().GetString("organization")
|
organization, _ := cmd.Flags().GetString("organization")
|
||||||
|
if organization == "" {
|
||||||
|
if envOrganization, ok := os.LookupEnv("INFISICAL_ADMIN_ORGANIZATION"); ok {
|
||||||
|
organization = envOrganization
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if organization == "" {
|
if organization == "" {
|
||||||
log.Error().Msg("organization is required")
|
log.Error().Msg("organization is required")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
domain, _ := cmd.Flags().GetString("domain")
|
domain, _ := cmd.Flags().GetString("domain")
|
||||||
|
if domain == "" {
|
||||||
|
if envDomain, ok := os.LookupEnv("INFISICAL_API_URL"); ok {
|
||||||
|
domain = envDomain
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if domain == "" {
|
if domain == "" {
|
||||||
log.Error().Msg("domain is required")
|
log.Error().Msg("domain is required")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -19,53 +19,60 @@ The `infisical bootstrap` command is used when deploying Infisical in automated
|
|||||||
The command initializes a fresh Infisical instance by creating an admin user, organization, and instance admin machine identity, enabling subsequent programmatic configuration without human intervention.
|
The command initializes a fresh Infisical instance by creating an admin user, organization, and instance admin machine identity, enabling subsequent programmatic configuration without human intervention.
|
||||||
|
|
||||||
<Warning>
|
<Warning>
|
||||||
This command creates an instance admin machine identity with the highest level of privileges. The returned token should be treated with the utmost security, similar to a root credential. Unauthorized access to this token could compromise your entire Infisical instance.
|
This command creates an instance admin machine identity with the highest level
|
||||||
|
of privileges. The returned token should be treated with the utmost security,
|
||||||
|
similar to a root credential. Unauthorized access to this token could
|
||||||
|
compromise your entire Infisical instance.
|
||||||
</Warning>
|
</Warning>
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
|
||||||
<Accordion title="--domain" defaultOpen="true">
|
<Accordion title="--domain" defaultOpen="true">
|
||||||
The URL of your Infisical instance.
|
The URL of your Infisical instance. This can be set using the `INFISICAL_API_URL` environment variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example
|
# Example
|
||||||
infisical bootstrap --domain=https://your-infisical-instance.com
|
infisical bootstrap --domain=https://your-infisical-instance.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This flag is required.
|
||||||
|
|
||||||
This flag is required.
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="--email">
|
<Accordion title="--email">
|
||||||
Email address for the admin user account that will be created. This can be set using the `INFISICAL_ADMIN_EMAIL` environment variable.
|
Email address for the admin user account that will be created. This can be set using the `INFISICAL_ADMIN_EMAIL` environment variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example
|
# Example
|
||||||
infisical bootstrap [email protected]
|
infisical bootstrap [email protected]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This flag is required.
|
||||||
|
|
||||||
This flag is required.
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="--password">
|
<Accordion title="--password">
|
||||||
Password for the admin user account. This can be set using the `INFISICAL_ADMIN_PASSWORD` environment variable.
|
Password for the admin user account. This can be set using the `INFISICAL_ADMIN_PASSWORD` environment variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example
|
# Example
|
||||||
infisical bootstrap --password=your-secure-password
|
infisical bootstrap --password=your-secure-password
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This flag is required.
|
||||||
|
|
||||||
This flag is required.
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="--organization">
|
<Accordion title="--organization">
|
||||||
Name of the organization that will be created within the instance.
|
Name of the organization that will be created within the instance. This can be set using the `INFISICAL_ADMIN_ORGANIZATION` environment variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example
|
# Example
|
||||||
infisical bootstrap --organization=your-org-name
|
infisical bootstrap --organization=your-org-name
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This flag is required.
|
||||||
|
|
||||||
This flag is required.
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
## Response
|
## Response
|
||||||
|
|||||||
Reference in New Issue
Block a user