回收 411 MB(470 M → 58.8 M),全部经回收站,可恢复: - 待清理/(146.2 M,含 relay 分片 128 M 与 42 项过程目录) - tmp/(32.4 M,按接续棒命名的过程临时区) - .workbuddy/tmp/(39.5 M) - 4 份 workbuddy.db 冗余副本(101 M,09-23 事故的坏副本 / 抢救产物) - tmp/im16/gw/centrifugo 二进制(63.9 M,可重下)+ 缓存残留 入库范围:常驻规则(CODEBUDDY.md / README.md / state.py)、在途接续入口与 接续包、docs/、交付物/、交接单/、归档/、scripts/、.codebuddy/、 .workbuddy/memory/;共 398 件,其中 >60 KB 的 26 件全为文档。 排除(.gitignore):tmp/、待清理/、运行态日志与缓存、*.db 与 DB 备份整目录、 打包二进制(*.tar.gz / *.tgz)、记忆修复前备份。
20 lines
838 B
Python
20 lines
838 B
Python
#!/usr/bin/env python3
|
|
import io
|
|
p = '/opt/dshs/src/web/routes/admin.ts'
|
|
s = io.open(p, encoding='utf-8').read()
|
|
anchor = " app.get('/api/admin/users', { preHandler: requireAdmin },"
|
|
assert anchor in s
|
|
new = """ // 档案 28:存储用量面板(读取维护脚本生成的快照文件,避免每次请求都 du)
|
|
app.get('/api/admin/storage', { preHandler: requireAdmin }, async () => {
|
|
const { readFileSync } = await import('node:fs')
|
|
try {
|
|
return JSON.parse(readFileSync(process.env.DSH_STORAGE_REPORT ?? '/var/run/dsh-storage-report.json', 'utf8'))
|
|
} catch {
|
|
return { generatedAt: null, users: [], note: '报告尚未生成(cron 每小时刷新一次)' }
|
|
}
|
|
})
|
|
|
|
""" + anchor
|
|
io.open(p, 'w', encoding='utf-8', newline='').write(s.replace(anchor, new, 1))
|
|
print('D admin.ts 新端点已写入')
|