Giter VIP home page Giter VIP logo

discourse-qiniu-helper's Introduction

Discourse 使用七牛 CDN 的话,存在上传新头像后获取到85B的空文件问题,在网站上表现为用户头像空白。该脚本能自动删除这些错误图片,七牛会重新抓取到正常的头像图片。

有关这个问题的讨论见这里

该脚本只是一个权宜之计,并不能完美解决这个问题,但是能很大程度上避免人工操作的烦恼。可以等待官方或七牛出更好的解决方案。

##安装

安装依赖库

sudo pip install qiniu
sudo pip install pyyaml

在home目录下下载本脚本

git clone https://github.com/wuchong/discourse-qiniu-helper.git

##配置

_config.yml文件中,填写您的七牛Access相关参数以及您的站点域名。

##执行

python ~/discourse-qiniu-helper/helper.py

建议将该脚本设置为定期任务,每天自动执行一次。可查看qiniu.log文件了解运行情况。

discourse-qiniu-helper's People

Contributors

wuchong avatar

Watchers

 avatar

Forkers

mba811

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.