Oy.
parent
4f6b0088b5
commit
aaac6e2eb0
16
Makefile
16
Makefile
|
@ -81,6 +81,7 @@ deploy-heroku:
|
||||||
@git push heroku
|
@git push heroku
|
||||||
|
|
||||||
salt-server:
|
salt-server:
|
||||||
|
@scp -q -P 55555 settings_local_server.py deploy@69.164.221.98:/var/www/snipt/settings_local.py
|
||||||
@scp -q -P 55555 -r ./salt/ deploy@69.164.221.98:salt
|
@scp -q -P 55555 -r ./salt/ deploy@69.164.221.98:salt
|
||||||
@scp -q -P 55555 -r ./pillar/ deploy@69.164.221.98:pillar
|
@scp -q -P 55555 -r ./pillar/ deploy@69.164.221.98:pillar
|
||||||
@$(ssh-server-deploy) 'sudo rm -rf /srv'
|
@$(ssh-server-deploy) 'sudo rm -rf /srv'
|
||||||
|
@ -112,12 +113,13 @@ server:
|
||||||
@$(ssh-server-root) 'sudo mv ~/salt /srv/salt'
|
@$(ssh-server-root) 'sudo mv ~/salt /srv/salt'
|
||||||
@$(ssh-server-root) 'sudo mv ~/pillar /srv/pillar'
|
@$(ssh-server-root) 'sudo mv ~/pillar /srv/pillar'
|
||||||
@$(ssh-server-root) 'sudo salt-call --local state.highstate'
|
@$(ssh-server-root) 'sudo salt-call --local state.highstate'
|
||||||
@scp -q -P 55555 settings_local_server.py deploy@69.164.221.98:/var/www/snipt/settings_local.py
|
|
||||||
|
server-init:
|
||||||
@$(ssh-server-deploy) 'cd /var/www/snipt; make db;'
|
@$(ssh-server-deploy) 'cd /var/www/snipt; make db;'
|
||||||
@$(ssh-server-deploy) '$(pm) syncdb;'
|
@$(ssh-server-deploy) '$(pm) syncdb --noinput;'
|
||||||
@$(ssh-server-deploy) '$(pm) migrate;'
|
@$(ssh-server-deploy) '$(pm) migrate;'
|
||||||
@$(ssh-server-deploy) '$(pm) backfill_api_keys'
|
@$(ssh-server-deploy) '$(pm) backfill_api_keys;'
|
||||||
@$(ssh-server-deploy) '$(pm) rebuild_index --noinput'
|
@$(ssh-server-deploy) '$(pm) rebuild_index --noinput;'
|
||||||
|
|
||||||
vagrant:
|
vagrant:
|
||||||
@vagrant up --provider=vmware_fusion
|
@vagrant up --provider=vmware_fusion
|
||||||
|
@ -137,8 +139,8 @@ vagrant:
|
||||||
@vagrant ssh -c 'cd /var/www/snipt; make db;'
|
@vagrant ssh -c 'cd /var/www/snipt; make db;'
|
||||||
@vagrant ssh -c '$(pm) syncdb;'
|
@vagrant ssh -c '$(pm) syncdb;'
|
||||||
@$(ssh-vagrant) '$(pm) migrate;'
|
@$(ssh-vagrant) '$(pm) migrate;'
|
||||||
@$(ssh-vagrant) '$(pm) backfill_api_keys'
|
@$(ssh-vagrant) '$(pm) backfill_api_keys;'
|
||||||
@$(ssh-vagrant) '$(pm) rebuild_index --noinput'
|
@$(ssh-vagrant) '$(pm) rebuild_index --noinput;'
|
||||||
|
|
||||||
.PHONY: assets, \
|
.PHONY: assets, \
|
||||||
db, \
|
db, \
|
||||||
|
@ -148,6 +150,6 @@ vagrant:
|
||||||
provision-vagrant, \
|
provision-vagrant, \
|
||||||
salt-server, \
|
salt-server, \
|
||||||
salt-vagrant, \
|
salt-vagrant, \
|
||||||
server-settings, \
|
server-init, \
|
||||||
server, \
|
server, \
|
||||||
vagrant
|
vagrant
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
This is the codebase for the website, [Snipt.net](https://snipt.net/).
|
This is the codebase for the website, [Snipt.net](https://snipt.net/).
|
||||||
|
|
||||||
# Running the Django app
|
# Running the Django app locally with Vagrant
|
||||||
|
|
||||||
Install [Vagrant](https://www.vagrantup.com/) and either [VirtualBox](https://www.virtualbox.org/) or
|
Install [Vagrant](https://www.vagrantup.com/) and either [VirtualBox](https://www.virtualbox.org/) or
|
||||||
[VMWare Fusion](http://www.vmware.com/products/fusion).
|
[VMWare Fusion](http://www.vmware.com/products/fusion).
|
||||||
|
@ -14,11 +14,14 @@ Install [Vagrant](https://www.vagrantup.com/) and either [VirtualBox](https://ww
|
||||||
5. Visit [http://local.snipt.net:8080/](http://local.snipt.net:8080/).
|
5. Visit [http://local.snipt.net:8080/](http://local.snipt.net:8080/).
|
||||||
|
|
||||||
# Deploying to a VM
|
# Deploying to a VM
|
||||||
|
|
||||||
1. Clone the repo.
|
1. Clone the repo.
|
||||||
2. `cp settings_local.py-template settings_local_server.py`
|
2. `cp settings_local.py-template settings_local_server.py`
|
||||||
3. Edit local server settings (choose a database password - you'll be prompted for it).
|
3. Edit local server settings (choose a database password - you'll be prompted for it).
|
||||||
4. Manually change the VM IP address in the Makefile.
|
4. Manually change the VM IP address in the Makefile.
|
||||||
5. `make server`
|
5. `make server`
|
||||||
|
6. SSH into the server, `sudo su - deploy`, `ssh-keygen`, and add the public key to your repo as a deploy key.
|
||||||
|
7. `make server-init`
|
||||||
|
|
||||||
# Deploying to Heroku
|
# Deploying to Heroku
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ django-debug-toolbar==0.11.0
|
||||||
django-extensions==1.2.5
|
django-extensions==1.2.5
|
||||||
django-markdown-deux==1.0.4
|
django-markdown-deux==1.0.4
|
||||||
django-pagination==1.0.7
|
django-pagination==1.0.7
|
||||||
django-sslify>=0.2
|
|
||||||
django-storages==1.1.5
|
django-storages==1.1.5
|
||||||
django-taggit==0.10
|
django-taggit==0.10
|
||||||
django-tastypie==0.10.0
|
django-tastypie==0.10.0
|
||||||
|
|
|
@ -68,7 +68,7 @@ snipt-site:
|
||||||
- group: deploy
|
- group: deploy
|
||||||
- mode: 755
|
- mode: 755
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
- group: deploy
|
- group: deploy
|
||||||
|
|
||||||
enable-snipt-site:
|
enable-snipt-site:
|
||||||
|
@ -77,8 +77,8 @@ enable-snipt-site:
|
||||||
- target: /etc/nginx/sites-available/snipt
|
- target: /etc/nginx/sites-available/snipt
|
||||||
- force: false
|
- force: false
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: service nginx restart
|
- name: service nginx restart
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
nginx:
|
nginx-extras:
|
||||||
pkg:
|
pkg:
|
||||||
- installed
|
- installed
|
||||||
|
|
||||||
|
nginx:
|
||||||
service:
|
service:
|
||||||
- running
|
- running
|
||||||
- enable: True
|
- enable: True
|
||||||
|
- require:
|
||||||
|
- pkg: nginx-extras
|
||||||
- watch:
|
- watch:
|
||||||
- file: /etc/nginx/nginx.conf
|
- file: /etc/nginx/nginx.conf
|
||||||
- file: /etc/nginx/sites-enabled/*
|
- file: /etc/nginx/sites-enabled/*
|
||||||
|
@ -12,13 +16,13 @@ nginx:
|
||||||
file.directory:
|
file.directory:
|
||||||
- mode: 755
|
- mode: 755
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
|
|
||||||
/etc/nginx/sites-enabled:
|
/etc/nginx/sites-enabled:
|
||||||
file.directory:
|
file.directory:
|
||||||
- mode: 755
|
- mode: 755
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
|
|
||||||
{% if pillar.env_name != 'vagrant' %}
|
{% if pillar.env_name != 'vagrant' %}
|
||||||
|
|
||||||
|
@ -26,7 +30,7 @@ nginx:
|
||||||
file.directory:
|
file.directory:
|
||||||
- mode: 644
|
- mode: 644
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -36,7 +40,7 @@ nginx:
|
||||||
- mode: 400
|
- mode: 400
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- require:
|
- require:
|
||||||
- pkg: nginx
|
- pkg: nginx-extras
|
||||||
|
|
||||||
/etc/nginx/sites-enabled/default:
|
/etc/nginx/sites-enabled/default:
|
||||||
file.absent
|
file.absent
|
||||||
|
|
|
@ -17,7 +17,7 @@ http {
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
|
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
|
||||||
|
|
||||||
include /etc/nginx/sites-enabled/*;
|
include /etc/nginx/sites-enabled/*;
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,6 @@ LOGGING = {
|
||||||
'loggers': {}
|
'loggers': {}
|
||||||
}
|
}
|
||||||
MIDDLEWARE_CLASSES = (
|
MIDDLEWARE_CLASSES = (
|
||||||
'sslify.middleware.SSLifyMiddleware',
|
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
|
|
@ -5,7 +5,6 @@ POSTMARK_API_KEY = ''
|
||||||
RAVEN_CONFIG = { 'dsn': '' }
|
RAVEN_CONFIG = { 'dsn': '' }
|
||||||
SECRET_KEY = 'changeme'
|
SECRET_KEY = 'changeme'
|
||||||
SESSION_COOKIE_SECURE = False
|
SESSION_COOKIE_SECURE = False
|
||||||
SSLIFY_DISABLE = True
|
|
||||||
STRIPE_SECRET_KEY = ''
|
STRIPE_SECRET_KEY = ''
|
||||||
USE_HTTPS = False
|
USE_HTTPS = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue