Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
aea340bf
Commit
aea340bf
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue with missing admin password when started with no repo db.
parent
bc365373
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#41243
passed
6 years ago
Stage: build
Stage: test
Stage: release
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nomad/config.py
+1
-1
1 addition, 1 deletion
nomad/config.py
nomad/infrastructure.py
+5
-6
5 additions, 6 deletions
nomad/infrastructure.py
with
6 additions
and
7 deletions
nomad/config.py
+
1
−
1
View file @
aea340bf
...
@@ -110,7 +110,7 @@ services = NomadServicesConfig(
...
@@ -110,7 +110,7 @@ services = NomadServicesConfig(
api_base_path
=
os
.
environ
.
get
(
'
NOMAD_API_BASE_PATH
'
,
'
/nomad/api
'
),
api_base_path
=
os
.
environ
.
get
(
'
NOMAD_API_BASE_PATH
'
,
'
/nomad/api
'
),
api_secret
=
os
.
environ
.
get
(
'
NOMAD_API_SECRET
'
,
'
defaultApiSecret
'
),
api_secret
=
os
.
environ
.
get
(
'
NOMAD_API_SECRET
'
,
'
defaultApiSecret
'
),
admin_password
=
os
.
environ
.
get
(
'
NOMAD_API_ADMIN_PASSWORD
'
,
'
password
'
),
admin_password
=
os
.
environ
.
get
(
'
NOMAD_API_ADMIN_PASSWORD
'
,
'
password
'
),
disable_reset
=
os
.
environ
.
get
(
'
NOMAD_API_DISABLE_RESET
'
,
'
tru
e
'
)
==
'
fals
e
'
disable_reset
=
os
.
environ
.
get
(
'
NOMAD_API_DISABLE_RESET
'
,
'
fals
e
'
)
==
'
tru
e
'
)
)
console_log_level
=
get_loglevel_from_env
(
'
NOMAD_CONSOLE_LOGLEVEL
'
,
default_level
=
logging
.
INFO
)
console_log_level
=
get_loglevel_from_env
(
'
NOMAD_CONSOLE_LOGLEVEL
'
,
default_level
=
logging
.
INFO
)
...
...
This diff is collapsed.
Click to expand it.
nomad/infrastructure.py
+
5
−
6
View file @
aea340bf
...
@@ -128,6 +128,11 @@ def setup_repository_db():
...
@@ -128,6 +128,11 @@ def setup_repository_db():
"
select exists(select * from information_schema.tables
"
"
select exists(select * from information_schema.tables
"
"
where table_name=
'
users
'
)
"
)
"
where table_name=
'
users
'
)
"
)
exists
=
cur
.
fetchone
()[
0
]
exists
=
cur
.
fetchone
()[
0
]
if
not
exists
:
logger
.
info
(
'
repository db postgres schema does not exists
'
)
reset_repository_db
()
else
:
logger
.
info
(
'
repository db postgres schema already exists
'
)
# set the admin user password
# set the admin user password
with
repository_db_connection
()
as
conn
:
with
repository_db_connection
()
as
conn
:
...
@@ -136,12 +141,6 @@ def setup_repository_db():
...
@@ -136,12 +141,6 @@ def setup_repository_db():
"
UPDATE public.users SET password=
'
%s
'
WHERE user_id=1;
"
%
"
UPDATE public.users SET password=
'
%s
'
WHERE user_id=1;
"
%
bcrypt
.
encrypt
(
config
.
services
.
admin_password
,
ident
=
'
2y
'
))
bcrypt
.
encrypt
(
config
.
services
.
admin_password
,
ident
=
'
2y
'
))
if
not
exists
:
logger
.
info
(
'
repository db postgres schema does not exists
'
)
reset_repository_db
()
else
:
logger
.
info
(
'
repository db postgres schema already exists
'
)
global
repository_db
global
repository_db
global
repository_db_conn
global
repository_db_conn
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment