Skip to content

Commit 6e342fe

Browse files
committed
docs: manage prod secrets
1 parent da58810 commit 6e342fe

2 files changed

Lines changed: 4 additions & 108 deletions

File tree

docs/distribution/devops/add_secrets_to_production.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/developer_tool_chain/manage_prod_secrets.md renamed to docs/distribution/devops/manage_prod_secrets.md

Lines changed: 4 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ The ABI platform supports multiple secret management approaches with a clear pri
1212

1313
Secrets are automatically loaded from NAAS and local files into environment variables at runtime, ensuring seamless access across your application.
1414

15-
## Quick Start (TL;DR)
15+
## TL;DR
1616

1717
### Retrieve Secrets from Production
1818
```bash
1919
# Get current production secrets
20-
./cli secrets naas get-base64-env --naas-api-key='your_naas_api_key'
20+
./cli secrets naas get-base64-env --naas-api-key='your_naas_api_key' > .env.prod
2121
```
2222

2323
### Push New Secrets to Production
@@ -27,59 +27,7 @@ Secrets are automatically loaded from NAAS and local files into environment vari
2727
./cli secrets naas push-env-as-base64 --naas-api-key='your_naas_api_key'
2828
```
2929

30-
## Detailed Usage
31-
32-
### Prerequisites
33-
34-
- **NAAS API Key**: Obtain from your NAAS account dashboard
35-
- **Environment File**: Create or update `.env.prod` with your secrets
36-
- **CLI Access**: Ensure the `./cli` script is executable
37-
38-
### Available Commands
39-
40-
#### 1. List All Secrets
41-
View all secrets stored in NAAS without revealing their values:
42-
43-
```bash
44-
./cli secrets naas list --naas-api-key='your_naas_api_key'
45-
```
46-
47-
**Options:**
48-
- `--naas-api-url`: Custom NAAS API URL (default: `https://api.naas.ai`)
49-
50-
#### 2. Retrieve Secrets from NAAS
51-
Download and display all secrets from the NAAS secret store:
52-
53-
```bash
54-
./cli secrets naas get-base64-env \
55-
--naas-api-key='your_naas_api_key' \
56-
--naas-secret-name='abi_secrets' \
57-
--naas-api-url='https://api.naas.ai'
58-
```
59-
60-
**Options:**
61-
- `--naas-api-key`: Your NAAS API authentication key (required)
62-
- `--naas-secret-name`: Name of the secret collection (default: `abi_secrets`)
63-
- `--naas-api-url`: NAAS API endpoint (default: `https://api.naas.ai`)
64-
65-
#### 3. Push Secrets to NAAS
66-
Upload your local environment file to NAAS as base64-encoded secrets:
67-
68-
```bash
69-
./cli secrets naas push-env-as-base64 \
70-
--naas-api-key='your_naas_api_key' \
71-
--env-file='.env.prod' \
72-
--naas-secret-name='abi_secrets' \
73-
--naas-api-url='https://api.naas.ai'
74-
```
75-
76-
**Options:**
77-
- `--naas-api-key`: Your NAAS API authentication key (required)
78-
- `--env-file`: Path to environment file (default: `.env.prod`)
79-
- `--naas-secret-name`: Name for the secret collection (default: `abi_secrets`)
80-
- `--naas-api-url`: NAAS API endpoint (default: `https://api.naas.ai`)
81-
82-
### Environment File Format
30+
## Environment File Format
8331

8432
Your `.env.prod` file should follow standard environment variable format:
8533

@@ -141,45 +89,4 @@ ABI_API_KEY=your_api_key
14189
- **Backup before changes**: Always retrieve current secrets before pushing updates
14290
- **Test in staging**: Validate secret changes in non-production environments first
14391
- **Monitor deployments**: Check application logs after secret updates
144-
- **Rollback plan**: Keep previous secret versions for quick recovery
145-
146-
## Troubleshooting
147-
148-
### Common Issues
149-
150-
#### Authentication Errors
151-
```bash
152-
Error: Unauthorized (401)
153-
```
154-
**Solution**: Verify your NAAS API key is correct and has not expired.
155-
156-
#### Secret Not Found
157-
```bash
158-
Error: Secret 'abi_secrets' not found
159-
```
160-
**Solution**: Use `list` command to see available secrets or create the secret first.
161-
162-
#### Environment File Not Found
163-
```bash
164-
Error: File '.env.prod' not found
165-
```
166-
**Solution**: Ensure the file exists or specify the correct path with `--env-file`.
167-
168-
#### Network Connectivity
169-
```bash
170-
Error: Connection timeout
171-
```
172-
**Solution**: Check internet connectivity and verify the NAAS API URL is accessible.
173-
174-
### Getting Help
175-
176-
For additional support:
177-
1. Check the [NAAS documentation](https://docs.naas.ai)
178-
2. Review the [ABI deployment guide](../distribution/devops/deploy_api_to_production.md)
179-
3. Use `./cli secrets --help` for command-specific help
180-
181-
## Related Documentation
182-
183-
- [Deploy API to Production](../distribution/devops/deploy_api_to_production.md)
184-
- [Add Secrets to Production](../distribution/devops/add_secrets_to_production.md)
185-
- [Managing Dependencies](manage_dependencies.md)
92+
- **Rollback plan**: Keep previous secret versions for quick recovery

0 commit comments

Comments
 (0)