Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Webapps Deliverer
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
Container 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
vaclab
Webapps Deliverer
Commits
5f5b094f
Commit
5f5b094f
authored
4 years ago
by
Rolf Niepraschk
Browse files
Options
Downloads
Patches
Plain Diff
Parameterübergabe angepasst
parent
9c2f079c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server
+12
-9
12 additions, 9 deletions
server
server.py
+8
-3
8 additions, 3 deletions
server.py
webapps-deliverer.service
+4
-1
4 additions, 1 deletion
webapps-deliverer.service
with
24 additions
and
13 deletions
server
+
12
−
9
View file @
5f5b094f
#!/bin/bash
# $1 = flask port
# $2 = data path
# $1 = flask port (required)
# $2 = data path (required)
# $3 = flask env (optional: development or production, default: development)
# $4 = flask debug (optional: 0 or 1, default: 1)
if
[
$#
-lt
2
]
;
then
echo
"error:
missing parameter
"
echo
"error:
at least two parameters are expected
"
exit
-1
fi
export
FLASK_RUN_PORT
=
"
$1
"
export
FLASK_APP
=
server.py
export
FLASK_DEBUG
=
1
export
FLASK_ENV
=
development
# TODO: FLASK_ENV=production
FLASK_RUN_PORT
=
{
$1
}
DATA_PATH
={
$2
}
FLASK_ENV
=
${
3
:-
development
}
FLASK_DEBUG
=
${
4
:-
1
}
python3
-m
venv ./
source
bin/activate
pip3
install
-e
.
python3 server.py
"
$2
"
pip3
install
-e
./
python3 server.py
"
$1
"
"
$2
"
"
$3
"
"
$4
"
This diff is collapsed.
Click to expand it.
server.py
+
8
−
3
View file @
5f5b094f
...
...
@@ -4,9 +4,12 @@ from flask_cors import CORS
from
urllib.parse
import
urlparse
import
sys
,
requests
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
DATA_PATH
=
sys
.
argv
[
1
]
FLASK_RUN_PORT
=
sys
.
argv
[
1
]
DATA_PATH
=
sys
.
argv
[
2
]
FLASK_ENV
=
sys
.
argv
[
3
]
FLASK_DEBUG
=
sys
.
argv
[
4
]
COUCHDB_PROTO
=
'
http
'
COUCHDB_PORT
=
'
5984
'
DB
=
'
vl_db
'
...
...
@@ -81,4 +84,6 @@ def couchdb_proxy(p=''):
return
response
if
__name__
==
'
__main__
'
:
app
.
run
(
host
=
'
0.0.0.0
'
)
app
.
config
[
"
ENV
"
]
=
FLASK_ENV
app
.
config
[
"
DEBUG
"
]
=
FLASK_DEBUG
app
.
run
(
host
=
'
0.0.0.0
'
,
port
=
FLASK_RUN_PORT
)
This diff is collapsed.
Click to expand it.
webapps-deliverer.service
+
4
−
1
View file @
5f5b094f
...
...
@@ -6,12 +6,15 @@ After=network.target
User
=
nobody
Environment
=
FLASK_PORT=8081
Environment
=
DATA_PATH=/srv/www/data/
Environment
=
FLASK_ENV=production
Environment
=
FLASK_DEBUG=1
Type
=
simple
StandardOutput
=
null
StandardError
=
null
Restart
=
no
WorkingDirectory
=
/usr/local/share/webapps-deliverer
ExecStart
=
/bin/bash -l -c "source bin/activate;./server ${FLASK_PORT} ${DATA_PATH}"
ExecStart
=
/bin/bash -l -c "source bin/activate;./server
\
${FLASK_PORT} ${DATA_PATH} ${FLASK_ENV} ${FLASK_DEBUG}"
[Install]
WantedBy
=
multi-user.target
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