-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix leancloud counter security bug #137
Conversation
😂 |
_config.yml
Outdated
leancloud_visitors: | ||
enable: false | ||
security: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add short readme for dependencies here.
the link on the readme is not available now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to default to true
of security
_config.yml
Outdated
leancloud_visitors: | ||
enable: false | ||
security: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not default to true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because need to install plugin separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I mean just like the gitmint, default to true, and ask the user to install the plugin.
Security is important, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important, but LC can work without security plugin.
} | ||
}); | ||
{% if theme.leancloud_visitors.security %} | ||
console.log('Counter not initialized!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i see what here is security
option just add warning in console log. There is some my 5 cents on it:
- Replace
console.log
withhexo.log.warn
for better warning message. security
can be set totrue
by default. So, if user wan't to install security plugin, he can turn offsecurity
option. If he don't know about security (newbie in NexT) and just turn on LC option, he will seen this warning message with following instructions to install plugin.- Warning message should be informative. Instead of
Counter not initialized!
something likeATTENTION! LeanCloud counter have security bug, for solve it see here: https://github.com/theme-next/hexo-leancloud-counter-security
.
OR
We can just cut out security
option and add in NexT config comments under leancloud options what there are some security issues and can be solved under the plugin link. For now option — it's just console warning, no more. Who know about this — will know, option will be useless, i think. 1 excess interation in swig. That's what i suggest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this file is excuted in browser where there is no hexo.log.warn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! So, why this warn needed if user will not see it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because if they turn on the security
but not install the plugin and follow the instruction to config th e Leancloud background, the counter will not work at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now the error msg on browser is like this: |
Yeah, it's good for now! Well done! 👍 |
so the config is default to true now. |
Em.. i think need to false. But other guys sugessted to true it. Need to make a decision about it.
Also, need to provide some badges for this repo. NPM link, version, compatability, etc. Post not found: https://leaferx.online/2018/02/11/lc-security/ |
badges added. |
Now that docs has been released. |
Question need discussion: what default value of security should be set |
Guys, can we please to deside this option? |
@wafer-li @tsanie @maple3142 @ivan-nginx |
@LEAFERx @tsanie @maple3142 @ivan-nginx What about making a vote? I still vote for default to |
@sli1989 @wafer-li @tsanie @maple3142 anybody of u can today translate from CN docs to EN docs? |
It's better for @LEAFERx to do it...😅 |
fix leancloud counter security bug
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number(s): #25