Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
ICS Control System Infrastructure
csentry
Commits
9cbbb5cb
Commit
9cbbb5cb
authored
7 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Remove passwords when displaying settings
parent
d8cdcf5e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/factory.py
+8
-3
8 additions, 3 deletions
app/factory.py
with
8 additions
and
3 deletions
app/factory.py
+
8
−
3
View file @
9cbbb5cb
...
...
@@ -83,9 +83,14 @@ def create_app(config=None):
handler
.
setLevel
(
logging
.
DEBUG
)
app
.
logger
.
addHandler
(
handler
)
app
.
logger
.
info
(
'
CSEntry created!
'
)
app
.
logger
.
info
(
'
Settings:
\n
{}
'
.
format
(
'
\n
'
.
join
([
'
{}: {}
'
.
format
(
key
,
value
)
for
key
,
value
in
app
.
config
.
items
()
if
key
not
in
(
'
SECRET_KEY
'
,
'
LDAP_BIND_USER_PASSWORD
'
)])))
# Remove variables that contain a password
settings_to_display
=
[
f
'
{
key
}
:
{
value
}
'
for
key
,
value
in
app
.
config
.
items
()
if
key
not
in
(
'
SECRET_KEY
'
,
'
LDAP_BIND_USER_PASSWORD
'
,
'
MAIL_CREDENTIALS
'
,
'
SQLALCHEMY_DATABASE_URI
'
)]
# The repr() of make_url hides the password
settings_to_display
.
append
(
f
'
SQLALCHEMY_DATABASE_URI:
{
sa
.
engine
.
url
.
make_url
(
app
.
config
[
"
SQLALCHEMY_DATABASE_URI
"
])
!r}
'
)
settings_string
=
'
\n
'
.
join
(
settings_to_display
)
app
.
logger
.
info
(
f
'
Settings:
\n
{
settings_string
}
'
)
bootstrap
.
init_app
(
app
)
db
.
init_app
(
app
)
...
...
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