fix config read bug

changed install script just or vagrant
updated readme
This commit is contained in:
scragg 2014-10-23 22:22:30 -05:00
parent d2171f9498
commit 528c28fefe
5 changed files with 21 additions and 67 deletions

View file

@ -46,20 +46,11 @@ Easiest way.
pip install realms-wiki pip install realms-wiki
### Install from Git ### Installing from Git (Ubuntu)
Use this method for development.
git clone https://github.com/scragg0x/realms-wiki git clone https://github.com/scragg0x/realms-wiki
cd realms-wiki cd realms-wiki
The included install script should work for Ubuntu.
sudo bash install.sh
If it fails and you are running Ubuntu, open an issue.
Additional packages from the script are as follows:
sudo apt-get install -y software-properties-common python-software-properties sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository -y ppa:chris-lea/node.js sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update sudo apt-get update
@ -67,6 +58,12 @@ Additional packages from the script are as follows:
sudo npm install -g bower sudo npm install -g bower
bower install bower install
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
realms-wiki start
NodeJS is for installing [bower](http://bower.io) and it's used for pulling front end dependencies NodeJS is for installing [bower](http://bower.io) and it's used for pulling front end dependencies
### OSX / Windows ### OSX / Windows
@ -86,8 +83,6 @@ Then execute the following in the terminal:
git clone https://github.com/scragg0x/realms-wiki git clone https://github.com/scragg0x/realms-wiki
cd realms-wiki cd realms-wiki
vagrant up vagrant up
vagrant ssh
realms-wiki dev
Check ```http://127.0.0.1:5000/``` to make sure it's running. Check ```http://127.0.0.1:5000/``` to make sure it's running.

View file

@ -3,17 +3,10 @@
# Provision script created for Ubuntu 14.04 # Provision script created for Ubuntu 14.04
APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_USER="$( stat -c '%U' ${APP_DIR} )"
if [ -d "/vagrant" ]; then if [ -d "/vagrant" ]; then
# Control will enter here if $DIRECTORY exists. # Control will enter here if $DIRECTORY exists.
APP_DIR="/vagrant" APP_DIR="/vagrant"
APP_USER="vagrant"
fi
if [ "${APP_USER}" == "root" ]; then
echo "Installing app as root is not recommended"
echo "Username is determined by owner of application directory."
fi fi
echo "Provisioning..." echo "Provisioning..."
@ -46,55 +39,22 @@ libffi-dev libyaml-dev libssl-dev nodejs
# Install frontend assets # Install frontend assets
sudo npm install -g bower sudo npm install -g bower
sudo -iu ${APP_USER} bower --allow-root --config.cwd=${APP_DIR} --config.directory=realms/static/vendor --config.interactive=false install
sudo -iu ${APP_USER} virtualenv ${APP_DIR}/.venv cd ${APP_DIR}
cd ${APP_DIR} && sudo -iu ${APP_USER} ${APP_DIR}/.venv/bin/pip install -r ${APP_DIR}/requirements-dev.txt bower --config.interactive=false install
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
echo "Installing start scripts" echo "Installing start scripts"
cat << EOF > /usr/local/bin/realms-wiki cat << EOF > /usr/local/bin/realms-wiki
#!/bin/bash #!/bin/bash
${APP_DIR}/realms-wiki "\$@" ${APP_DIR}/.venv/bin/realms-wiki "\$@"
EOF EOF
sudo chmod +x /usr/local/bin/realms-wiki sudo chmod +x /usr/local/bin/realms-wiki
cat << EOF > /etc/init/realms-wiki.conf realms-wiki start
limit nofile 65335 65335
respawn
description "Realms Wiki"
author "scragg@gmail.com"
chdir ${APP_DIR}
env PATH=${APP_DIR}/.venv/bin:/usr/local/bin:/usr/bin:/bin:$PATH
env LC_ALL=en_US.UTF-8
env GEVENT_RESOLVER=ares
export PATH
export LC_ALL
export GEVENT_RESOLVER
setuid ${APP_USER}
setgid ${APP_USER}
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec gunicorn \
--name realms-wiki \
--access-logfile - \
--error-logfile - \
--worker-class gevent \
--workers 2 \
--bind 0.0.0.0:5000 \
--user ${APP_USER} \
--group ${APP_USER} \
--chdir ${APP_DIR} \
wsgi:app
EOF

View file

@ -17,8 +17,10 @@ def read():
conf[k[7:]] = v conf[k[7:]] = v
loc = get_path() loc = get_path()
with open(loc) as f:
conf.update(json.load(f)) if loc:
with open(loc) as f:
conf.update(json.load(f))
for k in ['APP_PATH', 'USER_HOME']: for k in ['APP_PATH', 'USER_HOME']:
if k in conf: if k in conf:

View file

@ -1 +1 @@
__version__ = '0.3.31' __version__ = '0.4.0'

View file

@ -9,9 +9,6 @@ DESCRIPTION = "Simple git based wiki"
with open('README.md') as f: with open('README.md') as f:
LONG_DESCRIPTION = f.read() LONG_DESCRIPTION = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
__version__ = None __version__ = None
exec(open('realms/version.py').read()) exec(open('realms/version.py').read())