diff --git a/.github/workflows/publish-post-encrypt.yml b/.github/workflows/publish-encrypt.yml similarity index 80% rename from .github/workflows/publish-post-encrypt.yml rename to .github/workflows/publish-encrypt.yml index 31677608..344aa84b 100644 --- a/.github/workflows/publish-post-encrypt.yml +++ b/.github/workflows/publish-encrypt.yml @@ -1,9 +1,9 @@ -name: Publish post-encrypt +name: Publish @hugo-fixit/encrypt on: push: tags: - - 'post-encrypt-v*.*.*' + - 'encrypt-v*.*.*' workflow_dispatch: permissions: @@ -11,7 +11,7 @@ permissions: id-token: write concurrency: - group: publish-post-encrypt-${{ github.ref }} + group: publish-encrypt-${{ github.ref }} cancel-in-progress: false jobs: @@ -36,8 +36,8 @@ jobs: run: pnpm install --frozen-lockfile - name: Build package - run: pnpm -F post-encrypt build + run: pnpm -F encrypt build - name: Publish package to npm - working-directory: packages/post-encrypt + working-directory: packages/encrypt run: npm publish --access public --provenance diff --git a/assets/js/lib/fixit-decryptor.ts b/assets/js/lib/fixit-decryptor.ts index 78586893..91c9af9e 100644 --- a/assets/js/lib/fixit-decryptor.ts +++ b/assets/js/lib/fixit-decryptor.ts @@ -12,7 +12,7 @@ * * Payload formats: * - v2 (current): PBKDF2(SHA-256(password), 100k iterations) → base64(salt).base64(iv).base64(ciphertext+tag) - * - Password verification: data-password stores PBKDF2(SHA-256(password), data-verify-salt) when post-encrypted + * - Password verification: data-password stores PBKDF2(SHA-256(password), data-verify-salt) when fixit-encrypted */ import { eventBus } from '../core/event-bus' import { flashTooltip } from '../utils' diff --git a/i18n/de.toml b/i18n/de.toml index 5d2dec41..98b2cb9b 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -146,7 +146,7 @@ password = "Passwort" enterBtn = "Eintreten" encryptyAgain = "Erneut verschlüsseln" encryptionWarning = "Inhaltsverschlüsselung erkannt, aber sie sind noch im Klartext!" -encryptionCommand = "Führen Sie `npx @hugo-fixit/post-encrypt` nach dem Build aus, um sie tatsächlich zu verschlüsseln." +encryptionCommand = "Führen Sie `npx @hugo-fixit/encrypt` nach dem Build aus, um sie tatsächlich zu verschlüsseln." relatedContent = "Ähnliche Inhalte" [single.includedIn] diff --git a/i18n/en.toml b/i18n/en.toml index b0e386f4..f8ebd430 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -146,7 +146,7 @@ password = "Password" enterBtn = "Enter" encryptyAgain = "Encrypt again" encryptionWarning = "Content encryption detected, but they are still in plaintext!" -encryptionCommand = "Run `npx @hugo-fixit/post-encrypt` after building to actually encrypt them." +encryptionCommand = "Run `npx @hugo-fixit/encrypt` after building to actually encrypt them." relatedContent = "Related Content" [single.includedIn] diff --git a/i18n/es.toml b/i18n/es.toml index e92446ca..f9062177 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -146,7 +146,7 @@ password = "Contraseña" enterBtn = "Entrar" encryptyAgain = "Encriptar de nuevo" encryptionWarning = "¡Se detectó cifrado de contenido, pero aún están en texto plano!" -encryptionCommand = "Ejecute `npx @hugo-fixit/post-encrypt` después de la compilación para cifrarlos realmente." +encryptionCommand = "Ejecute `npx @hugo-fixit/encrypt` después de la compilación para cifrarlos realmente." relatedContent = "Contenido relacionado" [single.includedIn] diff --git a/i18n/fr.toml b/i18n/fr.toml index c9a613a1..bc73933e 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -146,7 +146,7 @@ password = "Mot de passe" enterBtn = "Entrer" encryptyAgain = "Chiffrer à nouveau" encryptionWarning = "Chiffrement de contenu détecté, mais ils sont toujours en texte clair !" -encryptionCommand = "Exécutez `npx @hugo-fixit/post-encrypt` après la compilation pour les chiffrer réellement." +encryptionCommand = "Exécutez `npx @hugo-fixit/encrypt` après la compilation pour les chiffrer réellement." relatedContent = "Contenu lié" [single.includedIn] diff --git a/i18n/hi.toml b/i18n/hi.toml index 367befe9..ca1e509b 100644 --- a/i18n/hi.toml +++ b/i18n/hi.toml @@ -147,7 +147,7 @@ password = "पासवर्ड" enterBtn = "दर्ज करें" encryptyAgain = "फिर से एन्क्रिप्ट करें" encryptionWarning = "सामग्री एन्क्रिप्शन का पता चला, लेकिन वे अभी भी सादे पाठ में हैं!" -encryptionCommand = "उन्हें वास्तव में एन्क्रिप्ट करने के लिए बिल्ड के बाद `npx @hugo-fixit/post-encrypt` चलाएं।" +encryptionCommand = "उन्हें वास्तव में एन्क्रिप्ट करने के लिए बिल्ड के बाद `npx @hugo-fixit/encrypt` चलाएं।" relatedContent = "संबंधित सामग्री" [single.includedIn] diff --git a/i18n/it.toml b/i18n/it.toml index cff4488b..326f3ab5 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -146,7 +146,7 @@ password = "Password" enterBtn = "Entra" encryptyAgain = "Crittografa di nuovo" encryptionWarning = "Rilevata crittografia dei contenuti, ma sono ancora in testo in chiaro!" -encryptionCommand = "Eseguire `npx @hugo-fixit/post-encrypt` dopo la compilazione per crittograffarli effettivamente." +encryptionCommand = "Eseguire `npx @hugo-fixit/encrypt` dopo la compilazione per crittograffarli effettivamente." relatedContent = "Contenuti correlati" [single.includedIn] diff --git a/i18n/ja.toml b/i18n/ja.toml index d764bfe4..0e9d4252 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -144,7 +144,7 @@ password = "パスワード" enterBtn = "入る" encryptyAgain = "再度暗号化" encryptionWarning = "コンテンツの暗号化が検出されましたが、まだ平文です!" -encryptionCommand = "実際に暗号化するには、ビルド後に `npx @hugo-fixit/post-encrypt` を実行してください。" +encryptionCommand = "実際に暗号化するには、ビルド後に `npx @hugo-fixit/encrypt` を実行してください。" relatedContent = "関連コンテンツ" [single.includedIn] diff --git a/i18n/ko.toml b/i18n/ko.toml index 58d75652..733aa1d9 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -144,7 +144,7 @@ password = "비밀번호" enterBtn = "입장" encryptyAgain = "다시 암호화" encryptionWarning = "콘텐츠 암호화가 감지되었지만 여전히 평문입니다!" -encryptionCommand = "실제로 암호화하려면 빌드 후 `npx @hugo-fixit/post-encrypt`를 실행하세요." +encryptionCommand = "실제로 암호화하려면 빌드 후 `npx @hugo-fixit/encrypt`를 실행하세요." relatedContent = "관련 콘텐츠" [single.includedIn] diff --git a/i18n/pl.toml b/i18n/pl.toml index 50a8156a..730a90fa 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -146,7 +146,7 @@ password = "Hasło" enterBtn = "Wejdź" encryptyAgain = "Zaszyfruj ponownie" encryptionWarning = "Wykryto szyfrowanie treści, ale nadal są w postaci zwykłego tekstu!" -encryptionCommand = "Uruchom `npx @hugo-fixit/post-encrypt` po kompilacji, aby je faktycznie zaszyfrować." +encryptionCommand = "Uruchom `npx @hugo-fixit/encrypt` po kompilacji, aby je faktycznie zaszyfrować." relatedContent = "Powiązane treści" [single.includedIn] diff --git a/i18n/pt-BR.toml b/i18n/pt-BR.toml index c873d5d0..cf7ecd2b 100644 --- a/i18n/pt-BR.toml +++ b/i18n/pt-BR.toml @@ -147,7 +147,7 @@ password = "Senha" enterBtn = "Entrar" encryptyAgain = "Encripte novamente" encryptionWarning = "Criptografia de conteúdo detectada, mas ainda estão em texto plano!" -encryptionCommand = "Execute `npx @hugo-fixit/post-encrypt` após a compilação para realmente criptografá-los." +encryptionCommand = "Execute `npx @hugo-fixit/encrypt` após a compilação para realmente criptografá-los." relatedContent = "Conteúdo relacionado" [single.includedIn] diff --git a/i18n/ro.toml b/i18n/ro.toml index 00347ce0..8771dd8f 100644 --- a/i18n/ro.toml +++ b/i18n/ro.toml @@ -146,7 +146,7 @@ password = "Parolă" enterBtn = "Intră" encryptyAgain = "Criptează din nou" encryptionWarning = "Criptarea conținutului a fost detectată, dar sunt încă în text clar!" -encryptionCommand = "Rulați `npx @hugo-fixit/post-encrypt` după compilare pentru a le cripta efectiv." +encryptionCommand = "Rulați `npx @hugo-fixit/encrypt` după compilare pentru a le cripta efectiv." relatedContent = "Conținut înrudit" [single.includedIn] diff --git a/i18n/ru.toml b/i18n/ru.toml index d7f55715..45270088 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -146,7 +146,7 @@ password = "арготизм" enterBtn = "Войти" encryptyAgain = "Зашифровать снова" encryptionWarning = "Обнаружено шифрование контента, но он всё ещё в открытом виде!" -encryptionCommand = "Запустите `npx @hugo-fixit/post-encrypt` после сборки, чтобы фактически зашифровать их." +encryptionCommand = "Запустите `npx @hugo-fixit/encrypt` после сборки, чтобы фактически зашифровать их." relatedContent = "Связанный контент" [single.includedIn] diff --git a/i18n/sr.toml b/i18n/sr.toml index 2a123d12..8a24b3e3 100644 --- a/i18n/sr.toml +++ b/i18n/sr.toml @@ -146,7 +146,7 @@ password = "Паролица" enterBtn = "Унеси" encryptyAgain = "Поново шифруј" encryptionWarning = "Детектовано је шифровање садржаја, али су и даље у обичном тексту!" -encryptionCommand = "Покрените `npx @hugo-fixit/post-encrypt` након изградње да бисте их заиста шифровали." +encryptionCommand = "Покрените `npx @hugo-fixit/encrypt` након изградње да бисте их заиста шифровали." relatedContent = "Повезани садржај" [single.includedIn] diff --git a/i18n/vi.toml b/i18n/vi.toml index 6b6faf05..2ee2b7c5 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -145,7 +145,7 @@ password = "Mật khẩu" enterBtn = "Nhập" encryptyAgain = "Mã hóa lại" encryptionWarning = "Phát hiện mã hóa nội dung, nhưng chúng vẫn ở dạng văn bản thuần!" -encryptionCommand = "Chạy `npx @hugo-fixit/post-encrypt` sau khi build để thực sự mã hóa chúng." +encryptionCommand = "Chạy `npx @hugo-fixit/encrypt` sau khi build để thực sự mã hóa chúng." relatedContent = "Nội dung liên quan" [single.includedIn] diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index 968918b6..befa7f68 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -144,7 +144,7 @@ password = "密码" enterBtn = "进入" encryptyAgain = "重新加密" encryptionWarning = "检测到内容加密,但仍为明文状态!" -encryptionCommand = "请在构建后执行 `npx @hugo-fixit/post-encrypt` 以实际加密内容。" +encryptionCommand = "请在构建后执行 `npx @hugo-fixit/encrypt` 以实际加密内容。" relatedContent = "相关内容" [single.includedIn] diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index e4d9ffbb..4fb7de31 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -144,7 +144,7 @@ password = "密碼" enterBtn = "進入" encryptyAgain = "重新加密" encryptionWarning = "偵測到內容加密,但仍為明文狀態!" -encryptionCommand = "請在建構後執行 `npx @hugo-fixit/post-encrypt` 以實際加密內容。" +encryptionCommand = "請在建構後執行 `npx @hugo-fixit/encrypt` 以實際加密內容。" relatedContent = "相關內容" [single.includedIn] diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 553b8b4c..d8813d7d 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v1.0.0-mrpajmty" -}} +{{- hugo.Store.Set "version" "v1.0.0-mrrceo88" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 9a90abb2..5186562f 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -159,7 +159,7 @@
- {{- /* TOC source (copied to containers by initToc, encrypted by post-encrypt when password is set) */ -}} + {{- /* TOC source (copied to containers by initToc, encrypted by fixit-encrypt when password is set) */ -}} {{ $tableOfContents }} {{- end -}} diff --git a/package.json b/package.json index 1766ada1..e57acd84 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build:demo": "pnpm -F demo build", "build:test": "pnpm -F test build", "build": "concurrently 'pnpm build:demo' 'pnpm build:test' && pnpm -F integration start && pnpm encrypt && pnpm encrypt --verify", - "encrypt": "pnpm -F post-encrypt start", + "encrypt": "pnpm -F encrypt start", "clean": "rm -rf public resources/_gen apps/*/public apps/*/resources/_gen", "preview": "serve public", "lint": "eslint --cache .", diff --git a/packages/encrypt/README.md b/packages/encrypt/README.md new file mode 100644 index 00000000..823851dd --- /dev/null +++ b/packages/encrypt/README.md @@ -0,0 +1,113 @@ +# @hugo-fixit/encrypt + +Post-build AES-256-GCM encryption tool for the [FixIt](https://github.com/hugo-fixit/FixIt) Hugo theme. + +It is designed for HTML generated by FixIt content encryption templates and should be run after your site has already been built. + +## Usage + +> After building your Hugo site, run the encryption tool from your site root. + +Recommended: install as a dev dependency and configure scripts: + +```bash +npm install -D @hugo-fixit/encrypt +``` + +Then in your `package.json`: + +```json +{ + "scripts": { + "build": "hugo --gc --minify --logLevel info", + "postbuild": "fixit-encrypt && fixit-encrypt --verify" + } +} +``` + +You can also run it directly via npx: + +```bash +npx @hugo-fixit/encrypt +``` + +Or install globally and run the CLI directly: + +```bash +npm install -g @hugo-fixit/encrypt +fixit-encrypt +``` + +### Options + +| Option | Description | Default | +| --------------- | -------------------------------------------------- | -------- | +| `--input