mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-14 15:53:28 +01:00
recommend running pywb.apps.wayback make uWSGI optional (but included in Vagrant) rename run.sh -> run-uwsgi.sh
40 lines
1.0 KiB
Bash
Executable File
40 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
mypath=$(cd `dirname $0` && pwd)
|
|
|
|
# Set a different config file
|
|
#export 'PYWB_CONFIG_FILE=myconfig.yaml'
|
|
|
|
app="pywb.apps.wayback"
|
|
|
|
params="--http-socket :8080 -b 65536"
|
|
#params="--static-map /static=$mypath/static --http-socket :8080 -b 65536"
|
|
|
|
if [ -z "$1" ]; then
|
|
# Standard root config
|
|
params="$params --wsgi $app"
|
|
else
|
|
# run with --mount to specify a non-root context
|
|
# requires a file not a package, so creating a mount_run.py to load the package
|
|
echo "#!/bin/python\n" > $mypath/mount_run.py
|
|
echo "import $app\napplication = $app.application" >> $mypath/mount_run.py
|
|
params="$params --mount $1=mount_run.py --no-default-app --manage-script-name"
|
|
fi
|
|
|
|
# Support for virtualenv
|
|
if [ -n "$VIRTUAL_ENV" ] ; then
|
|
params="$params -H $VIRTUAL_ENV"
|
|
fi
|
|
|
|
# Support for default, non-virtualenv path on OS X
|
|
osx_uwsgi_path="/System/Library/Frameworks/Python.framework/Versions/2.7/bin/uwsgi"
|
|
|
|
if [ -e "$osx_uwsgi_path" ]; then
|
|
uwsgi=$osx_uwsgi_path
|
|
else
|
|
uwsgi="uwsgi"
|
|
fi
|
|
|
|
$uwsgi $params
|
|
|