All Projects → theme-next → hexo-leancloud-counter-security

theme-next / hexo-leancloud-counter-security

Licence: LGPL-3.0 license
A plugin to fix a serious security bug in leancloud visitor counter for NexT.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hexo-leancloud-counter-security

Hexo Theme Nlvi
🎨A simple theme for hexo.
Stars: ✭ 213 (+587.1%)
Mutual labels:  hexo
Hexo Theme Geek
一个符合极客精神主义极简的 Hexo 主题
Stars: ✭ 251 (+709.68%)
Mutual labels:  hexo
cats-blog
Blog for my cats, pidan & doufu
Stars: ✭ 13 (-58.06%)
Mutual labels:  hexo
Hexo Theme Cafe
精简的Hexo博客主题,样式风格如阮一峰老师博客
Stars: ✭ 215 (+593.55%)
Mutual labels:  hexo
Hexo Theme Landscape
A brand new default theme for Hexo.
Stars: ✭ 243 (+683.87%)
Mutual labels:  hexo
hexo-theme-quark
a simple hexo theme https://pcrab.xyz
Stars: ✭ 34 (+9.68%)
Mutual labels:  hexo
Hexo Theme Jsimple
Simple three columns theme for Hexo.Inspired by JianShu.com
Stars: ✭ 210 (+577.42%)
Mutual labels:  hexo
hexo-theme-mip
Hexo MIP 模板
Stars: ✭ 15 (-51.61%)
Mutual labels:  hexo
Hexo Theme Daily
A simple theme for Hexo
Stars: ✭ 246 (+693.55%)
Mutual labels:  hexo
hexo-component-inferno
A collection of Inferno.js layout components and utility scripts for Hexo
Stars: ✭ 20 (-35.48%)
Mutual labels:  hexo
Hexo All Minifier
A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.
Stars: ✭ 224 (+622.58%)
Mutual labels:  hexo
Hexo Theme Fluid
🌊 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
Stars: ✭ 3,700 (+11835.48%)
Mutual labels:  hexo
hexo-reading-time
Plugin for Hexo CMS to display reading time for article
Stars: ✭ 28 (-9.68%)
Mutual labels:  hexo
Hexo Editor
An editor for hexo blog.
Stars: ✭ 213 (+587.1%)
Mutual labels:  hexo
Lap
a hexo theme
Stars: ✭ 18 (-41.94%)
Mutual labels:  hexo
Hexo Abbrlink
create one and only link for every post for hexo
Stars: ✭ 212 (+583.87%)
Mutual labels:  hexo
Hexo Theme Indigo
一个Material Design风格的Hexo主题。 https://imys.net/    备用:
Stars: ✭ 2,748 (+8764.52%)
Mutual labels:  hexo
blog
Source code of my blog
Stars: ✭ 64 (+106.45%)
Mutual labels:  hexo
hexo-theme-lessless
the simple theme for hexo. which has no futures, just very simple.
Stars: ✭ 11 (-64.52%)
Mutual labels:  hexo
hexo-theme-sungod
一款定制化的Hexo博客主题
Stars: ✭ 470 (+1416.13%)
Mutual labels:  hexo

hexo-leancloud-counter-security

npm-image node-image hexo-image travis-image lic-image

A plugin to fix a serious security bug in leancloud visitor counter for NexT theme site and other site that integrated this function using a similar way.

Documentation how to set the counter up and running safely aviable in English or Chinese languages.

And you can also read full explanation of current problem here.

Installation

size-image dm-image dt-image

npm install hexo-leancloud-counter-security

Usage

Activate this plugin in hexo's _config.yml (which locates in the root dir of your blog) by filling those options:

leancloud_counter_security:
  enable_sync: true
  app_id: <your app id>
  app_key: <your app key>
  server_url: <your server url> # Required for apps from CN region, e.g. https://leancloud.cn
  username: <your username> # Will be asked while deploying if is left blank
  password: <your password> # Recommmended to be left blank. Will be asked while deploying if is left blank

If leancloud_counter_security not specified (or commented), plugin will totally disabled.

NexT theme

This plugin integrated in «NexT» and after plugin enabled in main Hexo config, need to enable options in NexT config:

leancloud_visitors:
  enable: true
  app_id: <your app id>
  app_key: <your app key>
  # Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security
  security: true

You should build the Leancloud background first to make the counter active.

After that, install this plugin and config it to make the counter safe.

Console Command

hexo lc-counter register <username> <password>

or

hexo lc-counter r <username> <password>

Register a user in your Leancloud database for authority control.

TroubleShooting

fail to sync records to the leancloud database

For purpose of avoiding the 429 error code (Too Many Request) from leancloud, this plugin use a local database to store the records which have been successfully synchronized to the leancloud. Only the records that are not in the local database will be synchronized. This feature reduces the request quantity to avoid 429 error. The local databases is a json file named leancloud.memo in <blog directory>/source. Delete the leancloud.memo will not cause other flaws.

If you failed to sync records to the leancloud and you are sure about the plugin causes the fault. You can delete the leancloud.memo and deploy again. The command is following.

rm <blog directory>/source/leancloud.memo
hexo d
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].