
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/blog
Advanced tools
-前端:用基于vue的ant design vue构建后台管理页面和基于vue的vuetify构建前台展示页面。
-后端:用Gin快速搭建基础restful风格API,Gin是一个go语言编写的Web框架。
-数据库:采用MySql,使用gorm实现对数据库的基本操作。
-缓存:使用Redis实现记录缓存。
-日志:使用logrus实现日志记录。
├── api
│ └── v1
├── config
├── middleware
├── model
├── proto
├── routes
├── static
│ └── admin
│ └── front
└── utils
| └── errmsg
| └── validator
├── web
│ └── admin
│ └── front
| 文件夹 | 说明 | 描述 |
|---|---|---|
api | api层 | api层 |
--v1 | v1版本接口 | v1版本接口 |
config | 配置包 | 配置文件 |
middleware | 中间件层 | 用于存放 gin 中间件代码 |
model | 模型层 | 模型对应数据表和数据库查询 |
routes | 路由层 | 路由层 |
resource | 静态资源文件夹 | 负责存放静态文件 |
--admin | admin | 后台管理dist文件打包 |
--front | front | 前台展示dist文件打包 |
utils | 工具包 | 工具函数封装 |
--errmsg | errmsg | 错误信息的封装 |
--validator | validator | 后端数据校验 |
web | web | 前端代码 |
--admin | admin | 后台管理的前端代码 |
--front | front | 前台展示的前端代码 |
1-需要把config/config.ini里的文件配置(特别是数据库mysql的配置)修改成自己需要的配置,本项目使用七牛云对象存储上传的文件,你可以自己在七牛云注册一个账号,可以免费获赠10G的存储空间
2-本项目可以直接在windows上运行,建议使用goland,可以将blog.sql导入数据库中,初始登录用户为admin,密码为123456
3-[前台展示](http://localhost:8080/front)和 [后台管理] (http://localhost:8080/admin) 的切换需要修改routes/router.go,打开相关注释即可
4-如果需要修改前端部分,可以修改web下的文件,修改完后运行npm run build,把dist文件覆盖掉static里的文件
5-本项目是前后端分离项目,可以注释掉routes/router.go中加载静态资源的代码,把后端代码运行起来,然后在web/admin(或者web/front)目录下,运行npm run serve即可
方式一:使用dockerfile部署(确保服务器上有下载docker)
#克隆项目
git clone git@github.com:tmnhs/gin-blog.git
#在gin-blog目录下
cd gin-blog
#docker编译镜像
docker build -t myblog .
#运行docker
docker run -p 8080:8080 -t --name myblog myblog
#注意此时的数据库配置应该改为服务器上的配置
方式二:使用脚本部署
#克隆项目
git clone git@github.com:tmnhs/gin-blog.git
#在gin-blog目录下
cd gin-blog
#必须在linux系统下
#启动项目
./serve.sh start
#暂停项目
./serve.sh stop
#重启服务
./serve.sh restart
#注意,脚本运行的端口号必须大于1024,不然可能会没有权限
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.