swizzler/install.sh
The Dod d959492b2b Basic auth (existing instannces: read commit text)
First, chill:
After you pull this, your current installation is supposed to
work fine *as is* (please let me know if it doesn't).

Nevertheless, it is recommended to enable basic auth by adding
these 2 lines to the `[swizzler]` section of `cherrypy.config`
(also documented at `cherrypy.config.example`)

    browser_user: 'someuser'
    browser_password: 'somepassword'

User and password don't need to be too long and funky
(or have anything to do with the user:pasword at rpc_url).
It's just a line of defense against [for example] trojans
who may not have significant file system rights,
but can still TCP-connect to localhost ;)

Existng apps should also `chmod 600 cherrypy.config`
(running `/.install.sh` again will do this as well),
because it would now contain a plaintext password
(and we don't want trojans yada yada).

Swizzle safely.
2014-04-01 19:33:13 +07:00

19 lines
812 B
Bash
Executable File

#!/bin/sh
# Note: python-bitcoinrpc and functioncache are twister-specific branches
# Perhaps their pull-requests will get merged upstream one day (and we'll rebase when it happens)
# but we can't let it stop us :)
git submodule update --init
if [ -f cherrypy.config ] ; then
echo you already have cherrypy.config
else
sed -e "s:/PATH/HERE:`pwd`:" \
-e "s/RANDOM/$(python -c "import random; print random._urandom(60).encode('base_64').strip().replace('\n','').replace('/','')")/" \
< cherrypy.config.example > cherrypy.config
echo "created cherrypy.config. Now edit it to taste ;)"
fi
chmod 600 cherrypy.config # chmod even if it exists :)
if [ ! -f appdir.py ] ; then
echo "# Stupid but effective trick to know where we are:">appdir.py
echo "APPDIR = '$(pwd)'">>appdir.py
fi