Can we get N8N_ENCRYPTION_KEY and WEBHOOK_URL moved to config.json?

The idea is:

Currently I can specify most of my configuration in a config.json file rather than using environment variables using the N8N_CONFIG_FILES env variable. However, I cannot specify the equivalent of N8N_ENCRYPTION_KEY or WEBHOOK_URL.

My use case:

Not being able to specify N8N_ENCRYPTION_KEY in the json config causes the credential encryption key to be exposed to any Function node that wants it. That’s a security issue.

I’d also like WEBHOOK_URL also in the json config just for completeness.

I think it would be beneficial to add this because:

It prevents the secret from becoming visible.

Are you willing to work on this?

I do not have the bandwidth at the moment, nor a good understanding of the n8n core internals.

Hey @vittyo,

The encryption key I believe is already stored in a file, you would only set the env option if you wanted to set a new one. The key should be in the .n8n/config file.

The webhook url is a good shout, I think having all env options exposed to the config json is a good idea.

Thanks @jon. I want to use the same encryption key across several docker images, so I need to use the N8N_ENCRYPTION_KEY environment variable.

Hey @vittyo,

As a temp solution if you didn’t want to use the env option you could try stopping the service then editing the config file using the value you are after and start it back up again.

1 Like