Automatically generate validationKey and encryptionKey when they are not set

Hi everyone,

It’s super easy to forget to set those two properties, and it’s also a bit of a pain to have to implement something to generate them in each package (Docker, Debian, Snap, etc.).

So I would like to propose to handle them differently:

  1. stop providing values for them in the generated xwiki.cfg

  2. if they are not already set:

    • generate them
    • store them somewhere in <permdir>/ (so that people don’t “loose” their cookie when restarting the instance, which could be very annoying)

WDYT ?

1 Like

Sounds good, +1.

Thanks,
Marius

+1

Thanks,
Alex

+1 Thanks

+1 thanks

+1. Note that there is an existing, 10 year old pull request that implements this and stores the keys in a key store: XWiki 5406 by tdelafosse · Pull Request #90 · xwiki/xwiki-platform · GitHub

OK, thanks, I missed this one since the title of the issue did not seem that close. It’s also going a lot beyond what is discussed here, which does not really change anything to the system and just store the two values in a properties file located in the permanent directory (that could be used for other generation needs like this).

+1 thanks. FTR it’s Loading...

7 +1 and not other vote

Applied in 15.9, 15.5.4 and 14.10.19.

1 Like

Very good! Thanks for working on this, it’s great.