{"id":21182419,"url":"https://github.com/theme-next/hexo-leancloud-counter-security","last_synced_at":"2025-07-10T00:32:21.043Z","repository":{"id":51249559,"uuid":"119045950","full_name":"theme-next/hexo-leancloud-counter-security","owner":"theme-next","description":"A plugin to fix a serious security bug in leancloud visitor counter for NexT.","archived":false,"fork":false,"pushed_at":"2021-05-19T04:42:39.000Z","size":122,"stargazers_count":33,"open_issues_count":6,"forks_count":10,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-03-23T03:22:51.049Z","etag":null,"topics":["hexo","leancloud","leancloud-database","leancloud-visitor-counter","security"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theme-next.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-26T11:50:07.000Z","updated_at":"2023-12-12T02:14:20.000Z","dependencies_parsed_at":"2022-09-26T19:00:27.105Z","dependency_job_id":null,"html_url":"https://github.com/theme-next/hexo-leancloud-counter-security","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theme-next%2Fhexo-leancloud-counter-security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theme-next%2Fhexo-leancloud-counter-security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theme-next%2Fhexo-leancloud-counter-security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theme-next%2Fhexo-leancloud-counter-security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theme-next","download_url":"https://codeload.github.com/theme-next/hexo-leancloud-counter-security/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225606632,"owners_count":17495551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexo","leancloud","leancloud-database","leancloud-visitor-counter","security"],"created_at":"2024-11-20T17:56:57.879Z","updated_at":"2024-11-20T17:56:58.615Z","avatar_url":"https://github.com/theme-next.png","language":"JavaScript","readme":"# hexo-leancloud-counter-security\n\n[![npm-image]][npm-url]\n[![node-image]][node-url]\n[![hexo-image]][hexo-url]\n[![travis-image]][travis-url]\n[![lic-image]](LICENSE)\n\nA 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.\n\nDocumentation how to set the counter up and running safely aviable in [English](https://github.com/theme-next/hexo-theme-next/blob/master/docs/LEANCLOUD-COUNTER-SECURITY.md) or [Chinese](https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/LEANCLOUD-COUNTER-SECURITY.md) languages.\n\nAnd you can also read full explanation of current problem [here](https://leaferx.online/2018/02/11/lc-security/).\n\n## Installation\n\n![size-image]\n[![dm-image]][npm-url]\n[![dt-image]][npm-url]\n\n```bash\nnpm install hexo-leancloud-counter-security\n```\n\n## Usage\n\nActivate this plugin in hexo's `_config.yml` (which locates in the root dir of your blog) by filling those options:\n\n```yml\nleancloud_counter_security:\n  enable_sync: true\n  app_id: \u003cyour app id\u003e\n  app_key: \u003cyour app key\u003e\n  server_url: \u003cyour server url\u003e # Required for apps from CN region, e.g. https://leancloud.cn\n  username: \u003cyour username\u003e # Will be asked while deploying if is left blank\n  password: \u003cyour password\u003e # Recommmended to be left blank. Will be asked while deploying if is left blank\n```\n\nIf `leancloud_counter_security` not specified (or commented), plugin will totally disabled.\n\n### NexT theme\n\nThis plugin integrated in «NexT» and after plugin enabled in main Hexo config, need to enable options in NexT config:\n\n```yml\nleancloud_visitors:\n  enable: true\n  app_id: \u003cyour app id\u003e\n  app_key: \u003cyour app key\u003e\n  # Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security\n  security: true\n```\n\nYou should build the Leancloud background first to make the counter active.\n\nAfter that, install this plugin and config it to make the counter safe.\n\n### Console Command\n\n```bash\nhexo lc-counter register \u003cusername\u003e \u003cpassword\u003e\n```\n\nor\n\n```bash\nhexo lc-counter r \u003cusername\u003e \u003cpassword\u003e\n```\n\nRegister a user in your Leancloud database for authority control.\n\n## TroubleShooting\n\n### fail to sync records to the leancloud database\n\nFor 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 `\u003cblog directory\u003e/source`. Delete the `leancloud.memo` will not cause other flaws.\n\nIf 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.\n\n```bash\nrm \u003cblog directory\u003e/source/leancloud.memo\nhexo d\n```\n\n[npm-image]: https://img.shields.io/npm/v/hexo-leancloud-counter-security?style=flat-square\n[node-image]: https://img.shields.io/node/v/hexo-leancloud-counter-security?style=flat-square\n[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.0-blue?style=flat-square\n[travis-image]: https://img.shields.io/travis/theme-next/hexo-leancloud-counter-security/master?style=flat-square\n[lic-image]: https://img.shields.io/npm/l/hexo-leancloud-counter-security?style=flat-square\n\n[size-image]: https://img.shields.io/github/languages/code-size/theme-next/hexo-leancloud-counter-security?style=flat-square\n[dm-image]: https://img.shields.io/npm/dm/hexo-leancloud-counter-security?style=flat-square\n[dt-image]: https://img.shields.io/npm/dt/hexo-leancloud-counter-security?style=flat-square\n\n[npm-url]: https://www.npmjs.com/package/hexo-leancloud-counter-security\n[node-url]: https://nodejs.org/en/download/releases\n[hexo-url]: https://hexo.io\n[travis-url]: https://travis-ci.org/theme-next/hexo-leancloud-counter-security?branch=master\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheme-next%2Fhexo-leancloud-counter-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheme-next%2Fhexo-leancloud-counter-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheme-next%2Fhexo-leancloud-counter-security/lists"}