|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
<div align="center"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## AUXPI |
|
|
|
|
|
|
|
|
|
**基于 API 的简单图床** |
|
|
|
@ -8,6 +9,19 @@ |
|
|
|
|
[![GitHub forks](https://img.shields.io/github/forks/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI/network) |
|
|
|
|
[![GitHub stars](https://img.shields.io/github/stars/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI/stargazers) |
|
|
|
|
[![GitHub license](https://img.shields.io/github/license/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```text |
|
|
|
|
_ __ __ ___ _____ |
|
|
|
|
/_\ /\ /\ \/ / / _ \\_ \ |
|
|
|
|
//_\\/ / \ \ / / /_)/ / /\/ |
|
|
|
|
/ _ \ \_/ / \/ ___/\/ /_ |
|
|
|
|
\_/ \_/\___/_/\_\/ \____/ |
|
|
|
|
|
|
|
|
|
🍭 A NEW API IMAGES STORE TOOL 🍭 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
</div> |
|
|
|
|
<br> |
|
|
|
|
|
|
|
|
@ -28,46 +42,74 @@ |
|
|
|
|
* Flickr |
|
|
|
|
* 网易 |
|
|
|
|
* 掘金 |
|
|
|
|
* 本地 (由于需要对接后台,正在紧张开发中) |
|
|
|
|
* 本地 |
|
|
|
|
|
|
|
|
|
* 各种自由定制请看下面的截图 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* API 可以设置 token 可以私用,也可以选择关闭 API,只保留 web 上传 |
|
|
|
|
* 可以设置是否开启新浪图床上传(因为新浪图床需要登录自己的账号) |
|
|
|
|
* 可以设置允许上传的图片最大大小 和 一次性上传的最多张数 |
|
|
|
|
|
|
|
|
|
* 简单部署即可使用,从 Release 中获取,开箱即用 |
|
|
|
|
* 轻量级不使用任何数据库 (暂时) |
|
|
|
|
* 后台控制,用户和管理员双后台(开发中) |
|
|
|
|
* Go 语言编写速度加成(滑稽) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 项目截图 |
|
|
|
|
|
|
|
|
|
![首页](https://ws4.sinaimg.cn/large/ed24e93ely1fzeamnpm6yj21hc0o7n31.jpg) |
|
|
|
|
![首页](https://ws2.sinaimg.cn/large/007DFgJwgy1g10ecblh1dj31hc0nw770.jpg) |
|
|
|
|
|
|
|
|
|
![管理员后台](https://ws3.sinaimg.cn/large/007DFgJwgy1g10eavu2zqj31ha0obdii.jpg) |
|
|
|
|
|
|
|
|
|
![无上传图片样式](https://ws2.sinaimg.cn/large/ed24e93ely1fzeao21i4wj21hb0odad1.jpg) |
|
|
|
|
![用户后台](https://ws3.sinaimg.cn/large/007DFgJwgy1g10ejf74lzj31h70ogtey.jpg) |
|
|
|
|
|
|
|
|
|
![设置页面](https://ws4.sinaimg.cn/large/007DFgJwgy1g10fkgqdsnj30u018cq9x.jpg) |
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
## 部署使用 |
|
|
|
|
**如果您感觉不错,请您点个 Star,您的 Star 是对我最大的鼓励 (认真脸)** |
|
|
|
|
|
|
|
|
|
**首先前排不要脸求Star ❤ (/ω\)** |
|
|
|
|
有问题请到 Issue 中提出 |
|
|
|
|
|
|
|
|
|
**有问题请到 Issue 中提出** |
|
|
|
|
演示站点为 [AuXpI 图床](https://imgx.0w0.tn/) |
|
|
|
|
|
|
|
|
|
**演示站点为 [AuXpI 图床](https://imgx.0w0.tn/)** |
|
|
|
|
|
|
|
|
|
**因为服务器在国外,可能会上传稍微慢一些~** |
|
|
|
|
## 安装教程 |
|
|
|
|
|
|
|
|
|
如果您是空白的 vps,您可以直接使用一键脚本进行安装,安装教程 |
|
|
|
|
|
|
|
|
|
注意此脚本会给您安装 Nginx 和 Mysql,请确保您的服务器是干净的 |
|
|
|
|
|
|
|
|
|
查看 WIKI 中的 [安装教程 ](https://github.com/aimerforreimu/AUXPI/wiki/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2) |
|
|
|
|
https://github.com/aimerforreimu/AUXPI/wiki/%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC |
|
|
|
|
|
|
|
|
|
如果您想手动安装,可以参考安装 wiki |
|
|
|
|
|
|
|
|
|
https://github.com/aimerforreimu/AUXPI/wiki/%E5%9B%BE%E5%BA%8A%E9%85%8D%E7%BD%AE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 开发人员 && 折腾用户 |
|
|
|
|
|
|
|
|
|
如果您想要从源代码中构建 auxpi,您可以按照下面的教程进行构建,如果您仅仅想使用 auxpi,这一段您可以跳过 |
|
|
|
|
|
|
|
|
|
请注意你,请确保您的电脑上有 Go 环境。 |
|
|
|
|
### 从源码中构建 |
|
|
|
|
|
|
|
|
|
#### 使用脚本构建 |
|
|
|
|
|
|
|
|
|
在 [最近一次更新](https://github.com/aimerforreimu/AUXPI/commit/00e061273b6a74e0c85ed7feb744fc58d0e2c797) 中加入了批量编译打包的脚本,您可以使用此脚本进行代码的构建 |
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
bash build.sh all # 编译所有平台的程序 |
|
|
|
|
bash build.sh mac # 编译 mac 程序 |
|
|
|
|
bash build.sh windows # 编译 Windows 程序 |
|
|
|
|
bash build.sh linux #编译 linux 程序 |
|
|
|
|
bash build.sh all 2.2.0 clear # 编译程序,分别打包所有的平台的项目,2.2.0 为版本号,清空编译以后文件,只保留压缩包 |
|
|
|
|
bahs build.sh help #查看帮助 |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
打包前端 |
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
cd resource |
|
|
|
|
yarn install |
|
|
|
|
yarn run build |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 使用 Bee 工具运行程序 |
|
|
|
|
```bash |
|
|
|
|
cd $GOPATH/src |
|
|
|
@ -88,6 +130,59 @@ GOOS=darwin GOARCH=amd64 bee pack |
|
|
|
|
``` |
|
|
|
|
更多交叉编译请参考 [Go 交叉编译](https://www.jianshu.com/p/4b345a9e768e) |
|
|
|
|
|
|
|
|
|
### 二次开发规范 |
|
|
|
|
|
|
|
|
|
如果这个项目让您感觉还不错,您想二次开发一下或者想为这个项目提交 PR |
|
|
|
|
|
|
|
|
|
##### 1.命名规范 |
|
|
|
|
* 函数,私有变量必须采用小驼峰方式进行命名 即 `sendMail()`,`userInfo` |
|
|
|
|
|
|
|
|
|
* 共有变量需要使用**大驼峰**方式命名 |
|
|
|
|
|
|
|
|
|
* 结构体,接口必须使用**大驼峰**方式进行命名 |
|
|
|
|
|
|
|
|
|
##### 2.代码组织 |
|
|
|
|
|
|
|
|
|
最好请按照这个下面说明的结构去组织您的代码 |
|
|
|
|
|
|
|
|
|
* 中间件请存放在 `middleware` 文件夹中 |
|
|
|
|
|
|
|
|
|
* api 请按照版本号放在 `controller/api/v(0-9)/`中,所有 api 除去 `auth` 都不能进行模板引擎的渲染和操作,只允许输出 `json` |
|
|
|
|
|
|
|
|
|
* 如果需要渲染模板引擎,请直接在 `controller/` 下面建立对应的 controller |
|
|
|
|
|
|
|
|
|
* `utils` 下面的各种工具文件不允许与 `models` 下面的文件耦合在一起,如果要为 `models` 编写工具,请放到 `tools` 下 |
|
|
|
|
|
|
|
|
|
* `all.go` 中只允许写入经常被引入,需要格式化成 `json` , `xml` 等格式的结构体 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```text |
|
|
|
|
. |
|
|
|
|
├── LICENSE |
|
|
|
|
├── README.md |
|
|
|
|
├── auxpiAll |
|
|
|
|
├── bootstrap |
|
|
|
|
├── build |
|
|
|
|
├── build.sh |
|
|
|
|
├── conf |
|
|
|
|
├── controllers |
|
|
|
|
├── install.sh |
|
|
|
|
├── log |
|
|
|
|
├── main.go |
|
|
|
|
├── middleware |
|
|
|
|
├── models |
|
|
|
|
├── pem |
|
|
|
|
├── resource |
|
|
|
|
├── routers |
|
|
|
|
├── server |
|
|
|
|
├── static |
|
|
|
|
├── tests |
|
|
|
|
├── tools |
|
|
|
|
├── utils |
|
|
|
|
└── views |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
## API 上传 |
|
|
|
|
|
|
|
|
|
其实当时写这个程序的时候没有想要写前端的页面,是看到了另一位大佬的图床,感觉这个前端页面很好看才写网页版上传,本来想直接写个 API 服务. |
|
|
|
@ -197,19 +292,19 @@ API 未开启返回值 |
|
|
|
|
|
|
|
|
|
* [x] API 上传 |
|
|
|
|
|
|
|
|
|
* [ ] API 自动文档 |
|
|
|
|
* [] API 自动文档 |
|
|
|
|
|
|
|
|
|
* [ ] API v2 版本分发上传,返回所有图床储存链接 |
|
|
|
|
|
|
|
|
|
* [ ] 用户系统 |
|
|
|
|
* [x] 用户系统 |
|
|
|
|
|
|
|
|
|
* [ ] 前后端分离,Vue 驱动前端 |
|
|
|
|
* [x] 前后端分离,Vue 驱动前端 |
|
|
|
|
|
|
|
|
|
* [ ] 后台控制 |
|
|
|
|
* [x] 后台控制 |
|
|
|
|
|
|
|
|
|
* [ ] 本地上传,各大平台对接储存 |
|
|
|
|
* [x] 本地上传,各大平台对接储存 |
|
|
|
|
|
|
|
|
|
* [ ] 使用 MySQL 而不是 JSON |
|
|
|
|
* [x] 使用 MySQL 而不是 JSON |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 说明 |
|
|
|
|