Fix SESSION_COOKIE_NAME and secret_key being random values#209
Fix SESSION_COOKIE_NAME and secret_key being random values#209alanvitor wants to merge 5 commits intoail-project:masterfrom
SESSION_COOKIE_NAME and secret_key being random values#209Conversation
|
Thanks for the pull-request. We do a reset if the private-key at each restart of the service allowing to kill and clean active sessions. What's your use-case to require a fixed private-key? Security wise it sounds like a bit more risky. |
|
My use case: In my case, instead of generating the key in code, I generate the key in a shared location. So each instance gets the same key. And now it would be an environment variable, so there is no problem generating a private key on each restart. |
|
I see. Why don't use sticky session on the reverse proxies/load balancers? but how do you load-balancing between the kvrocks database? I won't work as is with the current design of AIL. |
|
Let me add more context to understand what got me to this point. I want to scale it up by separating some services into exclusive instances (and it's challenging me). For example, I want to have 2 instances for the application, 1 for ARDB, and 1 for Redis and KVRocks. LAUNCH.sh is helping me to run these services separately. In this process, I found some quick wins, and session handling was one of them. Sticky sessions are a good approach, but I think they will add another layer of complexity that we can solve in the application. @adulau, thanks for pointing out those items that I forgot to mention. |
|
Can we close this @Terrtia it's 2025 after all ;) |
This fixes the problem with
SESSION_COOKIE_NAMEandsecret_keybeing random values. Thesecret_keyis now static, which is necessary for encrypting user data and session.The minor fix in
installing_deps.shis for running a docker container as root.sudoin this case won't work, so we're checking current user and installingsudoif needed.