Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stechuhr-server
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pandemic_Response
stechuhr-server
Commits
4a275cad
Commit
4a275cad
authored
4 years ago
by
David Huss
Browse files
Options
Downloads
Patches
Plain Diff
Allow ENV to set config dir
parent
fbd37f41
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
stechuhr-server.service
+2
-1
2 additions, 1 deletion
stechuhr-server.service
stechuhr_server/config.py
+4
-0
4 additions, 0 deletions
stechuhr_server/config.py
with
6 additions
and
1 deletion
stechuhr-server.service
+
2
−
1
View file @
4a275cad
...
...
@@ -5,6 +5,8 @@ Before=nginx.service
[Service]
Type
=
simple
User
=
wwwrun
Environment
=
"STECHUHR-SERVER_CONFIG_PATH=/etc/stechuhr-server/config.toml"
WorkingDirectory
=
/srv/stechuhr-server
ExecStart
=
/srv/stechuhr-server/env/bin/gunicorn stechuhr_server.server:app
Restart
=
always
RestartSec
=
30
...
...
@@ -13,7 +15,6 @@ PrivateTmp=yes
ProtectSystem
=
full
NoNewPrivileges
=
yes
AmbientCapabilities
=
CAP_NET_BIND_SERVICE
WorkingDirectory
=
/srv/stechuhr-server
[Install]
WantedBy
=
multi-user.target
...
...
This diff is collapsed.
Click to expand it.
stechuhr_server/config.py
+
4
−
0
View file @
4a275cad
...
...
@@ -90,6 +90,10 @@ def initialize_config(application_name: str, default_config: str, app) -> dict:
exit
(
1
)
app
.
logger
.
info
(
"
Read config from: {}
"
.
format
(
config_path
))
# Log info about environment variable if not set
if
os
.
environ
.
get
(
config_path_environment_variable
)
is
None
:
app
.
logger
.
info
(
"
Override config path by setting the Environment variable {}=
"
.
format
(
config_path_environment_variable
))
return
config
def
config_has_missing_keys
(
config
,
default_config
,
default_strconfig
,
app
)
->
bool
:
...
...
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