Skip to content
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

Merged
merged 5 commits into from Dec 13, 2019
Merged

QQ头像链接加密 #148

merged 5 commits into from Dec 13, 2019

Conversation

spirit1431007
Copy link
Collaborator

No description provided.

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")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public.key 放到其他文件夹吧,这个文件夹只是拿来搞缩略图的

return self.mani


class Upload2Wordpress:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class Upload2Wordpress(object)

up_json = Single(f, Manifest)
up_json.upload_manifest()

def gen_key_pairs():
Copy link
Owner

@mashirozx mashirozx Dec 4, 2019

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会增加编译的量。

@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以考虑用python或者shell自动生成公私钥

Copy link
Owner

@mashirozx mashirozx Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或者更好的是php生成一个存数据库里面,不然公私钥不是大家都可以通过url拿到了么。。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是用python生成的,之后会存到数据库里。因为openssl.cnf的路径各运行环境不相同,所以放弃了用php生成。

Copy link
Owner

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);
Copy link
Owner

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。否则产生的请求数太多了,没必要。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,这地方我写错了,是有选项选择输出头像的方式的

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spirit1431007
Copy link
Collaborator Author

修改中

@mashirozx mashirozx merged commit dedda71 into mashirozx:dev Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants