Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
3f24e4dc
Commit
3f24e4dc
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Add a main() function
parent
b1fddb7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/start.py
+11
-8
11 additions, 8 deletions
docker/start.py
with
11 additions
and
8 deletions
docker/start.py
+
11
−
8
View file @
3f24e4dc
...
...
@@ -129,16 +129,15 @@ def run_generate_config(environ):
os
.
execv
(
"
/usr/local/bin/python
"
,
args
)
# Prepare the configuration
mode
=
sys
.
arg
v
[
1
]
if
len
(
sys
.
arg
v
)
>
1
else
None
ownership
=
"
{}:{}
"
.
format
(
environ
.
get
(
"
UID
"
,
991
),
environ
.
get
(
"
GID
"
,
991
))
def
main
(
args
,
environ
):
mode
=
arg
s
[
1
]
if
len
(
arg
s
)
>
1
else
None
ownership
=
"
{}:{}
"
.
format
(
environ
.
get
(
"
UID
"
,
991
),
environ
.
get
(
"
GID
"
,
991
))
# In generate mode, generate a configuration, missing keys, then exit
if
mode
==
"
generate
"
:
run_generate_config
(
environ
)
# In generate mode, generate a configuration, missing keys, then exit
if
mode
==
"
generate
"
:
return
run_generate_config
(
environ
)
# In normal mode, generate missing keys if any, then run synapse
else
:
# In normal mode, generate missing keys if any, then run synapse
if
"
SYNAPSE_CONFIG_PATH
"
in
environ
:
config_path
=
environ
[
"
SYNAPSE_CONFIG_PATH
"
]
else
:
...
...
@@ -158,3 +157,7 @@ else:
# Generate missing keys and start synapse
subprocess
.
check_output
(
args
+
[
"
--generate-keys
"
])
os
.
execv
(
"
/sbin/su-exec
"
,
[
"
su-exec
"
,
ownership
]
+
args
)
if
__name__
==
"
__main__
"
:
main
(
sys
.
argv
,
os
.
environ
)
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