Generate new key (rails)
Hello everyone,
I installed a new copy today by creating a snapshot (in DigitalOcean) from an existing installation, and recreating a new install with a new Droplet.
So far everything good, just need to figure out how to re-generate the rails key (bottom key located in the postal.yml file).
Any help would be much appreciated.
According to https://github.com/atech/postal/blob/master/script/generate_initial_config.rb#L13, that key is generated using a Ruby standard library https://ruby-doc.org/stdlib-2.3.0/libdoc/securerandom/rdoc/SecureRandom.html
As long as your new key is as long as your old key and contains 0-9 and a-f only, it should be fine. I believe the length is currently 256 characters (128 * 2);
Hello,
So it means, the same key can be used in multiple installs?
The key is used by Rails for security purposes so it would be a bad idea to use the same key in multiple locations if you can avoid it.
If you're creating a cluster sharing the same database between Postal instances then you will need to re use the key but otherwise it should be unique.