Files
blog/content/posts/cs-ge-lei-pei-zhi.md
T
wait4xandGLM-5.3 80ff67e8fa feat(content): 三集合 schema 与 EXIF 构建期补全(T4 车道收编)
- src/content.config.ts(Astro 7 唯一合法路径,旧 config.ts 会抛
  LegacyContentConfigError——车道实测发现,经批复的边界修正)
- posts(category→track 派生单源)/moments(text-image 互斥 refine)/
  photos(json sidecar + jpg,exif 构建期 exifr 补全、frontmatter 可覆盖)
- 样例:书评+技术文各 1、瞬间 3、照片 3(横竖方三比例,EXIF 三路径覆盖)
- 附带 scripts/check-responsive.sh(T9 预置,随 T6 产物生效)
- 车道 30min 超时于过度验证循环,产物完好,主会话收编续跑

验证: pnpm astro build exit 0(1.63s,含三集合加载)

Spec: 2026-10-24_add-blog-skeleton
Co-authored-by: GLM-5.3
2026-10-24 23:36:59 +08:00

38 lines
2.1 KiB
Markdown
Raw 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.
---
title: CS各类配置
pubDate: 2026-04-28
category: tech
tags: [linux, docker]
---
上周把一台 2 核 2G 的入门云服务器重装成 Debian 12,顺手把从裸系统到能跑服务的最小流程整理成清单。目标很简单:换一块干净的地基——初始化用户、换源、装 Docker,全程不超过二十分钟,之后所有服务一律进容器。
## 系统初始化
第一件事是建普通用户、配好密钥,再把密码登录关掉。用 `adduser deploy` 创建用户并加入 `sudo` 组,随后在 `/etc/ssh/sshd_config` 里设置 `PasswordAuthentication no` 与 `PermitRootLogin no`,重载 sshd 即可。UFW 只放行 22 与 80/443,云控制台的安全组记得同步。
## 更换软件源
官方源对国内机器不算友好,换到清华 TUNA 镜像几乎是必选项。改动集中在 `/etc/apt/sources.list`,把 `deb.debian.org` 整体替换即可,bookworm 与 bookworm/updates 两段都要覆盖。
```bash
# 换源:备份后替换为清华 TUNA 镜像(Debian 12 / bookworm)
sudo cp /etc/apt/sources.list{,.bak}
sudo sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
sudo apt update && sudo apt upgrade -y
# 安装 Docker Engine(官方 APT 仓库)
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo systemctl enable --now docker && sudo docker run --rm hello-world
```
## 安装 Docker
官方的 `get.docker.com` 脚本虽然省事,但会替你决定源的写入方式;按上面的官方 APT 仓库手动配置更可控,以后升级也只走同一条路。装完用 `docker version` 确认 Engine 与 compose 插件都在。
### 国内镜像加速
拉取镜像前,在 `/etc/docker/daemon.json` 里注册镜像加速地址,`systemctl restart docker` 生效;`docker info` 的末尾能看到 Registry Mirrors 是否挂载成功。