Files
MyBlog/README.md
2026-03-26 17:18:19 +08:00

121 lines
2.7 KiB
Markdown
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.
# 氓氓的个人博客
## 📝 介绍
一个专注于分享编程知识、技术趋势和开发经验的个人博客,记录学习成长的点点滴滴。
主要内容包括:
- 💻 编程技术Go、Java、前端等
- 🐧 Linux 系统使用与配置
- 🛠️ 实用工具分享
- 📱 应用部署与配置Jellyfin、RustDesk 等)
- 📚 工作日志与技术总结
## 🏗️ 技术栈
- **框架**: [VuePress v2](https://v2.vuepress.vuejs.org/zh/)
- **主题**: [VuePress Theme Hope](https://theme-hope.vuejs.press/zh/)
- **构建工具**: Vite
- **语言**: TypeScript + Vue 3
## 🚀 快速开始
### 安装依赖
```bash
npm install
```
### 本地开发
```bash
npm run docs:dev
```
访问 `http://localhost:8080` 即可预览博客
### 构建生产版本
```bash
npm run docs:build
```
构建产物将生成在 `src/.vuepress/dist` 目录
### Docker 部署
需要先安装 Docker 和 Docker Compose v2。
启动服务:
```bash
make up
```
访问 `http://localhost:51888/` 即可查看站点。
停止服务:
```bash
make down
```
### 清除缓存开发
```bash
npm run docs:clean-dev
```
## 📂 目录结构
```
.
├── src/
│ ├── .vuepress/ # VuePress 配置
│ │ ├── config.ts # 站点配置
│ │ ├── theme.ts # 主题配置
│ │ ├── navbar.ts # 导航栏配置
│ │ ├── sidebar.ts # 侧边栏配置
│ │ └── styles/ # 自定义样式
│ ├── programming/ # 编程相关文章
│ │ ├── backend/ # 后端Go、Java
│ │ ├── frontend/ # 前端
│ │ ├── linux/ # Linux
│ │ └── docker/ # Docker
│ ├── apps/ # 应用部署
│ ├── tools/ # 工具分享
│ ├── work/ # 工作日志
│ └── README.md # 首页
└── package.json
```
## 📄 License
MIT License
## 🔐 站点访问认证Caddy
本站部署在家用服务器,通过云服务器的 Caddy 作为公网入口;访问认证(登录)已在 Caddy 层统一开启,因此无需在 VuePress/前端实现认证逻辑。
要点:
- **认证位置**:云服务器 `Caddyfile`(整站 `basicauth` / 或按路径规则)
- **原因**:静态站前端登录无法真正保护资源;在反代入口做认证才有效
- **参考命令**(生成 bcrypt 密码哈希):
```bash
caddy hash-password --plaintext 'your-strong-password'
```
- **参考配置**(整站认证):
```caddyfile
example.com {
basicauth {
youruser <bcrypt-hash>
}
reverse_proxy 127.0.0.1:<upstream>
}
```