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
QQ头像链接加密 #148
QQ头像链接加密 #148
Conversation
e933b37
to
f2a96c3
Compare
functions.php
Outdated
if ( !$wpdb->get_var("SELECT COUNT(*) FROM $sakura_table_name WHERE mate_key = 'pubkey'") ){ | ||
$pubkey = array( | ||
"mate_key" => "pubkey", | ||
"mate_value" => file_get_contents(get_template_directory()."/manifest/public.key") |
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.
public.key 放到其他文件夹吧,这个文件夹只是拿来搞缩略图的
manifest/manifest.py
Outdated
return self.mani | ||
|
||
|
||
class Upload2Wordpress: |
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.
class Upload2Wordpress(object)
manifest/manifest.py
Outdated
up_json = Single(f, Manifest) | ||
up_json.upload_manifest() | ||
|
||
def gen_key_pairs(): |
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.
RSA这一块放其他文件夹吧,manifest 以后考虑要作为一个 git 仓库 push 的,manifest.py 准备在GUI里面作为一个库引用的,多余的import会增加编译的量。
manifest/private.key
Outdated
@@ -0,0 +1,15 @@ | |||
-----BEGIN RSA PRIVATE KEY----- |
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.
可以考虑用python或者shell自动生成公私钥
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.
或者更好的是php生成一个存数据库里面,不然公私钥不是大家都可以通过url拿到了么。。
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.
这是用python生成的,之后会存到数据库里。因为openssl.cnf
的路径各运行环境不相同,所以放弃了用php生成。
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.
inc/api.php
Outdated
}else{ | ||
$response = new WP_REST_Response(); | ||
$response->set_status(302); | ||
$response->header('Location', $imgurl); |
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.
最好从评论输出那边动手。如果启用加密,则页面上的评论头像直接显示API的url,如果不启用加密,则直接显示https://q2.qlogo.cn 下头像的url。否则产生的请求数太多了,没必要。
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.
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.
啊,这地方我写错了,是有选项选择输出头像的方式的
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.
修改中 |
ece9097
to
e8e5630
Compare
No description provided.