Update production configuration for aris-proxy-api. Use when the user asks to update api.env, K8s ConfigMap, or any production configuration on the remote server. Also triggers for related actions like "add config", "modify env", "update cron settings", "change production variables". **连接生产服务器前必须先加载 `login-prod-server` skill** 获取 SSH 方式、环境布局与统一安全基线;本 skill 不再重复连接细节。
Scanned 9/2/2026
Install to Claude Code
npx -y skills add hcd233/aris-proxy-api --skill update-prod-config --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Update Prod Config?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hcd233-update-prod-config)More formats (shields.io, HTML) on the badges page.
---
name: update-prod-config
description: Update production configuration for aris-proxy-api. Use when the user asks to update api.env, K8s ConfigMap, or any production configuration on the remote server. Also triggers for related actions like "add config", "modify env", "update cron settings", "change production variables". **连接生产服务器前必须先加载 `login-prod-server` skill** 获取 SSH 方式、环境布局与统一安全基线;本 skill 不再重复连接细节。
---
# update-prod-config
SSH to the production server and update configuration. 连接方式见 `login-prod-server` skill(域名 `api.lvlvko.top`,禁止裸 IP)。
## SSH Connection
加载 `login-prod-server` skill 获取连接方式与安全基线:
```bash
ssh ubuntu@api.lvlvko.top
```
## Config locations
| Config | Path | Update method |
|--------|------|---------------|
| api.env | `/home/ubuntu/code/aris-proxy-api/env/api.env` | Direct file edit (`echo >>` or `sed -i`) |
| K8s ConfigMap | namespace `aris-proxy-api`, name `aris-proxy-api-config` | `kubectl patch configmap` |
> **重要**:Deployment 通过 `envFrom` 引用 ConfigMap(而非直接读取 api.env),因此 **api.env 和 ConfigMap 必须同步更新**,否则重启后配置不生效。具体流程:先修改 api.env 作为源文件记录,然后 patch ConfigMap,最后滚动重启。
## Updating api.env
`api.env` 是配置文件源码,修改后必须同步到 ConfigMap。
Append new key=value:
```bash
ssh ubuntu@api.lvlvko.top 'echo "NEW_KEY=value" >> /home/ubuntu/code/aris-proxy-api/env/api.env'
```
Modify an existing value (sed in-place):
```bash
ssh ubuntu@api.lvlvko.top "sed -i 's/^EXISTING_KEY=.*/EXISTING_KEY=new-value/' /home/ubuntu/code/aris-proxy-api/env/api.env"
```
Verify:
```bash
ssh ubuntu@api.lvlvko.top 'grep "NEW_KEY\|EXISTING_KEY" /home/ubuntu/code/aris-proxy-api/env/api.env'
```
## Updating K8s ConfigMap
Add a new key:
```bash
ssh ubuntu@api.lvlvko.top 'kubectl patch configmap aris-proxy-api-config -n aris-proxy-api --type merge -p "{\"data\":{\"KEY\":\"value\"}}"'
```
Verify:
```bash
ssh ubuntu@api.lvlvko.top 'kubectl get configmap aris-proxy-api-config -n aris-proxy-api -o jsonpath="{.data}"'
```
## After updating
K8s 不会自动监听到 ConfigMap 变更后热加载环境变量,必须滚动重启使新配置生效:
```bash
ssh ubuntu@api.lvlvko.top 'kubectl rollout restart deployment -n aris-proxy-api'
```
等待 rollout 完成:
```bash
ssh ubuntu@api.lvlvko.top 'kubectl rollout status deployment -n aris-proxy-api --timeout=120s'
```
## Safety rules
1. Always verify the change after applying (`grep` for api.env, `kubectl get configmap` for ConfigMap).
2. Never commit or log the raw server IP address.
3. If you need to check current config before modifying, read it first with `cat` or `kubectl get configmap`.
4. For multi-line or complex config values, echo with single quotes around the value to avoid shell expansion.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!