Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
shadowban-eu-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
shadowban-eu-backend
Commits
dfd23efb
Commit
dfd23efb
authored
Aug 22, 2019
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add: install and startup script; read runtime config from .env.* files
parent
ace9d1e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
.env.example
.env.example
+9
-0
.gitignore
.gitignore
+1
-0
install.sh
install.sh
+14
-0
run.sh
run.sh
+23
-0
No files found.
.env.example
0 → 100644
View file @
dfd23efb
ACCOUNT_FILE=./.htaccounts
LOG_FILE=./logs/results.log
DEBUG_FILE=./logs/debug.log
PORT=4040
MONGO_HOST=127.0.0.1
MONGO_PORT=27017
MONGO_DB=tester
MONGO_RESULTS_COLLECTION=results
MONGO_OVERSHOT_COLLECTION=overshot
.gitignore
View file @
dfd23efb
...
...
@@ -52,4 +52,5 @@ node_modules
# .env
.env
.env.*
!.env.example
.ht*
install.sh
0 → 100755
View file @
dfd23efb
#!/usr/bin/env bash
echo
-n
"Looking for Python3: "
if
!
hash
python3
;
then
echo
-n
"
\n
Please install Python3 to use this program!"
fi
echo
"OK"
echo
"Installing dependencies..."
pip3
install
-r
requirements.txt
--no-cache-dir
echo
-e
"
\n
----------------------------"
echo
"All done!
\o
/"
echo
"Run 'PYTON_ENV=[development|prodcution] ./run.sh' to start the server!"
run.sh
0 → 100755
View file @
dfd23efb
if
[
"
$PYTHON_ENV
"
!=
'production'
]
&&
[
"
$PYTHON_ENV
"
!=
'development'
]
;
then
echo
"Please provide a PYTHON_ENV value of 'production' or 'development'"
echo
"e.g.
$
PYTHON_ENV=development
$0
"
exit
fi
EXPECTED_ENV_FILE
=
"./.env.
$PYTHON_ENV
"
if
[
!
-f
$EXPECTED_ENV_FILE
]
;
then
echo
"Please provide a configuration file {
$EXPECTED_ENV_FILE
}!"
fi
echo
"Using configuration from:
$EXPECTED_ENV_FILE
"
source
$EXPECTED_ENV_FILE
echo
"Starting server..."
python3 ./backend.py
\
--account-file
$ACCOUNT_FILE
\
--log
$LOG_FILE
\
--debug
$DEBUG_FILE
\
--port
"
$PORT
"
\
--mongo-host
$MONGO_HOST
\
--mongo-port
$MONGO_PORT
\
--mongo-db
$MONGO_DB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment