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 authored 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:
# [email protected] https://github.com/brix/crypto-js
cryptoCoreJS: [email protected]/core.js
cryptoEncBase64JS: [email protected]/enc-base64.js
cryptoMd5JS: [email protected]/md5.js
cryptoSha256JS: [email protected]/sha256.js
# [email protected] https://github.com/apache/echarts
echartsJS: [email protected]/dist/echarts.min.js
Expand Down Expand Up @@ -76,4 +75,6 @@ libFiles:
# [email protected] https://github.com/walinejs/waline
walineCSS: '@waline/[email protected]/dist/waline.css'
walineJS: '@waline/[email protected]/dist/waline.js'
# [email protected] https://github.com/jungomi/xxhash-wasm
xxhashWasmJS: [email protected]/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:
# [email protected] https://github.com/brix/crypto-js
cryptoCoreJS: [email protected]/core.js
cryptoEncBase64JS: [email protected]/enc-base64.js
cryptoMd5JS: [email protected]/md5.js
cryptoSha256JS: [email protected]/sha256.js
# [email protected] https://github.com/apache/echarts
echartsJS: [email protected]/dist/echarts.min.js
Expand Down Expand Up @@ -76,4 +75,5 @@ libFiles:
# [email protected] https://github.com/walinejs/waline
walineCSS: '@waline/[email protected]/dist/waline.css'
walineJS: '@waline/[email protected]/dist/waline.js'

# [email protected] https://github.com/jungomi/xxhash-wasm
xxhashWasmJS: [email protected]/umd/xxhash-wasm.js
Loading

0 comments on commit 312b636

Please sign in to comment.