Files
admin c1b5e4d966 chore(工作区): 全量入库 + 补齐 .gitignore(以工作区为准)
- 变更规模:新增 514 / 修改 62 / 重命名 155 / 删除 4(归档重组与文档轮次)
- .gitignore 修:`归档/**/db-cwd归一-备份-*/` —— 原规则写绝对层级(归档/db-cwd归一-…),
  目录搬进 归档/配置与备份/ 后**静默失效**,43 MB 的 DB 备份又变成未跟踪
- .gitignore 补:嵌套 git 内部数据(归档/内嵌git-20261008/、归档/skills-git-旧线-20261007/dotgit-原样移出/)
- .gitignore 补:运行态与部署副本(.workbuddy/collab/、.workbuddy/tools/、.workbuddy/.load-pending、.workbuddy/tmp-*)
- .gitignore 补:备份件(*.bak-*)
- 未跟踪文件从 2190 降到 890(其余为 归档/ 归档件与 .workbuddy/memory/ 知识文件,按口径入库)
2026-10-10 23:13:22 +08:00

34 lines
2.2 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
set +e
V=/www/server/panel/vhost/nginx
TS=$(date +%Y%m%d-%H%M%S)
DB='postgres://dshs:[email protected]:15432/dshs'
echo "=== S4-0 取实例用户名(只打印名字) ==="
psql "$DB" -t -A -c "select name from users order by name limit 6" 2>&1 | head -8
echo "--- 表清单(若上面报错则看这里) ---"
psql "$DB" -t -A -c "select tablename from pg_tables where schemaname='public' order by tablename" 2>&1 | head -14
echo "=== S4-1 备份连带项两份 ==="
cp -a "$V/relay-direct.conf" "$V/relay-direct.conf.bak-dom-$TS"
cp -a "$V/dsh.alotbuy.com.conf" "$V/dsh.alotbuy.com.conf.bak-dom-$TS"
ls -l "$V"/relay-direct.conf.bak-dom-$TS "$V"/dsh.alotbuy.com.conf.bak-dom-$TS | awk '{print $5, $9}'
echo "=== S4-2 relay-direct.conf:Host 改写 → ai1net.com ==="
sed -i 's/^\([[:space:]]*proxy_set_header Host[[:space:]]*\)alotbuy\.com;/\1ai1net.com;/' "$V/relay-direct.conf"
grep -n "proxy_set_header Host" "$V/relay-direct.conf"
echo "=== S4-3 dsh.alotbuy.com.conf:map 目标 → 新域(⛔ 不动 server_name/正则) ==="
sed -i 's/^\([[:space:]]*default[[:space:]]*\)alotbuy\.com;/\1ai1net.com;/' "$V/dsh.alotbuy.com.conf"
sed -i 's/\$label\.alotbuy\.com;/$label.ai1net.com;/' "$V/dsh.alotbuy.com.conf"
sed -n '7,10p' "$V/dsh.alotbuy.com.conf"
echo "--- 确认 server_name 未被改(应仍是 alotbuy) ---"
grep -n "server_name" "$V/dsh.alotbuy.com.conf"
echo "=== S4-4 nginx -t + reload ==="
nginx -t 2>&1 | tail -1 && nginx -s reload 2>&1 | tail -1
sleep 1
echo "=== S4-5 兜底入口验收(源站侧) ==="
curl -sk --http1.1 -o /dev/null -w "relay-direct.ai1net /dshs-overlay/bootstrap => %{http_code}\n" -H "Host: relay-direct.ai1net.com" https://127.0.0.1/dshs-overlay/bootstrap
curl -sk --http1.1 -o /dev/null -w "relay-direct.ai1net /unknown => %{http_code}(应 404)\n" -H "Host: relay-direct.ai1net.com" https://127.0.0.1/unknown
curl -sk --http1.1 -o /dev/null -w "relay-direct.alotbuy /dshs-overlay/bootstrap => %{http_code}\n" -H "Host: relay-direct.alotbuy.com" https://127.0.0.1/dshs-overlay/bootstrap
curl -sk --http1.1 -o /dev/null -w "ai1net 门户 => %{http_code}\n" -H "Host: ai1net.com" https://127.0.0.1/portal.html