File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 137137# use_test :test_unit
138138use_test :rspec
139139
140-
141140#
142141# ==== Set up your basic configuration
143142#
146145 # Sets up a custom session id key, if you want to piggyback sessions of other applications
147146 # with the cookie session store. If not specified, defaults to '_session_id'.
148147 c [ :session_id_key ] = '_chef_server_session_id'
149- c [ :session_secret_key ] = '0992ea491c30ec76c98367c1ca53b18c1e7c5b30'
148+
149+ newpass = nil
150+ if Chef ::FileCache . has_key? ( "chef_server_cookie_id" )
151+ newpass = Chef ::FileCache . load ( "chef_server_cookie_id" )
152+ else
153+ chars = ( "a" .."z" ) . to_a + ( "A" .."Z" ) . to_a + ( "0" .."9" ) . to_a
154+ newpass = ""
155+ 1 . upto ( 40 ) { |i | newpass << chars [ rand ( chars . size -1 ) ] }
156+ Chef ::FileCache . store ( "chef_server_cookie_id" , newpass )
157+ end
158+
159+ c [ :session_secret_key ] = newpass
150160 c [ :session_store ] = 'cookie'
151161 c [ :exception_details ] = true
152162 c [ :reload_classes ] = false
153- c [ :log_level ] = :debug
154- c [ :log_stream ] = STDOUT
163+ c [ :log_level ] = Chef :: Config [ :log_level ]
164+ c [ :log_stream ] = Chef :: Config [ :log_location ]
155165end
156166
157- Chef ::Log . info ( "Compiling routes..." )
167+ Chef ::Log . logger = Merb . logger
168+ Chef ::Log . error ( "Compiling routes..." )
158169Merb ::Router . prepare do |r |
159170 # RESTful routes
160171 # r.resources :posts
You can’t perform that action at this time.
0 commit comments