Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f35b9794
Commit
f35b9794
authored
Jun 14, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring `rake postgresql_md5_hash` to CE
parent
1a2ce3cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
lib/tasks/migrate/setup_postgresql.rake
lib/tasks/migrate/setup_postgresql.rake
+15
-0
No files found.
lib/tasks/migrate/setup_postgresql.rake
View file @
f35b9794
...
...
@@ -22,3 +22,18 @@ task setup_postgresql: :environment do
ProjectNameLowerIndex
.
new
.
up
AddPathIndexToRedirectRoutes
.
new
.
up
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment