Skip to content

Commit

Permalink
Merge pull request #494 from hugo-fixit/content-encryption
Browse files Browse the repository at this point in the history
🔒 Perf: enhance content encryption security
  • Loading branch information
Lruihao committed Aug 29, 2024
2 parents ccce5b5 + a67efe4 commit 312b636
Show file tree
Hide file tree
Showing 19 changed files with 239 additions and 457 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# FixIt

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.127.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.129.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)

Expand Down Expand Up @@ -219,6 +219,7 @@ Thanks to all the [contributors](https://github.com/hugo-fixit/FixIt/graphs/cont
- [giscus](https://giscus.app/)
- [crypto-js](https://github.com/brix/crypto-js)
- [pace](https://github.com/CodeByZach/pace)
- [xxhash-wasm](https://github.com/jungomi/xxhash-wasm)

</details>

Expand Down
3 changes: 2 additions & 1 deletion README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# FixIt

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.127.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.129.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)

Expand Down Expand Up @@ -223,6 +223,7 @@ Gitee 镜像仓库:<https://gitee.com/lruihao/FixIt>
- [giscus](https://giscus.app/zh-CN)
- [crypto-js](https://github.com/brix/crypto-js)
- [pace](https://github.com/CodeByZach/pace)
- [xxhash-wasm](https://github.com/jungomi/xxhash-wasm)

</details>

Expand Down
47 changes: 43 additions & 4 deletions assets/css/_partials/_single/_fixit-decryptor.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.fixit-decryptor-container {
font-family: $global-font-family;
text-align: center;
margin-top: 3rem;
margin-block: var(--fixit-decryptor-margin-block);

.fixit-decryptor-loading {
vertical-align: middle;
}

.fixit-decryptor-input,
.fixit-decryptor-btn,
.fixit-encryptor-btn {
display: inline-block;
display: none;
box-sizing: border-box;
outline: none;
color: $global-font-color;
Expand Down Expand Up @@ -60,19 +64,54 @@
background-color: $header-background-color-dark;
}
}

.fixit-encryptor-btn {
display: none;
}
}

// fixit-encryptor shortcodes
fixit-encryptor {
&.initialized > .fixit-decryptor-container {
.fixit-decryptor-input,
.fixit-decryptor-btn {
display: inline-block;
}

.fixit-decryptor-loading {
display: none;
}
}

cipher-text {
display: none !important;
}
}

// fixit-encryptor for for the encrypted pages
article fixit-encryptor {
.fixit-decryptor-container {
margin-top: 1rem;
--fixit-decryptor-margin-block: 2rem;
}
&.decrypted > .fixit-decryptor-container {
.fixit-decryptor-loading,
.fixit-decryptor-input,
.fixit-decryptor-btn {
display: none;
}

.fixit-encryptor-btn {
display: inline-block;
}
}
}

// fixit-encryptor shortcodes
#content fixit-encryptor {
.fixit-decryptor-container {
--fixit-decryptor-margin-block: 1rem;
}
&.decrypted > .fixit-decryptor-container {
display: none;
}
}

Expand Down
3 changes: 2 additions & 1 deletion assets/data/cdn/jsdelivr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ libFiles:
# crypto-js@4.2.0 https://github.com/brix/crypto-js
cryptoCoreJS: crypto-js@4.2.0/core.js
cryptoEncBase64JS: crypto-js@4.2.0/enc-base64.js
cryptoMd5JS: crypto-js@4.2.0/md5.js
cryptoSha256JS: crypto-js@4.2.0/sha256.js
# echarts@5.3.3 https://github.com/apache/echarts
echartsJS: echarts@5.3.3/dist/echarts.min.js
Expand Down Expand Up @@ -76,4 +75,6 @@ libFiles:
# waline@2.15.8 https://github.com/walinejs/waline
walineCSS: '@waline/client@2.15.8/dist/waline.css'
walineJS: '@waline/client@2.15.8/dist/waline.js'
# xxhash-wasm@1.0.2 https://github.com/jungomi/xxhash-wasm
xxhashWasmJS: xxhash-wasm@1.0.2/umd/xxhash-wasm.js

4 changes: 2 additions & 2 deletions assets/data/cdn/unpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ libFiles:
# crypto-js@4.2.0 https://github.com/brix/crypto-js
cryptoCoreJS: crypto-js@4.2.0/core.js
cryptoEncBase64JS: crypto-js@4.2.0/enc-base64.js
cryptoMd5JS: crypto-js@4.2.0/md5.js
cryptoSha256JS: crypto-js@4.2.0/sha256.js
# echarts@5.3.3 https://github.com/apache/echarts
echartsJS: echarts@5.3.3/dist/echarts.min.js
Expand Down Expand Up @@ -76,4 +75,5 @@ libFiles:
# waline@2.15.8 https://github.com/walinejs/waline
walineCSS: '@waline/client@2.15.8/dist/waline.css'
walineJS: '@waline/client@2.15.8/dist/waline.js'

# xxhash-wasm@1.0.2 https://github.com/jungomi/xxhash-wasm
xxhashWasmJS: xxhash-wasm@1.0.2/umd/xxhash-wasm.js
Loading

0 comments on commit 312b636

Please sign in to comment.