Commit 20ca5e30 authored by Douwe Maan's avatar Douwe Maan

Merge branch '6419-unify-setup_postgresql.rake' into 'master'

Bring `rake postgresql_md5_hash` to CE

Closes gitlab-ee#6419

See merge request gitlab-org/gitlab-ce!19830
parents 431c3f18 f35b9794
...@@ -22,3 +22,18 @@ task setup_postgresql: :environment do ...@@ -22,3 +22,18 @@ task setup_postgresql: :environment do
ProjectNameLowerIndex.new.up ProjectNameLowerIndex.new.up
AddPathIndexToRedirectRoutes.new.up AddPathIndexToRedirectRoutes.new.up
end end
desc 'GitLab | Generate PostgreSQL Password Hash'
task :postgresql_md5_hash do
require 'digest'
username = ENV.fetch('USERNAME') do |missing|
puts "You must provide an username with '#{missing}' ENV variable"
exit(1)
end
password = ENV.fetch('PASSWORD') do |missing|
puts "You must provide a password with '#{missing}' ENV variable"
exit(1)
end
hash = Digest::MD5.hexdigest("#{password}#{username}")
puts "The MD5 hash of your database password for user: #{username} -> #{hash}"
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment