Encrypt Hugo Site using Staticrypt

Got this after installing:
User@Eli-PC MINGW64 /c/hugo/sites/leahdemo/public (master)
$ find . -type f -name “*.html” -exec staticrypt {} mypassword ;
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory
find: ‘staticrypt’: No such file or directory

Did you install staticrypt via npm?

I think I did

So you ran this:

npm install -g staticrypt

And you get correct output when running, something like?

staticrypt --help

Nevermind,
Command: find . -type f -name "*.html" -exec staticrypt {} mypassword \; does work in git bash. But it does not work if you use find . -type f -name \"*.html\" -exec staticrypt {} mypassword \; Commands listed in github issue (
find public -type f -name ".html" -exec staticrypt {} ;
find public -type f ! -name '
_encrypted.html’ -delete)
work but the second one needs to delete the old files (which it does) and then remove _encrypted from the file name (I don’t know how to do that)
EDIT: This might help? Not 100% sure on how to use this, I will experiment. https://www.npmjs.com/package/rename-cli
EDIT: I also set up redirects to /index_encrypted from /, never figured out how to rename files

Right.

Right. This is because the quotes don’t need to be escaped when running the actual command. That was only done for the netlify.toml build command, so it would be read appropriately.


I’ve helped as much as I can thus far. Leaving it up to you to get the rest of the way there. Am closing this thread. Good luck!


Update: Posting a private message I received from @edcous for reference for future readers. Happy to hear a solution was found.

Hi, I’d like to thank you for your help on working to encrypt my site with staticrypt, it ended up being you had to end with \\; and that fixed it.