Improve symmetric key gen #1

Open
opened 2025-10-29 17:49:50 +00:00 by Brooke · 3 comments
Owner

Currently the "gen_key" function has to be manually called to generate a key and then inserted into the crypto_key secret, finally the service must be undeployed and redployed. This is non-ideal but I'm not sure how else to handle it automatically as liberaforms is very specific about this key and this was the reason for uploads failing.
Commit adding key_gen command:
09e2b37332

Reference in liberaforms codebase to this command, seems it's a Fernet key:
https://codeberg.org/LiberaForms/server/src/branch/main/liberaforms/commands/cryptokey.py

Currently the "gen_key" function has to be manually called to generate a key and then inserted into the crypto_key secret, finally the service must be undeployed and redployed. This is non-ideal but I'm not sure how else to handle it automatically as liberaforms is very specific about this key and this was the reason for uploads failing. Commit adding key_gen command: 09e2b37332 Reference in liberaforms codebase to this command, seems it's a Fernet key: https://codeberg.org/LiberaForms/server/src/branch/main/liberaforms/commands/cryptokey.py
Owner

Does this key need to be managed by docker secrets? Or could it just be generated by the entrypoint and saved in a volume inside the container?

Does this key need to be managed by docker secrets? Or could it just be generated by the entrypoint and saved in a volume inside the container?
Author
Owner

I think you're right that it would be possible to do it in the entrypoint but I'm not totally sure how to handle that. Liberaforms expects it in an environment variable CRYPTO_KEY

I think you're right that it would be possible to do it in the entrypoint but I'm not totally sure how to handle that. Liberaforms expects it in an environment variable CRYPTO_KEY
Owner

Here's a proposed way. I haven't tested but hopefully it gives an idea: https://git.coopcloud.tech/coop-cloud/liberaforms/src/branch/cryptosecret

Here's a proposed way. I haven't tested but hopefully it gives an idea: https://git.coopcloud.tech/coop-cloud/liberaforms/src/branch/cryptosecret
Sign in to join this conversation.
No description provided.