Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beeMapsoftwebinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Softweb Inc
beeMapsoftwebinc
Commits
4b6f760c
Commit
4b6f760c
authored
4 years ago
by
a-ruskomaa
Browse files
Options
Downloads
Patches
Plain Diff
Use a static secret key when running on App Engine, otherwise generate a random key.
parent
d3553f33
No related branches found
Branches containing commit
No related tags found
2 merge requests
!31
Ci bugfix add secret key
,
!30
Replace the randomized secret key with a static key
Pipeline
#4330
passed
4 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+9
-5
9 additions, 5 deletions
main.py
with
9 additions
and
5 deletions
main.py
+
9
−
5
View file @
4b6f760c
...
...
@@ -12,18 +12,22 @@ from opencensus.trace.tracer import Tracer
from
opencensus.ext.flask.flask_middleware
import
FlaskMiddleware
from
opencensus.trace.samplers
import
ProbabilitySampler
app
=
Flask
(
__name__
)
depl_env
=
os
.
getenv
(
"
DEPLOYMENT_ENVIRONMENT
"
)
if
depl_env
==
'
production
'
or
depl_env
==
'
staging
'
:
if
os
.
getenv
(
'
GAE_ENV
'
,
''
).
startswith
(
'
standard
'
):
client
=
google
.
cloud
.
logging
.
Client
()
handler
=
CloudLoggingHandler
(
client
)
setup_logging
(
handler
)
logging
.
getLogger
().
setLevel
(
logging
.
DEBUG
)
app
=
Flask
(
__name__
)
app
.
config
.
from_pyfile
(
'
config/config.py
'
)
if
os
.
getenv
(
'
GAE_ENV
'
,
''
).
startswith
(
'
standard
'
):
logging
.
info
(
"
Loading app configuration from file
"
)
app
.
config
.
from_pyfile
(
'
config/config.py
'
)
if
not
app
.
secret_key
:
logging
.
info
(
"
Generating a random secret key
"
)
app
.
secret_key
=
os
.
urandom
(
16
)
def
main
():
sde
=
StackdriverExporter
(
...
...
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