whoogle-search
whoogle-search copied to clipboard
Add preferences parameter to url
The preferences' parameter contain an encrypted version of the desired config of the user.
The encryption step is a choice and not required, as it is here a key is mandatory to show the new url in configuration. If we decide to go without encryption, the preferences' parameter could work on different instances of whoogle. Maybe it is useful for people using farside to have it not encrypted?
The next possible step, would be to add a config variable to deactivate completely the cookies ?!
Fixes: #817
Translation needs to be done.
I have made the changes to allow the user to set the encryption or not, the option will only work if a key has been previously set in the environment variables, as mentioned under the option.
As it is now, all instances can read unencrypted preferences and encrypted preferences can only be read by instances with the same key.
To know if a token is encrypted or unencrypted when sharing a token, I have set a flag on the token, if the token starts with :
- 'e': the token is encrypted, and a key is needed to decode it, eg.
127.0.0.1:5000/?preferences=eG2MDAGSqbfR8MSPS....
- 'u': the token is unencrypted and can be shared and used with all the instances, eg.
127.0.0.1:5000/?preferences=uG8EGACwKbCd6ME...