no-style-please2 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +26 -4
- data/_config.yml +6 -0
- data/_includes/encrypted.html +68 -4
- data/_includes/post_list.html +1 -2
- data/_includes/postitem.html +11 -0
- data/_layouts/archive.html +1 -2
- data/_layouts/tagpage.html +1 -3
- data/assets/image/lock.svg +7 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18874d617afbc3b090611e8c116f74ced4dc84f5620137ba864b662aac85b995
|
4
|
+
data.tar.gz: fa7008e985c74baa0468222af02105a9691ddc7a18f76b0ca9c24ab22ddd2f0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a71db2e8b501fcb6b37df96ef594387ebc28bd1a1c274f650fb725529cf60c0c3352a4607eb44d9a4428e1bde24f0ac4b395efdca2b6b492b50183426eb5a5
|
7
|
+
data.tar.gz: 96acf13b7abd37fb66357282ff28834f095f9563136a9e06b8f0fa197c6e2e31aa75daf047bdf4e24a6431c0984ce90247d654bbbbc8216e063ea57a4e22fe50
|
data/README.md
CHANGED
@@ -7,9 +7,9 @@ Inspired by [elly's site](http://tilde.town/~elly/) [riggraz](https://riggraz.de
|
|
7
7
|
|
8
8
|
<img src="https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/featured-image.png" />
|
9
9
|
|
10
|
-
|
10
|
+
# Features
|
11
11
|
|
12
|
-
+
|
12
|
+
+ # new
|
13
13
|
+ tags support
|
14
14
|
+ mathjax , inluce_code post_link support, include support, link to other post
|
15
15
|
+ encrytion support. Only those who know the password can view the article
|
@@ -18,12 +18,34 @@ Inspired by [elly's site](http://tilde.town/~elly/) [riggraz](https://riggraz.de
|
|
18
18
|
ONLY textual contents of article will be encrypted ,the pictures will **NOT** be encrypted
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
# Encrypt your post
|
22
22
|
|
23
|
+
Here are two options for encrypting your password: the first is a web-based method, and the second involves using a Ruby tool. We highly recommend choosing the web-based method.
|
23
24
|
|
24
|
-
> ✧ Using this [web tool, it's very convenient to complete the following tasks](https://vitock.github.io/jekyll-zeta/
|
25
|
+
> ✧ Using this [web tool, it's very convenient to complete the following tasks](https://vitock.github.io/jekyll-zeta/Proctect-your-password)
|
25
26
|
|
27
|
+
1. get your privateKey
|
28
|
+
open the website 'https://vitock.github.io/jekyll-zeta/Proctect-your-password'
|
29
|
+

|
26
30
|
|
31
|
+
2. encrypt Your password
|
32
|
+

|
33
|
+
|
34
|
+
3. edit the `_config.yml`
|
35
|
+
|
36
|
+

|
37
|
+
|
38
|
+
4. set your private Key to github ci
|
39
|
+

|
40
|
+

|
41
|
+
|
42
|
+
5. push the repo
|
43
|
+
|
44
|
+
## using web tool
|
45
|
+
|
46
|
+
1. generate keypair through this website
|
47
|
+
|
48
|
+
## using ruby tool
|
27
49
|
|
28
50
|
|
29
51
|
1. generate your own public & private key to protect your password
|
data/_config.yml
CHANGED
@@ -60,3 +60,9 @@ enc_tags:
|
|
60
60
|
- tag: encrypt2
|
61
61
|
# 123
|
62
62
|
password: AQAQACAAIQCvWkhJdhn0b21Pz381AdTeMLb5bRO4d2F3usQtpIL0fDD0G8cg4klENXxJNX+rAHwD8VW2iJo4hZKDQrjdOjbJFugo60XnMmbdLEfzXpkqGpjjbe875/owWyNnGGPk3Vf4
|
63
|
+
- tag: encrypt_abc
|
64
|
+
# abc
|
65
|
+
password: AQAQACAAIQCX8chuGK6MCLP9eGuTUCcmHwjxAQv74m/iir3IzZU1j9JPyGnfi2qGNcU3dryjTT8Co4V6vRtgbnl3onQBcO3hcC8FgCd9KJpe/F59TIdmyEPTER1U2OSG5xo6jsFzsAxt
|
66
|
+
- tag: encrypt_456
|
67
|
+
|
68
|
+
password: AQAQACAAIQASewKsG2ThLm8E0ZQEvTxhoQ3VbVDECINAwi9mxoHJiT5xI8pjCMgfeSpx3q4WpusD6EaCifx7ZjeZeVfdZDVKIJ86CIZbyMPLNwJoNP1K/XWbCiyvtzoMF5nbBtkIgKeJ
|
data/_includes/encrypted.html
CHANGED
@@ -25,13 +25,28 @@
|
|
25
25
|
var exports = exports || {}
|
26
26
|
</script>
|
27
27
|
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.2/js/base64js.js"></script>
|
28
|
+
|
29
|
+
<script>
|
30
|
+
|
31
|
+
|
32
|
+
</script>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
28
37
|
<script>
|
38
|
+
|
39
|
+
|
40
|
+
{% assign HEXKEY = '' | rand_bytes:32 %}
|
41
|
+
const keyData = "{{ '' | encrypt_key:page,HEXKEY ,encid}}"
|
42
|
+
const contentEnc = '{{ content | encrypt_content_v2:HEXKEY }}'
|
43
|
+
|
29
44
|
!function(){
|
30
45
|
|
31
46
|
const substl = crypto.subtle
|
32
47
|
const preFix = '{{encid}}';
|
33
48
|
const encid = preFix
|
34
|
-
const encryptedContent =
|
49
|
+
const encryptedContent = contentEnc;
|
35
50
|
const base64str = encryptedContent.substring(3)
|
36
51
|
const bfMsg = base64js.decode(base64str)
|
37
52
|
const bfIv = bfMsg.subarray(0,12)
|
@@ -47,7 +62,50 @@
|
|
47
62
|
return await substl.deriveBits(pbkdf2,key,256);
|
48
63
|
}
|
49
64
|
|
65
|
+
async function decryptRaw(msg64,key){
|
66
|
+
const base64str = msg64.substring(3)
|
67
|
+
const bfMsg = base64js.decode(base64str)
|
68
|
+
const bfIv = bfMsg.subarray(0,16)
|
69
|
+
const bfCipher = bfMsg.subarray(16)
|
50
70
|
|
71
|
+
var aeskey = {
|
72
|
+
name:"AES-CBC",
|
73
|
+
}
|
74
|
+
var keyObj = await substl.importKey('raw',key,aeskey,false,['decrypt'])
|
75
|
+
var aesDec= {name: "AES-CBC",iv:bfIv}
|
76
|
+
var bfDec
|
77
|
+
try{
|
78
|
+
bfDec = await substl.decrypt(aesDec,keyObj,bfCipher)
|
79
|
+
}catch (error) {
|
80
|
+
console.log(error)
|
81
|
+
throw error
|
82
|
+
}
|
83
|
+
|
84
|
+
return new Uint8Array(bfDec)
|
85
|
+
}
|
86
|
+
async function checkKey(key){
|
87
|
+
{% assign TestData = '' | rand_bytes:12 %}
|
88
|
+
var testData = '{{ TestData }}';
|
89
|
+
var testDataEnc = '{{ TestData | encrypt_content_v2:HEXKEY }}';
|
90
|
+
|
91
|
+
let arrKeys = keyData.split('#')
|
92
|
+
let keyBf = null
|
93
|
+
for (let i = 0; i < arrKeys.length; i++) {
|
94
|
+
const element = arrKeys[i];
|
95
|
+
try{
|
96
|
+
|
97
|
+
let d = await decryptRaw(element,key)
|
98
|
+
let dec = await decryptRaw(testDataEnc,d)
|
99
|
+
if((new TextDecoder).decode(dec) == testData ){
|
100
|
+
keyBf = d;
|
101
|
+
break;
|
102
|
+
}
|
103
|
+
}catch (e){
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
return keyBf
|
108
|
+
}
|
51
109
|
|
52
110
|
async function decrypt (key0,isCached){
|
53
111
|
// const key = Uint8Array([...]); // 32 bytes key
|
@@ -65,13 +123,18 @@
|
|
65
123
|
}
|
66
124
|
|
67
125
|
var aeskey = {
|
68
|
-
name:"AES-
|
126
|
+
name:"AES-CBC",
|
69
127
|
length:256
|
70
128
|
}
|
129
|
+
|
71
130
|
var keyObj = await substl.importKey('raw',key,aeskey,false,['decrypt'])
|
72
|
-
var aesDec= {name: "AES-
|
131
|
+
var aesDec= {name: "AES-CBC",iv:bfIv}
|
73
132
|
try {
|
74
|
-
|
133
|
+
let keyBf = await checkKey(key)
|
134
|
+
if(!keyBf){
|
135
|
+
throw 'error psw'
|
136
|
+
}
|
137
|
+
var bfDec = await decryptRaw(contentEnc,keyBf)
|
75
138
|
var plain = new TextDecoder().decode(bfDec);
|
76
139
|
setKey(key)
|
77
140
|
document.getElementById("encrypted").style.display = 'none'
|
@@ -92,6 +155,7 @@
|
|
92
155
|
|
93
156
|
}, 500);
|
94
157
|
} catch (error) {
|
158
|
+
console.log(error)
|
95
159
|
alert("wrong password.")
|
96
160
|
}
|
97
161
|
}
|
data/_includes/post_list.html
CHANGED
@@ -14,8 +14,7 @@
|
|
14
14
|
<ul>
|
15
15
|
{%- for post in posts limit: include.limit -%}
|
16
16
|
<li>
|
17
|
-
|
18
|
-
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
|
17
|
+
{% include postitem.html post=post%}
|
19
18
|
</li>
|
20
19
|
{%- endfor -%}
|
21
20
|
{%- if include.show_more and limit_exceeded -%}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{% capture archive_date_titleformat %} {{ site.theme_config.archive_title_date_format | default: "%m-%d"}}{% endcapture %}
|
2
|
+
{%- assign post = include.post -%}
|
3
|
+
{%- assign fmt = include.fmt | default:archive_date_titleformat -%}
|
4
|
+
|
5
|
+
{% assign encid = '' | get_encrypt_id:post | default: "" %}
|
6
|
+
<span>{{- post.date | date: fmt }}</span>
|
7
|
+
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}
|
8
|
+
{%- if encid.size > 1 -%}
|
9
|
+
<img style="width:12px;height:12px;display: inline;margin-left: 5px;" src="{{ 'assets/image/lock.svg' | relative_url}}">
|
10
|
+
{%- endif -%}
|
11
|
+
</a>
|
data/_layouts/archive.html
CHANGED
@@ -27,8 +27,7 @@ layout: default
|
|
27
27
|
{% assign ymPre = ymCur %}
|
28
28
|
|
29
29
|
<li>
|
30
|
-
|
31
|
-
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
|
30
|
+
{% include postitem.html post=post%}
|
32
31
|
</li>
|
33
32
|
|
34
33
|
{%- endfor -%}
|
data/_layouts/tagpage.html
CHANGED
@@ -7,9 +7,7 @@ layout: default
|
|
7
7
|
|
8
8
|
<ul>
|
9
9
|
{% for post in site.tags[page.tag] %}
|
10
|
-
<li
|
11
|
-
{{ post.description }}
|
12
|
-
</li>
|
10
|
+
<li>{% include postitem.html post=post fmt="%Y-%m-%d" %}</li>
|
13
11
|
{% endfor %}
|
14
12
|
|
15
13
|
{% if site.theme_config.tag_showall %}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg" t="1685339750585" class="icon" version="1.1" p-id="3294">
|
2
|
+
<g>
|
3
|
+
<title>Layer 1</title>
|
4
|
+
<path d="m160.80336,228.40263l177.01586,0l0,-67.57791q0,-37.30864 -25.93006,-63.70627t-62.57787,-26.39763t-62.57787,26.39763t-25.93006,63.70627l0,67.57791l0,0zm287.65078,33.78896l0,202.73375q0,14.07874 -9.68056,23.93385t-23.50992,9.85512l-331.90475,0q-13.82936,0 -23.50992,-9.85512t-9.68056,-23.93385l0,-202.73375q0,-14.07874 9.68056,-23.93385t23.50992,-9.85512l11.0635,0l0,-67.57791q0,-64.76217 45.6369,-111.22199t109.25198,-46.45982t109.25198,46.45982t45.6369,111.22199l0,67.57791l11.06349,0q13.82936,0 23.50992,9.85512t9.68056,23.93385l0,0z" p-id="3295" id="svg_1"/>
|
5
|
+
</g>
|
6
|
+
|
7
|
+
</svg>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-style-please2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vitock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.8.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- r
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- _includes/main.css
|
59
59
|
- _includes/menu_item.html
|
60
60
|
- _includes/post_list.html
|
61
|
+
- _includes/postitem.html
|
61
62
|
- _layouts/archive.html
|
62
63
|
- _layouts/default.html
|
63
64
|
- _layouts/heatmap.html
|
@@ -69,6 +70,7 @@ files:
|
|
69
70
|
- _sass/heatmap.scss
|
70
71
|
- _sass/no-style-please.scss
|
71
72
|
- assets/css/main.scss
|
73
|
+
- assets/image/lock.svg
|
72
74
|
- assets/js/mouse_coords.js
|
73
75
|
homepage: https://github.com/vitock/no-style-please
|
74
76
|
licenses:
|