
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
github.com/yshujie/miniblog
Advanced tools
MiniBlog 是一个企业级的博客管理系统,采用 Go + Vue 技术栈构建,支持模块化内容组织、权限管理和多前端展示。系统采用外部基础设施架构,通过 Docker 网络连接共享的 Nginx、MySQL、Redis 服务,实现资源高效利用和服务解耦。
外部基础设施依赖
MiniBlog 采用微服务架构,依赖外部基础设施项目提供共享服务:
infra-mysql)infra-redis)infra-nginx)infra-portainer)网络通信
应用通过 infra_shared Docker 网络与外部服务通信,实现:
/v1 REST API,提供完整的 CRUD 操作┌─────────────────────────────────────────────┐
│ 前端层 │
├─────────────────┬───────────────────────────┤
│ 博客前端 │ 管理后台 │
│ (Vue+Vuetify) │ (Vue+Ant Design Vue) │
└─────────────────┴───────────────────────────┘
│
┌─────────────────────────┼─────────────────────────┐
│ API 网关 │
│ (Nginx + SSL) │
└─────────────────────────┼─────────────────────────┘
│
┌─────────────────────────┼─────────────────────────┐
│ 后端服务 │
├─────────────────────────┼─────────────────────────┤
│ Controller 层 ← → Biz 层 ← → Store 层 ← → Model 层 │
└─────────────────────────┼─────────────────────────┘
│
┌─────────────────────────┼─────────────────────────┐
│ 数据层 │
├─────────────────────────┼─────────────────────────┤
│ MySQL │ Redis │
│ (持久化存储) │ (缓存) │
└─────────────────────────┴─────────────────────────┘
系统要求:
环境变量配置:
复制环境变量模板并根据实际情况修改:
cp .env.example .env
主要配置项(均带 MINIBLOG_ 前缀):
DATABASE_HOST、DATABASE_PORT、DATABASE_USERNAME、DATABASE_PASSWORD、DATABASE_DBNAMEREDIS_HOST、REDIS_PORT、REDIS_PASSWORD、REDIS_DBJWT_SECRETFEISHU_DOCREADER_APPID、FEISHU_DOCREADER_APPSECRET方式一:使用 Makefile(推荐)
# 完整构建
make build
# 格式化代码
make format
# 清理构建产物
make clean
方式二:直接使用 Go
# 编译二进制文件
go build -o _output/miniblog ./cmd/miniblog
# 整理依赖
go mod tidy
构建产物输出到 _output/miniblog。
方式一:Docker Compose 部署(推荐)
重要提示:MiniBlog 现在采用外部基础设施架构,需要先部署共享的基础设施项目。
# 1. 部署外部基础设施(需要先克隆 infra 项目)
cd ../infra
docker compose up -d
# 2. 检查基础设施状态
make check-infra
# 3. 部署 MiniBlog 应用
make deploy # 部署所有应用组件
make deploy-dev # 开发环境部署
make deploy-prod # 生产环境部署
方式二:本地开发运行
.env 文件)# 使用配置文件启动
./_output/miniblog --config configs/miniblog.yaml
# 或直接运行
go run ./cmd/miniblog -c configs/miniblog.yaml
# 健康检查
curl http://localhost:8081/health
# 查看服务状态
make status
服务地址:
登录获取 Token:
curl -X POST http://localhost:8081/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"your-password"}'
使用 Token 访问受保护接口:
curl -H "Authorization: Bearer <your-jwt-token>" \
http://localhost:8081/v1/admin/users/myinfo
用户管理:
POST /v1/admin/usersGET /v1/admin/users/:name/change-passwordGET /v1/admin/users/myinfo内容管理:
/v1/admin/modules(创建、查询模块)/v1/admin/sections(创建章节、按模块查询、获取详情)/v1/admin/articles(创建、列表、详情、更新、发布/下架)GET /v1/blog/modulesGET /v1/blog/moduleDetail?moduleCode=<code>GET /v1/blog/articleDetail?articleID=<id>查看服务状态:
make status # 查看所有服务状态
make logs-backend # 查看后端日志
make logs-infra # 查看基础设施日志
更多 API 详情请参考 api/openapi/openapi.yaml 文档。
我们欢迎所有形式的贡献!请遵循以下步骤:
Fork 项目 并创建功能分支:
git checkout -b feature/your-feature-name
本地开发 并确保代码质量:
make format # 格式化代码
go vet ./... # 静态检查
go test ./... # 运行测试(如有)
构建验证 确保项目正常编译:
make build # 编译项目
make deploy-backend # 测试部署
提交 PR 并详细说明:
代码审查 后合并到主分支
如果您在项目中使用了 MiniBlog,欢迎在 Issues 中告诉我们:
这将帮助我们更好地改进项目!
本项目目前为个人学习项目,暂未指定开源许可证。
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.