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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5e4da48a
Commit
5e4da48a
authored
Sep 18, 2020
by
Sean Arnold
Committed by
Ash McKenzie
Sep 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a random password when generating users
parent
7eb1c3bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
db/fixtures/development/02_users.rb
db/fixtures/development/02_users.rb
+10
-2
No files found.
db/fixtures/development/02_users.rb
View file @
5e4da48a
...
...
@@ -22,7 +22,7 @@ class Gitlab::Seeder::Users
private
def
create_mass_users!
encrypted_password
=
Devise
::
Encryptor
.
digest
(
User
,
'12345678'
)
encrypted_password
=
Devise
::
Encryptor
.
digest
(
User
,
random_password
)
Gitlab
::
Seeder
.
with_mass_insert
(
MASS_USERS_COUNT
,
User
)
do
ActiveRecord
::
Base
.
connection
.
execute
<<~
SQL
...
...
@@ -49,6 +49,10 @@ class Gitlab::Seeder::Users
FROM users WHERE NOT admin
SQL
end
puts
'==========================================================='
puts
"INFO: Password for newly created users is:
#{
random_password
}
"
puts
'==========================================================='
end
def
create_random_users!
...
...
@@ -59,7 +63,7 @@ class Gitlab::Seeder::Users
name:
FFaker
::
Name
.
name
,
email:
FFaker
::
Internet
.
email
,
confirmed_at:
DateTime
.
now
,
password:
'12345678'
password:
random_password
)
print
'.'
...
...
@@ -68,6 +72,10 @@ class Gitlab::Seeder::Users
end
end
end
def
random_password
@random_password
||=
SecureRandom
.
hex
.
slice
(
0
,
16
)
end
end
Gitlab
::
Seeder
.
quiet
do
...
...
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