You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Hugo website, using Netlify, and would like to know how to not require all pages on the site to ask for the password if it has already been entered on another page. Any help would be greatly appreciated. The following is my Netlify build command hugo && npm install && find public -type f -name '*.html' -exec staticrypt {} ****** \\;
Thanks,
Eli
It will replace all your html files by the encrypted ones. There is still a flash on each pages because I only decrypt after onload but I'll try to improve that quickly.
Also, it's not ideal to save the password as is in the sessionstorage... It would be good to secure it (no idea for now)
It will replace all your html files by the encrypted ones. There is still a flash on each pages because I only decrypt after onload but I'll try to improve that quickly.
Also, it's not ideal to save the password as is in the sessionstorage... It would be good to secure it (no idea for now)
I'm not 100 percent sure on how to set it up, but this is what I did:
added a crypt.sh with the following code:
This is very awesome @Embraser01 -- has anybody made any progress in removing the flash of the password box before decryption? I've just start looking at the code a bit but hoping to find some way to replace that with a loading spinner or similar.
Hey all, thanks for the issue and discussion. This is closed in #124 , which adds a "Remember me" checkbox. The passphrase is stored hashed + salted in localStorage, meaning it's a slightly bigger attack surface for decryting the encrypted page, but should mitigate password reuse leakage (see discussion in #120 ).
@staticman-cosmos regarding the flash of the password box - you could modify the password_template file to show a spinner by default and hide the whole password box with a hidden class, and in the onload function you check:
if there is a stored passphrase, decrypt and show that
if there isn't (or it's wrong), show the password box instead
This means that you might have very quick flash of spinner before the password box shows for a new user.
Activity
Embraser01 commentedon Jul 4, 2019
Hey, I needed the same thing!
I rewrited a part of the
password_template.htmlfile to save the pass in the sessionstorage once the user entered the good password.You can look here: https://github.com/Embraser01/staticrypt/blob/gh-pages/password_template.html
Then for netlify it's really easy!
My
netlify.toml:With the following
./crypt.sh:It will replace all your html files by the encrypted ones. There is still a flash on each pages because I only decrypt after onload but I'll try to improve that quickly.
Also, it's not ideal to save the password as is in the sessionstorage... It would be good to secure it (no idea for now)
Embraser01 commentedon Jul 5, 2019
It seems to be an error related to your hugo site (otherwise, it would have printed the results of hugo). Does it compile on your local machine?
edcous commentedon Jul 12, 2019
Re:
I'm not 100 percent sure on how to set it up, but this is what I did:
added a crypt.sh with the following code:
And, this is my netlify.toml:
kevincolten commentedon Sep 5, 2019
I got it working using this command
set -e && find ./_site -type f -name '*.html' -exec staticrypt -f password_template.html {} $PASSWORD -o {} \\;and by tweaking the password template script, replacing
with
bsde1234 commentedon Sep 14, 2019
Stupid question do I need to run
./crypt.shlocally or somewahere in netlify or in hugo template?imshuffling commentedon Feb 4, 2020
Any examples of this working for gatsby?
Asking for a friend :)
imshuffling commentedon Feb 4, 2020
^ Got it working
edcous commentedon Apr 14, 2020
In netlify, in your build command
staticman-cosmos commentedon Nov 28, 2020
This is very awesome @Embraser01 -- has anybody made any progress in removing the flash of the password box before decryption? I've just start looking at the code a bit but hoping to find some way to replace that with a loading spinner or similar.
888ba8 commentedon Dec 3, 2020
Can you help me with the following question:
https://stackoverflow.com/questions/65129417/gatsby-browser-remembers-password-jekyll-browser-does-not-remember-password
robinmoisson commentedon Feb 10, 2022
Hey all, thanks for the issue and discussion. This is closed in #124 , which adds a "Remember me" checkbox. The passphrase is stored hashed + salted in localStorage, meaning it's a slightly bigger attack surface for decryting the encrypted page, but should mitigate password reuse leakage (see discussion in #120 ).
@staticman-cosmos regarding the flash of the password box - you could modify the
password_templatefile to show a spinner by default and hide the whole password box with ahiddenclass, and in theonloadfunction you check:This means that you might have very quick flash of spinner before the password box shows for a new user.