Git Product home page Git Product logo

autopiccdn's Introduction

autoPicCdn

实现功能:

  1. 选择Github

    白嫖Github的存储空间,通过jsdelivr全球加速(含有国内节点)。实现图床的目的。

  2. 选择Gitee

    白嫖Gitee的存储空间, 实现图床的目的。存储和访问节点都在国内,请在遵循国内相关法律的前提下使用。 文件在1M以上需要访客登录才能访问。1M以下,相当稳。

目录介绍:

.
├── index.html # 前端首页
├── pic.sql # SQL语句用以创建数据表
├── README.md 
├── static # 静态文件夹
└── up.php # 上传接口文件

使用:

配置选项

1.配置上传类型:

  • 选择github

https://github.com/settings/tokens 去这个页面生成一个有写权限的token(repo:Full control of private repositories 和write:packages前打勾)然后配置up.php中的相关字段。

define("TYPE","GITHUB");//选择github
define("USER","pic-cdn");//你的GitHub/Gitee的用户名
define("REPO","cdn2");//必须是上面用户名下的 公开仓库
define("MAIL","[email protected]");//邮箱无所谓,随便写
define("TOKEN","YourToken");
  • 选择Gitee

去往这个页面 https://gitee.com/personal_access_tokens 生成你的token,然后建立空白仓库且初始化master分支。可以看这里 https://gitee.com/help/articles/4122

然后配置up.php的字段。

define("TYPE","GITEE");//选择gitee
define("USER","pic-cdn");//你的GitHub/Gitee的用户名
define("REPO","cdn2");//必须是上面用户名下的 公开仓库
define("MAIL","[email protected]");//邮箱无所谓,随便写
define("TOKEN","YourToken");

就可以享受白嫖带来的乐趣了!

2.配置数据库:

请确保把源码目录下的 pic.sql 导入到你的数据库,然后更改相关配置项。

$database = array(
        'dbname' => 'YourDbName',//你的数据库名字
        'host' => 'localhost',
        'port' => 3306,
        'user' => 'YourDbUser',//你的数据库用户名
        'pass' => 'YourDbPass',//你的数据库用户名对应的密码
    );
$table = 'remote_imgs'; //表名字

3. Enjoy it!


更新记录:

  • 2021.03.14

    chuibi.cn 提供跨域上传功能,可以在登陆后设置Origin白名单,同时提供单文件模板,让你两分钟内把autoPicCdn部署到任意Html托管平台。更多内容请登录后查看。

  • 2020.10.25

    Github上传的文件生成CDN链接不再采用branch参数,而是直接调用Push后的sha值。解决了仓库大小限制问题【已经通过chuibi.cn在线测试】与Github不再使用master分支的问题。

  • 2020.10.16

    添加gitee线上版本,详情见 https://chuibi.net/

  • 2020.07.07

    添加gitee上传方式,请在使用的同时遵循相关法律。

  • 2020.05.18

    优化Github线上版本,现已经开放接口,可用于对接PicGo等本地客户端。详情见 https://chuibi.cn/

  • 2020.05.17

    添加Github线上版本,可以在我们的网站直接配置仓库信息,而不必搭建。详情见 https://chuibi.cn/

  • 2020.04.21

    优化交互提示,添加粘贴板上传(Chrome)。

  • 2020.04.21

    换了一套前端,同时支持数据库记录文件Md5,相同md5文件第二次上传会直接从数据库调用。

  • 2020.03.27

    重写交互方式,且现已支持PicGo中的web-uploader插件(Zqian),配置API地址就写up.php的地址,POST参数填写pic

线上版本:

  • https://chuibi.cn/

    支持Github的在线上传与API接口。通过github授权登录并设置仓库等信息后可用。

  • https://chuibi.net/

    支持Gitee的在线上传与API接口。通过gitee授权登录并设置仓库等信息后可用。

bug提交:

目前程序对于自用来说,应该问题不大。当然也不排除有未考虑到的bug。
鉴于程序特殊性,在issue中只提交一个截图是没办法解决问题。
如果在多次尝试后还是不能使用的话,可以发送配置信息或者ftp信息到邮箱 2[at]33.al。
暂不接受单截图、单提示 等无效bug信息提交。

如果有帮助到你 欢迎赞赏 http://33.al/donate

autopiccdn's People

Contributors

yumusb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autopiccdn's Issues

大佬可以加一个简单的管理页面吗

把图片存进去
后面重复利用图片的话直接在后台提取。不用二次上传了
不用分什么游客之类的,都是自用的,设置个简单的密码就可以了。

建议去掉Gitee

Gitee虽然没说限制外链,但是一旦外链调用过多,直接就会封锁仓库
例子:
lxk0301的jd_scripts仓库

总的来说,Gitee已经不适合白嫖了

分支问题

如果不是用的master分支,而是用的img子分支,能否加个分支选项呢?

web-uploader配置问题

请问大佬什么地方填写错了呢
image

生成了链接是这样的

%EF%BB%BF%7B%22code%22:%22success%22,%22data%22:%7B%22filename%22:%222021%5C/01%5C/22%5C/3b75c9.png%22,%22url%22:%22https:%5C/%5C/cdn.jsdelivr.net%5C/gh%5C/weimanMK%5C/TuChuang%5C/2021%5C/01%5C/22%5C/3b75c9.png%22%7D%7D

提交一个 sharex 设置

{
  "Version": "13.1.0",
  "DestinationType": "ImageUploader",
  "RequestMethod": "POST",
  "RequestURL": "域名/up.php",
  "Body": "MultipartFormData",
  "FileFormName": "pic",
  "URL": "$json:data.url$"
}

返回的链接无法访问

  1. 问题:返回的链接无法访问
  1. 解决方法:
  1. 注意:
  • 旧仓库(主分支为master)时不会出现这种情况
  • 新建的仓库(主分支为main)才会出现这种情况

固定仓库

能做个固定仓库版,加后台用于管理图片和那个仓库

请求上传接口出现异常

之前用的好好的,更换服务器之后就出现了请求上传出现异常,国内外服务器测试都有这个提示。

PicGo上传后返回链接

大哥,使用PicGo上传后返回链接的链接都是形如{"code":"success","data":{"url":"https://cdn.jsdelivr.net/gh/nangongxiaoxin/img@fcdc43c398c2f0804f1092d6815e60cf5ea59eb8/2021/02/19/091beb3de43f7782355099c21a71208f.png","filemd5":"07a1f426de4c7d36d7981c486d55c705"}}这种,该调整哪个位置才能变成像https://cdn.jsdelivr.net/gh/nangongxiaoxin/img@fcdc43c398c2f0804f1092d6815e60cf5ea59eb8/2021/02/19/091beb3de43f7782355099c21a71208f.png 这样的正常链接

提示“上传失败,我们会尽快修复”

我将 autoPicCdn 放在了phpEnv建立的本地环境下,配置 MySQL 和 up.php 后,拖入图片没有上传成功,在 tokens 管理页显示 token 没有被使用过。

而PicGo可以上传成功。

是否可以开放后端接口

我是一个程序员,我会想要重新自己写一个前端,直接用python的requests进行POST请求这个文件并处理返回的JSON,但我不知道上传到up.php的name是什么,相当于html里form的input name是什么。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.