🔄 卡若AI 同步 2026-02-22 05:25 | 更新:金仓、卡木、总索引与入口、运营中枢工作台 | 排除 >20MB: 5 个

This commit is contained in:
2026-02-22 05:25:29 +08:00
parent ca73aadce8
commit bcfab416dd
9 changed files with 358 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ kr宝塔: qcWubCdlfFjS2b2DMT1lzPFaDfmv1cBT
### 强制规则(每次执行必守)
1. **SSH 统一配置**三台宝塔一律用端口 **22022**账号 **ckb**、密码 **zhiqun1984**;直接连接,无需密钥
1. **SSH 统一配置**:账号 **root**、密码 **Zhiqun1984**Z 大写),端口 22022 或 22或使用 id_ed25519 密钥。详见 `references/SSH登录方式与故障排查.md`
2. **经验沉淀**:每次涉及服务器/宝塔/部署的操作结束后,必须把经验写入 `02_卡人/水溪_整理归档/经验库/待沉淀/`,防止同类问题重复出现。
3. **Skill 迭代**:每次有新的配置、教训、流程变更时,必须同步更新本 SKILL.md 或 references保证下次调用时信息一致。
4. **卡若AI 复盘**每次任务结束必须用卡若AI 复盘格式收尾(目标·结果·达成率、过程、反思、总结、下一步)。
@@ -75,6 +75,15 @@ kr宝塔: qcWubCdlfFjS2b2DMT1lzPFaDfmv1cBT
python3 "/Users/karuo/Documents/个人/卡若AI/01_卡资/金仓_存储备份/服务器管理/脚本/快速检查服务器.py"
```
### 1.0a 腾讯云 API 重启宝塔 + IP 封禁处理
```bash
# 重启存客宝、kr宝塔会解除 fail2ban 内存封禁)
python3 "01_卡资/金仓_存储备份/服务器管理/scripts/腾讯云_宝塔服务器重启.py"
```
IP 解封:见 `references/SSH登录方式与故障排查.md` § 六。优化单行:`IP="公网IP"; for j in sshd ssh-iptables; do fail2ban-client set "$j" unbanip "$IP" 2>/dev/null; done`
### 1.1 磁盘臃肿 · 全方位检查与清理SSH/API 不可用时)
当 SSH 或宝塔 API 无法远程连接时,在**宝塔面板 → 终端**执行:

View File

@@ -103,14 +103,32 @@ bash "01_卡资/金仓_存储备份/服务器管理/scripts/kr宝塔_SS
"01_卡资/金仓_存储备份/服务器管理/scripts/kr宝塔_node项目批量修复.py"
```
## 六、服务器端可做(解除限流
## 六、IP 封禁处理(多方案 + 优化命令
若本机被 fail2ban 封禁,可在**宝塔面板 → 终端**或 VNC 执行:
### 6.1 腾讯云 API 重启(解除 fail2ban 内存封禁)
重启会清空 fail2ban 等进程内存,封禁自动解除。本机执行:
```bash
# 查看是否被 ban
fail2ban-client status sshd
# 解封本机 IP将 211.156.92.72 换成你的公网 IP
fail2ban-client set sshd unbanip 211.156.92.72
python3 "01_卡资/金仓_存储备份/服务器管理/scripts/腾讯云_宝塔服务器重启.py"
```
### 6.2 宝塔终端解封SSH 不可用时用面板终端)
在**宝塔面板 → 终端**粘贴执行。将 `你的公网IP` 替换为本机公网 IP如 211.156.92.72,可从 https://ip.sb 或本机 `curl ifconfig.me` 获取):
**优化单行(同时解封 sshd + ssh-iptables**
```bash
IP="你的公网IP"; for j in sshd ssh-iptables; do fail2ban-client set "$j" unbanip "$IP" 2>/dev/null && echo "✅ $j 已解封 $IP"; done
```
**分步执行:**
```bash
fail2ban-client status sshd
fail2ban-client set sshd unbanip 你的公网IP
fail2ban-client set ssh-iptables unbanip 你的公网IP
```
**一键脚本**`scripts/宝塔_IP封禁解封与优化命令.sh`,在服务器上执行 `bash 脚本路径 你的公网IP`

View File

@@ -0,0 +1,48 @@
#!/bin/bash
# 宝塔服务器 IP 封禁解封 · 多方案 + 优化命令
# 用法:在宝塔面板【终端】粘贴执行;或 SSH 登录后执行
# 本机公网 IP用 curl ifconfig.me 获取,或替换下面的 MY_IP
MY_IP="${1:-$(curl -s --connect-timeout 3 ifconfig.me 2>/dev/null || echo '211.156.92.72')}"
echo "========== 宝塔 IP 封禁解封(本机 IP: $MY_IP=========="
# 1. 检查 fail2ban 状态
echo ""
echo "[1] fail2ban 状态"
if command -v fail2ban-client &>/dev/null; then
fail2ban-client status sshd 2>/dev/null || echo " sshd jail 未启用或无"
fail2ban-client status 2>/dev/null | head -20
else
echo " fail2ban 未安装"
fi
# 2. 解封本机 IP
echo ""
echo "[2] 解封本机 IP: $MY_IP"
if command -v fail2ban-client &>/dev/null; then
for jail in sshd ssh-iptables; do
if fail2ban-client status "$jail" &>/dev/null; then
fail2ban-client set "$jail" unbanip "$MY_IP" 2>/dev/null && echo "$jail 已解封 $MY_IP" || echo " ⚠️ $jail 解封失败或未封"
fi
done
else
echo " 需先安装 fail2ban: apt install fail2ban -y"
fi
# 3. 宝塔防火墙(若启用)
echo ""
echo "[3] 宝塔防火墙封禁检查"
if [ -x /usr/bin/bt ]; then
/usr/bin/bt 14 2>/dev/null | grep -E "$MY_IP|封禁" | head -5 || true
echo " 若本机 IP 在封禁列表,请到面板【安全】→【系统防火墙】解除"
fi
# 4. iptables 直查(如有)
echo ""
echo "[4] iptables 含 DROP/REJECT 的规则数"
iptables -L -n 2>/dev/null | grep -c -E "DROP|REJECT" || echo " 0 或无权限"
echo ""
echo "========== 完成 =========="
echo "建议:重启服务器可清空 fail2ban 内存封禁;或仅解封后等 10 分钟再试 SSH"

View File

@@ -0,0 +1,145 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
腾讯云 API 重启两台宝塔服务器存客宝、kr宝塔
凭证:环境变量 TENCENTCLOUD_SECRET_ID/SECRET_KEY或 00_账号与API索引.md
依赖pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-cvm
"""
import os
import re
import sys
import time
# 两台宝塔公网 IP
SERVERS = [
{"name": "存客宝", "ip": "42.194.245.239"},
{"name": "kr宝塔", "ip": "43.139.27.93"},
]
REGIONS = ["ap-guangzhou", "ap-beijing", "ap-shanghai", "ap-chengdu"]
def _find_karuo_ai_root():
d = os.path.dirname(os.path.abspath(__file__))
for _ in range(6):
if os.path.basename(d) == "卡若AI" or (os.path.isdir(os.path.join(d, "运营中枢")) and os.path.isdir(os.path.join(d, "01_卡资"))):
return d
d = os.path.dirname(d)
return None
def _read_creds():
root = _find_karuo_ai_root()
if not root:
return None, None
path = os.path.join(root, "运营中枢", "工作台", "00_账号与API索引.md")
if not os.path.isfile(path):
return None, None
with open(path, "r", encoding="utf-8") as f:
text = f.read()
secret_id = secret_key = None
in_tencent = False
for line in text.splitlines():
if "### 腾讯云" in line:
in_tencent = True
continue
if in_tencent and line.strip().startswith("###"):
break
if not in_tencent:
continue
m = re.search(r"\|\s*[^|]*(?:SecretId|密钥)[^|]*\|\s*`([^`]+)`", line, re.I)
if m:
val = m.group(1).strip()
if val.startswith("AKID"):
secret_id = val
m = re.search(r"\|\s*SecretKey\s*\|\s*`([^`]+)`", line, re.I)
if m:
secret_key = m.group(1).strip()
return secret_id or None, secret_key or None
def main():
secret_id = os.environ.get("TENCENTCLOUD_SECRET_ID")
secret_key = os.environ.get("TENCENTCLOUD_SECRET_KEY")
if not secret_id or not secret_key:
sid, skey = _read_creds()
secret_id = secret_id or sid
secret_key = secret_key or skey
if not secret_id or not secret_key:
print("❌ 未配置腾讯云 SecretId/SecretKey环境变量或 00_账号与API索引.md")
return 1
try:
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.cvm.v20170312 import cvm_client, models as cvm_models
except ImportError:
print("请安装: pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-cvm")
return 1
cred = credential.Credential(secret_id, secret_key)
to_reboot = [] # [(instance_id, region, name, ip), ...]
print("=" * 60)
print(" 腾讯云 API · 查找并重启宝塔服务器")
print("=" * 60)
for srv in SERVERS:
name, ip = srv["name"], srv["ip"]
found = False
for region in REGIONS:
try:
client = cvm_client.CvmClient(cred, region)
req = cvm_models.DescribeInstancesRequest()
req.Limit = 100
req.Offset = 0
resp = client.DescribeInstances(req)
instances = getattr(resp, "InstanceSet", None) or []
for ins in instances:
pub = list(getattr(ins, "PublicIpAddresses", None) or [])
if ip in pub:
iid = getattr(ins, "InstanceId", None)
state = getattr(ins, "InstanceState", "")
print("\n[1/3] 找到 %s %s → 实例 %s 地域 %s 状态 %s" % (name, ip, iid, region, state))
to_reboot.append((iid, region, name, ip))
found = True
break
except Exception as e:
continue
if found:
break
if not found:
print("\n⚠️ %s %s 未在腾讯云 CVM 中找到(可能为轻量或其它地域)" % (name, ip))
if not to_reboot:
print("\n❌ 无可用实例,退出")
return 1
# 按地域分组执行重启
print("\n" + "=" * 60)
print(" [2/3] 执行重启")
print("=" * 60)
for iid, region, name, ip in to_reboot:
try:
client = cvm_client.CvmClient(cred, region)
req = cvm_models.RebootInstancesRequest()
req.InstanceIds = [iid]
req.StopType = "SOFT" # 软重启
resp = client.RebootInstances(req)
print("%s (%s) 重启指令已下发" % (name, ip))
except Exception as e:
print("%s (%s) 重启失败: %s" % (name, ip, e))
print("\n" + "=" * 60)
print(" [3/3] 重启进度说明")
print("=" * 60)
print(" · 腾讯云 CVM 软重启约 13 分钟完成")
print(" · 重启会解除 fail2ban 等内存中的封禁(因进程重启)")
print(" · 建议等待 23 分钟后用 SSH 或宝塔面板测试")
print(" · 若仍需解封 IP在宝塔终端执行下方「IP 解封」命令")
print("=" * 60)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@@ -0,0 +1,97 @@
---
name: Remotion程序化视频
description: 用 React 程序化生成视频,支持数据驱动、批量、模板化视频与动效。基于 remotion-dev/remotion。
group: 木
triggers: Remotion、程序化视频、React视频、批量生成视频、数据驱动视频、动效模板
owner: 木叶
version: "1.0"
updated: "2026-02-17"
---
# Remotion 程序化视频
## 能做什么Capabilities
- **用 React 写视频**:用 CSS/Canvas/SVG/WebGL 定义每一帧
- **数据驱动**变量、API、算法驱动画面变化
- **批量生成**:同一模板批量产出(邀请函、封面、通知等)
- **动效包装**:片头、转场、图形动画
- **与切片协同**:切片产出 + Remotion 包装/合成
## 怎么用Usage
触发词:**Remotion**、**程序化视频**、**React视频**、**批量生成视频**、**数据驱动视频**、**动效模板**
## 核心概念速查
| 术语 | 含义 |
|:---|:---|
| **Composition** | 视频场景定义宽高、时长、fps |
| **useCurrentFrame()** | 当前帧号,驱动逐帧动画 |
| **interpolate()** | 帧间数值插值 |
| **Remotion Studio** | 本地预览界面 |
| **Remotion Player** | 浏览器嵌入播放器 |
## 一键开始
```bash
npx create-video@latest
```
选模板后:
```bash
npm run dev # 启动 Remotion Studio 预览
npx remotion render # CLI 渲染
```
## 主要包npm
| 包名 | 用途 |
|:---|:---|
| `remotion` | 核心 API |
| `@remotion/player` | 浏览器播放 |
| `@remotion/renderer` | Node 渲染 |
| `@remotion/lambda` | AWS Lambda 云端渲染 |
| `@remotion/three` | 3D 视频 |
| `@remotion/lottie` | Lottie 动画 |
| `@remotion/captions` | 字幕 |
| `@remotion/tailwind` | TailwindCSS |
## 常用模板
| 模板 | 用途 |
|:---|:---|
| Hello World | 入门 |
| Audiogram | 音频波形可视化 |
| TikTok | 竖屏短视频 |
| Three | 3D |
| Prompt to Video / Motion | AI 文本→视频/动效 |
| TTS Azure / Google | 语音合成 |
| Music Visualization | 音乐可视化 |
## 渲染方式
| 方式 | 命令/说明 |
|:---|:---|
| 本地 CLI | `npx remotion render` |
| Node 程序 | 使用 `@remotion/renderer` |
| AWS Lambda | 大规模并发 |
| GitHub Actions | CI 内渲染 |
| Vercel | 有专门模板 |
输出MP4、图片序列、音频、单帧图。
## 相关文件
- 参考资料:`参考资料/Remotion速查.md`
- 官方文档https://www.remotion.dev/docs
- APIhttps://www.remotion.dev/api
- 仓库https://github.com/remotion-dev/remotion
- 许可:特殊许可,商用可能需公司授权
## 依赖Dependencies
- Node 16+ 或 Bun 1.0.3+
- React
- 前置技能:可与「视频切片」配合使用(切片 → Remotion 包装)

View File

@@ -0,0 +1,29 @@
# Remotion 速查
> 来源remotion-dev/remotion | Stars 37k+
## 快速命令
```bash
npx create-video@latest
npm run dev
npx remotion render
```
## 核心 API
```tsx
import { useCurrentFrame, interpolate, Composition, Sequence } from 'remotion';
// 当前帧号0-based
const frame = useCurrentFrame();
// 插值:帧 [0,30] → 值 [0,100]
const opacity = interpolate(frame, [0, 30], [0, 1]);
```
## 与视频切片协同
1. **视频切片**:长视频 → 转录 → 切片 → 字幕烧录
2. **Remotion**:片头/片尾包装、数据可视化、批量封面
3. 可把切片产物作为 Remotion 的媒体素材输入

View File

@@ -1,7 +1,7 @@
# 卡若AI 技能注册表Skill Registry
> **一张表查所有技能**。任何 AI 拿到这张表,就能按关键词找到对应技能的 SKILL.md 路径并执行。
> 47 技能 | 14 成员 | 5 负责人
> 48 技能 | 14 成员 | 5 负责人
> 版本5.0 | 更新2026-02-16
---
@@ -63,6 +63,7 @@
| M03 | 项目生成 | 木果 | 生成项目、五行模板 | `03_卡木/木果_项目模板/项目生成/SKILL.md` | 按五行模板生成新项目 |
| M04 | 开发模板 | 木果 | 创建项目、初始化模板 | `03_卡木/木果_项目模板/开发模板/SKILL.md` | 前后端项目模板库 |
| M05 | 个人档案生成器 | 木果 | 个人档案、档案生成 | `03_卡木/木果_项目模板/个人档案生成器/SKILL.md` | 自动生成个人介绍档案 |
| M06 | Remotion程序化视频 | 木叶 | **Remotion、程序化视频、React视频、批量生成视频、数据驱动视频、动效模板** | `03_卡木/木叶_视频内容/Remotion程序化视频/SKILL.md` | 用 React 程序化生成视频,数据驱动、批量、动效 |
## 火组 · 卡火(技术研发优化)

View File

@@ -48,3 +48,4 @@
| 2026-02-21 20:30:50 | 🔄 卡若AI 同步 2026-02-21 20:30 | 更新:金仓、水溪整理归档、运营中枢工作台 | 排除 >20MB: 5 个 |
| 2026-02-21 21:06:44 | 🔄 卡若AI 同步 2026-02-21 21:06 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 5 个 |
| 2026-02-22 05:04:01 | 🔄 卡若AI 同步 2026-02-22 05:03 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 5 个 |
| 2026-02-22 05:11:04 | 🔄 卡若AI 同步 2026-02-22 05:11 | 更新:金仓、水溪整理归档、运营中枢工作台 | 排除 >20MB: 5 个 |

View File

@@ -51,3 +51,4 @@
| 2026-02-21 20:30:50 | 成功 | 成功 | 🔄 卡若AI 同步 2026-02-21 20:30 | 更新:金仓、水溪整理归档、运营中枢工作台 | 排除 >20MB: 5 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-02-21 21:06:44 | 成功 | 成功 | 🔄 卡若AI 同步 2026-02-21 21:06 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 5 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-02-22 05:04:01 | 成功 | 成功 | 🔄 卡若AI 同步 2026-02-22 05:03 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 5 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-02-22 05:11:04 | 成功 | 成功 | 🔄 卡若AI 同步 2026-02-22 05:11 | 更新:金仓、水溪整理归档、运营中枢工作台 | 排除 >20MB: 5 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |