All Projects → 0xDkd → Auxpi

0xDkd / Auxpi

Licence: gpl-3.0
🍭 集合多家 API 的新一代图床

Programming Languages

go
31211 projects - #10 most used programming language
Vue
7211 projects
CSS
56736 projects
shell
77523 projects
HTML
75241 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Auxpi

Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (-92.74%)
Mutual labels:  api, rest-api
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+8.45%)
Mutual labels:  api, rest-api
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (-92.4%)
Mutual labels:  api, rest-api
Lumen Microservice
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 7 | Aws ECS, Google Kubernates, Azure Container Engine
Stars: ✭ 183 (-92.98%)
Mutual labels:  api, rest-api
Magic
Create your .Net Core/Angular/Database CRUD Web apps by simply clicking a button
Stars: ✭ 214 (-91.79%)
Mutual labels:  api, rest-api
Apicheck
The DevSecOps toolset for REST APIs
Stars: ✭ 184 (-92.94%)
Mutual labels:  api, rest-api
Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: ✭ 202 (-92.25%)
Mutual labels:  api, rest-api
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-93.17%)
Mutual labels:  api, rest-api
Drago
A flexible configuration manager for Wireguard networks
Stars: ✭ 204 (-92.17%)
Mutual labels:  api, rest-api
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+1.15%)
Mutual labels:  api, rest-api
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-93.05%)
Mutual labels:  api, rest-api
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (-91.63%)
Mutual labels:  api, rest-api
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (-93.09%)
Mutual labels:  api, rest-api
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-92.78%)
Mutual labels:  api, rest-api
Bmw Yolov4 Inference Api Cpu
This is a repository for an nocode object detection inference API using the Yolov4 and Yolov3 Opencv.
Stars: ✭ 180 (-93.09%)
Mutual labels:  api, rest-api
Jikan Rest
The REST API for Jikan
Stars: ✭ 200 (-92.32%)
Mutual labels:  api, rest-api
Ynab Sdk Js
YNAB API JavaScript Library
Stars: ✭ 167 (-93.59%)
Mutual labels:  api, rest-api
Movies Restapi
RESTful API to manage movies written in Go and uses MongoDB as storage
Stars: ✭ 168 (-93.55%)
Mutual labels:  api, rest-api
Swiftdailyapi
A Swift API framework for ZhiHu's Daily News.
Stars: ✭ 204 (-92.17%)
Mutual labels:  api, rest-api
Symfony Flex Backend
Symfony Flex REST API template project
Stars: ✭ 214 (-91.79%)
Mutual labels:  api, rest-api

AUXPI

集合多家 API 的新一代图床

Travis CI GitHub forks GitHub stars GitHub license FOSSA Status

Snipaste_2019-05-12_22-16-26.png


功能 特色

  • 支持 web 上传图片
  • 支持 API 上传图片
  • 支持分发,控制反转
  • 各种自由定制请看下面的截图

项目截图

首页

管理员后台

设置

支持拖拽对首页的菜单进行排序和开关控制

拖拽

图片链接按照权重进行异步分发

分发

首页有几个可视化的图表,方便分析

首页


如果您感觉不错,请您点个 Star,您的 Star 是对我最大的鼓励 (认真脸)

有问题请到 Issue 中提出

安装教程

如果您是空白的 vps,您可以直接使用一键脚本进行安装,安装教程

注意此脚本会给您安装 Nginx 和 Mysql,请确保您的服务器是干净的

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

演示站点为 https://test.demo-1s.com/

请勿滥用,滥用者将被加入 ip 黑名单并且放到 github 上公示

请注意,目前已经开启图片鉴黄,且等级较高,如果试用程序请尽量上传风景图,否则有可能无法上传

演示站点管理员账户:

用户名:admin123
密码:admin123
邮箱:[email protected]

分发原理

流程图

开发人员 && 折腾用户

如果您想要从源代码中构建 auxpi,您可以按照下面的教程进行构建,如果您仅仅想使用 auxpi,这一段您可以跳过

请注意你,请确保您的电脑上有 Go 环境。

从源码中构建

使用脚本构建

最近一次更新 中加入了批量编译打包的脚本,您可以使用此脚本进行代码的构建

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 #查看帮助

打包前端

cd resource
yarn install
yarn run build

使用 Bee 工具运行程序

cd $GOPATH/src
git clone [email protected]:aimerforreimu/AUXPI.git
cd AUXPI/
bee run auxpi

交叉编译

#Mac/Windows环境编译成 Linux 程序 
GOOS=linux GOARCH=amd64 bee pack 
#Mac/Linux 环境编译 Windows 程序
GOOS=windows GOARCH=amd64 bee pack
#Windows/Linux 编译 Mac 程序
GOOS=darwin GOARCH=amd64 bee pack

更多交叉编译请参考 Go 交叉编译

二次开发规范

如果这个项目让您感觉还不错,您想二次开发一下或者想为这个项目提交 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 等格式的结构体

.
├── 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 上传实例

图片上传 V1 接口

功能 图片上传接口
HTTP 请求方式  POST
URL  http://yourname/api/v1/upload

请求参数

参数名称 类型 是否必须 描述
image File 表单名称,上传图片
token  String 认证所必须的 token ,如果站在没有开启则留空即可
apiSelect  String 所选择的 API 类型

apiSelect可选参数

apiSelect 可选参数 参数说明
SouGou 搜狗图床
Sina 新浪图床
Smms SMMS 图床

成功上传返回

{
    "code": 200,
    "msg": "上传成功",
    "data": {
        "name": "Snipaste_2018-08-28_01-17-58.png",
        "url": "https://img04.sogoucdn.com/app/a/100520146/0dcb98aadb59c6b29dc0832eb7cc094a"
    }
}
{
    "code": 200,
    "msg": "上传成功",
    "data": {
        "name": "Snipaste_2018-08-28_01-17-58.png",
        "url": "https://i.loli.net/2018/11/05/5be038b1b4af6.png"
    }
}

失败返回值

上传出错返回值

{
    "code": 500,
    "msg": "上传失败"
}

API 未开启返回值

{
    "code": 405,
    "msg": "Method not allowed"
}

Token 验证失败返回值

{
    "code": 403,
    "msg": "Forbidden"
}

选择文件为空返回值

{
    "code": 500,
    "msg": "No files were uploaded."
}

文件太大返回值

{
    "code": 500,
    "msg": "File is too large."
}

TODO

  • API 上传

  • API v2 版本分发上传,返回所有图床储存链接

  • 用户系统

  • 前后端分离,Vue 驱动前端

  • 后台控制

  • 本地上传,各大平台对接储存

  • 使用 MySQL 而不是 JSON

  • API 自动文档

  • 国际化

  • 多缓存选择 Memory|redis|file|Memcached

  • 用户后台重构

  • 定时任务调度

说明

本项目是学习 Go 的过程中,边学边写出来的程序,可能存在 bug 连篇 ,逻辑让人无法接受,南辕北辙,代码无法让人直视等副作用。

致敬

@ astaxie (beego)

@ PanJiaChen (vue-element-admin)

@ metowolf (upimg-cli)

@ wisp-x (lsky-pro)

LICENSE

GNU General Public License v3.0

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].