X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/04347c9ee27bf3da2c90eb7bb612dbc6ad5a34c2..e3e224295f2a3aa53ee82ebfc3982b90e85cfc08:/docker/config.rb diff --git a/docker/config.rb b/docker/config.rb index 547a2548ab..c663524356 100755 --- a/docker/config.rb +++ b/docker/config.rb @@ -1,6 +1,7 @@ #! /usr/bin/env ruby require 'yaml' +require 'fileutils' # Initialize config settings from config.yml config = YAML.load_file('config.yml') @@ -9,12 +10,6 @@ config = YAML.load_file('config.yml') # Add dynamically chosen config settings. These settings should # be suitable for any installation. -# The APP_SECRET the application uses (with OMNIAUTH_APP_ID) to -# authenticate itself to Omniauth. By default this is generated -# randomly when the application is built; you can instead -# substitute a hardcoded string. -config['OMNIAUTH_APP_SECRET'] = rand(2**512).to_s(36) - # Any _PW/_SECRET config settings represent passwords/secrets. If they # are blank, choose a password randomly. config.each_key do |var| @@ -63,3 +58,13 @@ Dir.glob('*/*.in') do |template_file| end output.close end + +# Copy the ssh public key file to base/generated (if a path is given) +generated_dir = File.join('base/generated') +Dir.mkdir(generated_dir) unless Dir.exists? generated_dir +if config.key?('PUBLIC_KEY_PATH') && + ! (config['PUBLIC_KEY_PATH'] == '') && + File.readable?(config['PUBLIC_KEY_PATH']) + FileUtils.cp(config['PUBLIC_KEY_PATH'], + File.join(generated_dir, 'id_rsa.pub')) +end