-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstartORIGINAL.sh
More file actions
41 lines (25 loc) · 866 Bytes
/
startORIGINAL.sh
File metadata and controls
41 lines (25 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Exit early on errors
set -eu
# Python buffers stdout. Without this, you won't see what you "print" in the Activity Logs
export PYTHONUNBUFFERED=true
# Install Python 3 virtual env
VIRTUALENV=.venv
# create certificate and key file:
# openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
# mkdir userdata
#create venv
python -m venv $VIRTUALENV
if [ ! -d $VIRTUALENV ]; then
#virtualenv -p python3 $VIRTUALENV
source $VIRTUALENV/bin/activate
fi
# Install the requirements
$VIRTUALENV/bin/pip install -r requirements.txt
# Run a glorious Python 3 server
$VIRTUALENV/bin/python3 server.py
# create localhost certificats:
# openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem
# allow chrome to open self signed https localhost:
# chrome://flags/#allow-insecure-localhost
#deactivate