saimn / sigal

yet another simple static gallery generator
http://sigal.saimon.org/
MIT License
884 stars 169 forks source link

Can't decrypt an encrypted gallery #490

Open JulienPalard opened 1 year ago

JulienPalard commented 1 year ago

I tried encrypting a gallery on current sigal main (sigal 2.4.dev46+g0923a56).

When I try decrypting it I'm getting:

Uncaught (in promise) Error: Fetched failed when checking encryption key
    onMessage [...]/static/decrypt.js:482
    onmessage [...]/static/decrypt.js:200
    _mSetupServiceWorker [...]/static/decrypt.js:199
    Decryptor [...]/static/decrypt.js:47
    Decryptor [...]/static/decrypt.js:35
    init [...]/static/decrypt.js:57
    <anonymous> [...]/:18
2 decrypt.js:482:54

I'm getting the same message with a bad password.

saimn commented 1 year ago

Hi, Sorry I cannot reproduce, so not sure what to do. @dbw9580 - Maybe you have an idea ?

dbw9580 commented 1 year ago

Fetched failed when checking encryption key

the decryptor was trying to fetch and decrypt a file located at ${gallery_url}/static/keycheck.txt, to determine whether the password provided by the user is correct. The error was that file couldn't be fetched, probably due to a network error.

https://github.com/saimn/sigal/blob/4cc7f5f4d2d2090f3335076e4c133003da7bafb7/src/sigal/plugins/encrypt/static/decrypt.js#L96-L99

Please check whether the file is present at the URL.