Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search also gets encrypted #13

Closed
abhimanyuchawla opened this issue Jun 10, 2021 · 7 comments
Closed

search also gets encrypted #13

abhimanyuchawla opened this issue Jun 10, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@abhimanyuchawla
Copy link

abhimanyuchawla commented Jun 10, 2021

I am encrypting all pages using a global password, and it turns out the search index file (site/search/search_index.json) also gets encrypted.
When viewing the site in a browser, I am able to decrypt each page using the global password, but the search is still encrypted.

One would expect the search to also get decrypted after supplying the global password.
Is there a way you could fix this, or add some option which prevents the search_index.json file to get encrypted in the first place.

Thank you.

@CoinK0in CoinK0in self-assigned this Jun 10, 2021
@CoinK0in
Copy link
Collaborator

I confirm that on the current version (1.0.0) the search does not work on encrypted pages.
I added an option do-not-encrypt-search-index to choose if the 'text' search index should be encrypted or not, in version 1.1.0.

I continue to check if it would be possible to, fully or partially, decrypt the search index 'on the fly' when entering a password.
But it seems complicated to generalize since the search engines are included in theme's and therefore specific. And this process should be entirely done in JS, which is definitely not my thing ... 😵

@CoinK0in CoinK0in added the enhancement New feature or request label Jun 12, 2021
@abhimanyuchawla
Copy link
Author

Hi,
Thanks for your prompt fix, much appreciated. I confirm that version 1.1.0 allows one to exclude the search index from encryption.
It would be nice to have the search decrypted 'on the fly', but I understand it would be tough to do that for all search engines.
But this fix works for my use case, thanks once again!

@CoinK0in
Copy link
Collaborator

Your welcome.

I keep trying to make a version of the search engine that could decrypt the search index 'on the fly' and be integrated easly to any template. I probably make a new version if I get a result that's satisfy me.

I close this issue. Fell free to open a new issue if you have any troubles :)

@CoinK0in
Copy link
Collaborator

CoinK0in commented Aug 25, 2021

I pushed some time ago an experimental branch Search index encryption. I added different way of managing the search index with this encryption plugin. One mode, "dynamically", seems to meet your expectations.

Could you try it ? Do you have an opinion on it ? Your feedback are welcome :)

@abhimanyuchawla
Copy link
Author

abhimanyuchawla commented Sep 9, 2021

Hi
Sorry for the delay, I was on vacation.
Thanks for adding this feature. I tried the experimental branch and used the 'dynamically' mode, however the search stays encrypted even after supplying the password on the page.

Is it possible that since I am using Material theme that the feature is not working?
Thanks.

@CoinK0in
Copy link
Collaborator

I confirm this feature does not work with the Material theme :/
The Material theme modifies the way searches work after generating the site by adding its own javascript files.
I haven't been able to find a "clean" way to transform these files from this plugin.

I will try to make the necessary modifications in the Javascript files used by the Material theme to reproduce the behaviour with the default theme from mkdocs. I could not automatically manage the modifications / installation of these modified files, so it will probably be necessary to manually modify the javascript files in the Material themes (With all the implications that this will have on version upgrades, bug fixes , etc.).

Thank you for taking it to try this feature and for providing feedback on its use.

@abhimanyuchawla
Copy link
Author

Thank you for your efforts. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants