Updating Secrets
Updating Secrets
To update a secret in NocoDB, use the nc-secret-mgr package. Do these steps:
Using the Command Line Interface (CLI)
-
If the
nc-secret-mgrpackage is not installed, install it. Run this command in your terminal:npm install -g nc-secret-mgr -
To update a secret, run this command:
NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-mgr update --prev <previous-secret> --new <new-secret>OR
NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-mgr <previous-secret> <new-secret>Replace
<previous-secret>with the name of the secret that you used before. Replace<new-secret>with the new value of the secret. -
The command updates the secret in NocoDB.
Using Executables
You can also use the nc-secret-mgr executable to update secrets.
-
Download the
nc-secret-mgrexecutable from the NocoDB Github. -
Run the executable with this command:
NC_DB="pg://host:port?u=user&p=password&d=database" ./nc-secret-mgr-macos-arm64 update --prev <previous-secret> --new <new-secret>Replace
<previous-secret>with the name of the secret that you used before. Replace<new-secret>with the new value of the secret. -
The command updates the secret in NocoDB.
Note: All environment variables are supported, including NC_DB, NC_DB_JSON, NC_DB_JSON_FILE, DATABASE_URL, and DATABASE_URL_FILE. Use any of these variables to specify your database connection. You can also use the equivalent CLI parameters in this table.
| Environment Variable | CLI Parameter |
|---|---|
NC_DB | --nc-db |
NC_DB_JSON | --nc-db-json |
NC_DB_JSON_FILE | --nc-db-json-file |
DATABASE_URL | --database-url |
DATABASE_URL_FILE | --database-url-file |
Last updated on