salt config changes
This commit is contained in:
parent
3c71b00d05
commit
ba1ec10a34
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
.vagrant
|
||||
.virtualenvs
|
||||
.idea
|
||||
.webassets-cache
|
||||
*.pyc
|
||||
|
|
8
Vagrantfile
vendored
8
Vagrantfile
vendored
|
@ -7,14 +7,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
salt.minion_config = "srv/minion"
|
||||
salt.run_highstate = true
|
||||
end
|
||||
config.vm.provider :digital_ocean do |provider, override|
|
||||
override.ssh.private_key_path = '~/.ssh/id_dsa'
|
||||
override.vm.box = 'digital_ocean'
|
||||
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
|
||||
|
||||
provider.client_id = ''
|
||||
provider.api_key = ''
|
||||
end
|
||||
end
|
||||
|
||||
Vagrant::Config.run do |config|
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
import json
|
||||
|
||||
import rethinkdb as rdb
|
||||
import bcrypt
|
||||
from flask import session, flash
|
||||
|
||||
from flask.ext.login import login_user, logout_user
|
||||
|
||||
from rethinkORM import RethinkModel
|
||||
|
||||
from util import gravatar_url
|
||||
from services import db, cache
|
||||
|
||||
|
@ -62,18 +57,17 @@ def cache_it(fn):
|
|||
return wrap
|
||||
|
||||
|
||||
class BaseModel(RethinkModel):
|
||||
class BaseModel():
|
||||
|
||||
table = None
|
||||
_conn = db
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
if not kwargs.get('conn'):
|
||||
kwargs['conn'] = db
|
||||
super(BaseModel, self).__init__(**kwargs)
|
||||
|
||||
@classmethod
|
||||
def create(cls, **kwargs):
|
||||
return super(BaseModel, cls).create(**kwargs)
|
||||
def create(self, **kwargs):
|
||||
return rdb.table(self.table).insert(kwargs).run(self._conn)
|
||||
|
||||
@cache_it
|
||||
def get_by_id(self, id):
|
||||
|
@ -135,11 +129,6 @@ class User(BaseModel):
|
|||
def login(self, login, password):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def get(cls, id):
|
||||
print id
|
||||
return cls(id=id)
|
||||
|
||||
@classmethod
|
||||
def auth(cls, username, password):
|
||||
u = User()
|
||||
|
|
22
requirements.txt
Normal file
22
requirements.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
Flask==0.10.1
|
||||
Flask-Assets==0.8
|
||||
Flask-Bcrypt==0.5.2
|
||||
Flask-Login==0.2.7
|
||||
beautifulsoup4==4.3.2
|
||||
boto==2.13.3
|
||||
closure==20121212
|
||||
gevent==0.13.8
|
||||
ghdiff==0.1
|
||||
gittle==0.2.2
|
||||
itsdangerous==0.23
|
||||
lxml==3.2.3
|
||||
markdown2==2.1.0
|
||||
pyzmq==13.0.0
|
||||
recaptcha==1.0rc1
|
||||
recaptcha-client==1.0.6
|
||||
redis==2.8.0
|
||||
rethinkdb==1.10.0-0
|
||||
simplejson==3.3.0
|
||||
sockjs-tornado==1.0.0
|
||||
supervisor==3.0
|
||||
tornado==3.1.1
|
|
@ -1,3 +1,10 @@
|
|||
extra-repos:
|
||||
pkgrepo.managed:
|
||||
- ppa: chris-lea/python-redis
|
||||
- ppa: brianmercer/redis
|
||||
- ppa: chris-lea/node.js
|
||||
- ppa: nginx/stable
|
||||
|
||||
common-pkgs:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
|
@ -19,3 +26,5 @@ common-pkgs:
|
|||
- curl
|
||||
- libxml2-dev
|
||||
- libxslt-dev
|
||||
- require:
|
||||
- pkgrepo.managed: extra-repos
|
|
@ -1,9 +1,13 @@
|
|||
node-repos:
|
||||
pkgrepo.managed:
|
||||
- ppa: chris-lea/node.js
|
||||
|
||||
nodejs:
|
||||
pkg:
|
||||
- installed
|
||||
- require:
|
||||
- pkgrepo.managed: node-repos
|
||||
pkg.installed
|
||||
|
||||
nodejs-dev:
|
||||
pkg.installed
|
||||
|
||||
npm:
|
||||
pkg.installed
|
||||
|
||||
bower:
|
||||
npm.installed:
|
||||
- require:
|
||||
- pkg.installed: npm
|
|
@ -1,17 +1,40 @@
|
|||
python-pkgs:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- python-dev
|
||||
- python-pip
|
||||
- build-essential
|
||||
python-dev:
|
||||
pkg.installed
|
||||
|
||||
python-pip:
|
||||
pkg.installed
|
||||
|
||||
{% for pkg in ['closure', 'ghdiff', 'tornado', 'pyzmq', 'itsdangerous', 'boto', 'redis', 'simplejson', 'sockjs-tornado', 'flask', 'flask-bcrypt', 'flask-login', 'flask-assets', 'gittle', 'gevent', 'lxml', 'markdown2', 'recaptcha-client', 'RethinkORM' ] %}
|
||||
{{ pkg }}-pip:
|
||||
pip:
|
||||
- name: {{ pkg }}
|
||||
- installed
|
||||
build-essential:
|
||||
pkg.installed
|
||||
|
||||
realms-repo:
|
||||
git.latest:
|
||||
- unless: test -e /vagrant
|
||||
- name: git@github.com:scragg0x/realms.git
|
||||
- target: /home/deploy
|
||||
- rev: master
|
||||
- user: deploy
|
||||
- identity: /home/deploy/.ssh/id_rsa
|
||||
|
||||
realms-link:
|
||||
cmd.run:
|
||||
- onlyif: test -e /vagrant
|
||||
- name: ln -s /vagrant /home/deploy/realms
|
||||
|
||||
/home/deploy/virtualenvs/realms:
|
||||
file.directory:
|
||||
- user: deploy
|
||||
- group: deploy
|
||||
- makedirs: True
|
||||
- recurse:
|
||||
- user
|
||||
- group
|
||||
- require:
|
||||
- pkg.installed: common-pkgs
|
||||
- pkg.installed: rethinkdb
|
||||
{% endfor %}
|
||||
- user.present: deploy
|
||||
virtualenv.managed:
|
||||
- name: /home/deploy/virtualenvs/realms
|
||||
- requirements: /home/deploy/realms/requirements.txt
|
||||
- watch:
|
||||
- git: realms-repo
|
||||
- require:
|
||||
- file.directory: /home/deploy/virtualenvs/realms
|
|
@ -1,8 +1,3 @@
|
|||
redis-repos:
|
||||
pkgrepo.managed:
|
||||
- ppa: chris-lea/python-redis
|
||||
- ppa: brianmercer/redis
|
||||
|
||||
redis-server:
|
||||
pkg:
|
||||
- installed
|
||||
|
@ -12,4 +7,3 @@ redis-server:
|
|||
- reload: True
|
||||
- require:
|
||||
- pkg: redis-server
|
||||
- pkgrepo.managed: redis-repos
|
||||
|
|
|
@ -9,12 +9,6 @@ rethinkdb:
|
|||
pkg:
|
||||
- installed
|
||||
|
||||
python-pip:
|
||||
pkg.installed
|
||||
|
||||
build-essential:
|
||||
pkg.installed
|
||||
|
||||
rethinkdb-pip:
|
||||
pip:
|
||||
- name: rethinkdb
|
||||
|
|
|
@ -25,8 +25,8 @@ nocleanup = true
|
|||
childlogdir = /tmp
|
||||
strip_ansi = false
|
||||
|
||||
[program:reimagine]
|
||||
command=/usr/bin/python /vagrant/app.py
|
||||
[program:realms]
|
||||
command=/home/deploy/virtualenvs/realms/bin/python /home/deploy/realms/app.py
|
||||
|
||||
[program:rethinkdb]
|
||||
command=/usr/bin/rethinkdb --config-file /etc/rethinkdb/rdb0.conf
|
||||
|
|
|
@ -2,6 +2,7 @@ base:
|
|||
'*':
|
||||
- common
|
||||
- users
|
||||
- nodejs
|
||||
- redis
|
||||
- nginx
|
||||
- rethinkdb
|
||||
|
|
|
@ -4,12 +4,6 @@ deploy:
|
|||
- home: /home/deploy
|
||||
- fullname: Deploy
|
||||
|
||||
scragg:
|
||||
user.present:
|
||||
- fullname: Matthew Scragg
|
||||
- shell: /bin/bash
|
||||
- home: /home/scragg
|
||||
|
||||
sudo:
|
||||
pkg:
|
||||
- installed
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
deploy ALL=(ALL) NOPASSWD:ALL
|
||||
mrobinson ALL=(ALL) NOPASSWD:ALL
|
||||
|
|
Loading…
Reference in a new issue