Project

General

Profile

« Previous | Next » 

Revision 53ecc7fc

Added by Ewoud Kohl van Wijngaarden about 6 years ago

Fixes #23577 - Configurable security token path

In production setups we prefer to store this file in /etc/foreman and a
symlink in the rails root.

View differences:

lib/tasks/security.rake
namespace :security do
desc 'Generate new security token'
task :generate_token do
task :generate_token, [:path] do |t, args|
include Foreman::Util
File.open(Rails.root.join('config', 'initializers', 'local_secret_token.rb'), "w") do |fd|
path = args[:path] || Rails.root.join('config', 'initializers', 'local_secret_token.rb')
File.open(path, "w") do |fd|
fd.write("# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.

Also available in: Unified diff