no-style-please2 0.9.1 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -4
- data/_config.yml +6 -0
- data/_includes/encrypted.html +109 -10
- data/_includes/head.html +7 -7
- data/_includes/post_list.html +1 -2
- data/_includes/postitem.html +11 -0
- data/_layouts/archive.html +1 -2
- data/_layouts/heatmap.html +11 -0
- data/_layouts/tagpage.html +1 -3
- data/assets/image/lock.svg +7 -0
- metadata +6 -5
- data/_includes/main.css +0 -94
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1153b0ca84cca1f649bbc632a249df3c01b028d2bc9c4afe21bac1ef2ca4662
|
4
|
+
data.tar.gz: aa9b649d2f6b76789fc9872c75a76ba580dfc41b08518e66b7deb934ebde7ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d27d229ca31b46aff72e88311ab2c751f6d02c4fbe8437b6b9765a3e2bd938d2914e621cc94ff694f1f737a6aca10dc285d896d01e0b003f5316f10dbbb58f1
|
7
|
+
data.tar.gz: 6beac21e1b80e63c40399da8d12f2663e20f44993b7e8b487c639f4d2f0e3065080b0009c94917e4f161fb81e902c35db903b6b7e7bc95c241cb0b88bf8f5aa9
|
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
|
+
![](s1.png)
|
26
30
|
|
31
|
+
2. encrypt Your password
|
32
|
+
![](s2.png)
|
33
|
+
|
34
|
+
3. edit the `_config.yml`
|
35
|
+
|
36
|
+
![alt text](image.png)
|
37
|
+
|
38
|
+
4. set your private Key to github ci
|
39
|
+
![alt text](image-1.png)
|
40
|
+
![alt text](image-2.png)
|
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,34 @@
|
|
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
|
+
function uint8ArrayToHex(uint8Array) {
|
40
|
+
return Array.from(uint8Array)
|
41
|
+
.map(byte => byte.toString(16).padStart(2, '0')) // 转换每个字节为2位16进制
|
42
|
+
.join(''); // 连接成字符串
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
{%- assign HEXKEY = '' | rand_bytes:32 %}
|
48
|
+
const contentEnc = '{{ content | encrypt_content_v2:HEXKEY }}';
|
49
|
+
|
29
50
|
!function(){
|
30
51
|
|
31
52
|
const substl = crypto.subtle
|
32
53
|
const preFix = '{{encid}}';
|
33
54
|
const encid = preFix
|
34
|
-
const encryptedContent =
|
55
|
+
const encryptedContent = contentEnc;
|
35
56
|
const base64str = encryptedContent.substring(3)
|
36
57
|
const bfMsg = base64js.decode(base64str)
|
37
58
|
const bfIv = bfMsg.subarray(0,12)
|
@@ -47,11 +68,90 @@
|
|
47
68
|
return await substl.deriveBits(pbkdf2,key,256);
|
48
69
|
}
|
49
70
|
|
71
|
+
async function decryptRaw(bf,key,outV){
|
72
|
+
if(bf.length < 8){
|
73
|
+
throw 'err'
|
74
|
+
}
|
75
|
+
let count = 0;
|
76
|
+
for (let i = 0; i < 4; i ++) {
|
77
|
+
count |= ((bf[i] ^ bf[i + 4] ^ i) << ((3 - i) * 8))
|
78
|
+
}
|
79
|
+
|
80
|
+
if(outV){
|
81
|
+
outV.count = count
|
82
|
+
}
|
83
|
+
if (bf.length < count) {
|
84
|
+
return
|
85
|
+
}
|
50
86
|
|
87
|
+
let bfIv = bf.slice(4,20)
|
88
|
+
let bfCipher = bf.slice(20,count )
|
89
|
+
|
90
|
+
var aeskey = {
|
91
|
+
name:"AES-CTR",
|
92
|
+
}
|
93
|
+
var keyObj = await substl.importKey('raw',key,aeskey,false,['decrypt'])
|
94
|
+
var aesDec= {name: "AES-CTR",counter:bfIv,length:64};
|
95
|
+
try{
|
96
|
+
let bfDec = await substl.decrypt(aesDec,keyObj,bfCipher)
|
97
|
+
return new Uint8Array(bfDec)
|
98
|
+
}catch (error) {
|
99
|
+
throw error
|
100
|
+
}
|
101
|
+
|
102
|
+
}
|
103
|
+
|
104
|
+
async function decryptBase64Msg(msg64,key){
|
105
|
+
const base64str = msg64;
|
106
|
+
const bfMsg = base64js.decode(base64str)
|
107
|
+
return await decryptRaw(bfMsg,key)
|
108
|
+
|
109
|
+
}
|
110
|
+
async function checkKey(key){
|
111
|
+
const keyData = "{{ '' | encrypt_key:page,HEXKEY ,encid}}";
|
112
|
+
{% assign TestData = '' | rand_bytes: 200 %}
|
113
|
+
const testData = '{{ TestData }}';
|
114
|
+
const testDataEnc = '{{ TestData | encrypt_content_v2:HEXKEY }}';
|
115
|
+
const bfTestData = base64js.decode(testDataEnc)
|
116
|
+
|
117
|
+
|
118
|
+
const bfKeyData = base64js.decode(keyData)
|
119
|
+
let keyBf = null
|
120
|
+
let C = 0;
|
121
|
+
let sum = 0;
|
122
|
+
while (C ++ < 400 ) {
|
123
|
+
if (sum >= bfKeyData.length ) {
|
124
|
+
break
|
125
|
+
}
|
126
|
+
let bfSub = bfKeyData.slice(sum)
|
127
|
+
|
128
|
+
try {
|
129
|
+
let outV = {count:0}
|
130
|
+
let d = await decryptRaw(bfSub,key,outV)
|
131
|
+
|
132
|
+
sum += outV.count
|
133
|
+
if (d) {
|
134
|
+
let dec = await decryptRaw(bfTestData,d)
|
135
|
+
let s = new TextDecoder().decode(dec)
|
136
|
+
if(s == testData){
|
137
|
+
keyBf = d;
|
138
|
+
break;
|
139
|
+
}
|
140
|
+
}else{
|
141
|
+
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
} catch (error) {
|
146
|
+
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
return keyBf
|
151
|
+
}
|
51
152
|
|
52
153
|
async function decrypt (key0,isCached){
|
53
154
|
// const key = Uint8Array([...]); // 32 bytes key
|
54
|
-
|
55
155
|
var key = ''
|
56
156
|
if(isCached){
|
57
157
|
key = readKey()
|
@@ -63,15 +163,12 @@
|
|
63
163
|
if (key.length == 0) {
|
64
164
|
return
|
65
165
|
}
|
66
|
-
|
67
|
-
var aeskey = {
|
68
|
-
name:"AES-GCM",
|
69
|
-
length:256
|
70
|
-
}
|
71
|
-
var keyObj = await substl.importKey('raw',key,aeskey,false,['decrypt'])
|
72
|
-
var aesDec= {name: "AES-GCM",iv:bfIv,tagLength:128}
|
73
166
|
try {
|
74
|
-
|
167
|
+
let keyBf = await checkKey(key)
|
168
|
+
if(!keyBf){
|
169
|
+
throw 'error psw'
|
170
|
+
}
|
171
|
+
var bfDec = await decryptBase64Msg(contentEnc,keyBf)
|
75
172
|
var plain = new TextDecoder().decode(bfDec);
|
76
173
|
setKey(key)
|
77
174
|
document.getElementById("encrypted").style.display = 'none'
|
@@ -92,6 +189,7 @@
|
|
92
189
|
|
93
190
|
}, 500);
|
94
191
|
} catch (error) {
|
192
|
+
console.log(error)
|
95
193
|
alert("wrong password.")
|
96
194
|
}
|
97
195
|
}
|
@@ -121,6 +219,7 @@
|
|
121
219
|
|
122
220
|
document.getElementById("ClearBtn1").onclick = function(){
|
123
221
|
localStorage.clear();
|
222
|
+
document.getElementById('passwordinput').value = ''
|
124
223
|
}
|
125
224
|
document.getElementById("ClearBtn2").onclick = function(){
|
126
225
|
localStorage.clear();
|
data/_includes/head.html
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
5
5
|
|
6
|
-
{
|
6
|
+
{%- if page.mathjax %}
|
7
7
|
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
|
8
8
|
<script type="text/javascript" async src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
|
9
|
-
{
|
9
|
+
{%- endif %}
|
10
10
|
|
11
11
|
<title>
|
12
12
|
{%- if page.title -%}
|
@@ -19,14 +19,14 @@
|
|
19
19
|
{%- if enc == '' -%}
|
20
20
|
{% endif %}
|
21
21
|
|
22
|
-
{
|
23
|
-
{
|
24
|
-
{
|
22
|
+
{%- if site.tags != "" -%}
|
23
|
+
{%- include collecttags.html -%}
|
24
|
+
{%- endif %}
|
25
25
|
|
26
26
|
<link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon | relative_url }}" />
|
27
|
-
|
28
27
|
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
|
29
28
|
|
30
|
-
|
29
|
+
{%- assign rnd = '' | rand_bytes:5 %}
|
30
|
+
<link rel="stylesheet" href="//no-style.kr7y.workers.dev/nostyle.css?{{rnd}}" />
|
31
31
|
|
32
32
|
</head>
|
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/heatmap.html
CHANGED
@@ -58,4 +58,15 @@ generate this page only once。
|
|
58
58
|
|
59
59
|
|
60
60
|
<br>
|
61
|
+
|
62
|
+
{% assign posts_by_year = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}
|
63
|
+
|
64
|
+
|
65
|
+
{% for year in posts_by_year %}
|
66
|
+
{{ year.name }}
|
67
|
+
{% include heatmap.html endYear=year.name title=year.name %}
|
68
|
+
|
69
|
+
{% endfor %}
|
70
|
+
|
71
|
+
|
61
72
|
{{ content }}
|
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.3
|
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-16 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.9.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.9.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- r
|
@@ -55,9 +55,9 @@ files:
|
|
55
55
|
- _includes/head.html
|
56
56
|
- _includes/heatmap.html
|
57
57
|
- _includes/heatmap.js
|
58
|
-
- _includes/main.css
|
59
58
|
- _includes/menu_item.html
|
60
59
|
- _includes/post_list.html
|
60
|
+
- _includes/postitem.html
|
61
61
|
- _layouts/archive.html
|
62
62
|
- _layouts/default.html
|
63
63
|
- _layouts/heatmap.html
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- _sass/heatmap.scss
|
70
70
|
- _sass/no-style-please.scss
|
71
71
|
- assets/css/main.scss
|
72
|
+
- assets/image/lock.svg
|
72
73
|
- assets/js/mouse_coords.js
|
73
74
|
homepage: https://github.com/vitock/no-style-please
|
74
75
|
licenses:
|
data/_includes/main.css
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
body[a="dark"] {
|
2
|
-
filter: invert(1); }
|
3
|
-
body[a="dark"] img {
|
4
|
-
filter: invert(1); }
|
5
|
-
body[a="dark"] img.ioda {
|
6
|
-
filter: invert(0); }
|
7
|
-
|
8
|
-
@media (prefers-color-scheme: dark) {
|
9
|
-
body[a="auto"] {
|
10
|
-
filter: invert(1); }
|
11
|
-
body[a="auto"] img {
|
12
|
-
filter: invert(1); }
|
13
|
-
body[a="auto"] img.ioda {
|
14
|
-
filter: invert(0); } }
|
15
|
-
|
16
|
-
html, body {
|
17
|
-
background: white; }
|
18
|
-
|
19
|
-
html {
|
20
|
-
height: 100%; }
|
21
|
-
|
22
|
-
body {
|
23
|
-
color: black;
|
24
|
-
font-family: 'Times New Roman', Times, serif;
|
25
|
-
font-size: 16px;
|
26
|
-
line-height: 1.6;
|
27
|
-
margin: 0;
|
28
|
-
min-height: 100%;
|
29
|
-
overflow-wrap: break-word; }
|
30
|
-
|
31
|
-
.post-meta {
|
32
|
-
text-align: right; }
|
33
|
-
|
34
|
-
h2, h3, h4, h5, h6 {
|
35
|
-
margin-top: 3rem; }
|
36
|
-
|
37
|
-
hr {
|
38
|
-
margin: 2rem 0; }
|
39
|
-
|
40
|
-
p {
|
41
|
-
margin: 1rem 0; }
|
42
|
-
|
43
|
-
li {
|
44
|
-
margin: 0.4rem 0; }
|
45
|
-
|
46
|
-
*:target {
|
47
|
-
background: yellow; }
|
48
|
-
|
49
|
-
.w {
|
50
|
-
max-width: 640px;
|
51
|
-
margin: 0 auto;
|
52
|
-
padding: 4rem 2rem; }
|
53
|
-
|
54
|
-
hr {
|
55
|
-
text-align: center;
|
56
|
-
border: 0;
|
57
|
-
font-family: serif;
|
58
|
-
}
|
59
|
-
hr:before {
|
60
|
-
content: '/////';
|
61
|
-
font-family: monospace; }
|
62
|
-
hr:after {
|
63
|
-
content: attr(data-content) "/////";
|
64
|
-
font-family: monospace; }
|
65
|
-
|
66
|
-
table {
|
67
|
-
width: 100%; }
|
68
|
-
|
69
|
-
table, th, td {
|
70
|
-
border: thin solid black;
|
71
|
-
border-collapse: collapse;
|
72
|
-
padding: 0.4rem; }
|
73
|
-
|
74
|
-
code {
|
75
|
-
color: white;
|
76
|
-
background: gray; }
|
77
|
-
|
78
|
-
div.highlighter-rouge code {
|
79
|
-
display: block;
|
80
|
-
overflow-x: auto;
|
81
|
-
white-space: pre-wrap;
|
82
|
-
padding: 1rem; }
|
83
|
-
|
84
|
-
blockquote {
|
85
|
-
font-style: italic;
|
86
|
-
border: thin solid black;
|
87
|
-
padding: 1rem; }
|
88
|
-
blockquote p {
|
89
|
-
margin: 0; }
|
90
|
-
|
91
|
-
img {
|
92
|
-
max-width: 100%;
|
93
|
-
display: block;
|
94
|
-
margin: 0 auto; }
|