Skip to content

Commit

Permalink
little backups
Browse files Browse the repository at this point in the history
  • Loading branch information
plamere committed Sep 16, 2017
1 parent 5840915 commit 1de3412
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ playlistmachinery.com

https://manager.linode.com/linodes/dashboard/linode1573908

setup subdomains at

https://manager.linode.com/dns/domain/playlistmachinery.com


webserver is nginx
api server is flask
Expand All @@ -29,6 +33,8 @@ server {
}




Get spotipy, pyen and pbl from git, install

(disabled leveldb in pbl to get it to work easily)
Expand Down
21 changes: 21 additions & 0 deletions nginx/smarterplaylists
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,24 @@ server {
alias /home/www/playlistmachinery/;
}
}

server {
server_name tweets.playlistmachinery.com;
location /api {
proxy_pass http:https://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /TweetMon {
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;

# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
proxy_pass http:https://localhost:5001;
}
location / {
alias /home/www/tweets/;
}
}
2 changes: 1 addition & 1 deletion server/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
en = pyen.Pyen()
en.debug=True

genres_enabled = True
genres_enabled = False


inventory = {
Expand Down
1 change: 1 addition & 0 deletions server/flask_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def directory():
token = auth.get_fresh_token(auth_code)
if token:
user = token['user_id']
print "directory", user
total, dir = pm.directory(user, start, count)

if len(dir) > 0:
Expand Down
7 changes: 6 additions & 1 deletion server/start_queue_processor
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
source credentials.sh
export PBL_CACHE=REDIS
python scheduler.py
#python scheduler.py

until python scheduler.py; do
echo "queue processor'' crashed with exit code $?. Respawning.." >&2
sleep 1
done
6 changes: 5 additions & 1 deletion server/start_unicorn_server
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
source credentials.sh
export PBL_CACHE=REDIS
#python flask_server.py
gunicorn -w 4 flask_server:app -b localhost:5000

until gunicorn -w 4 flask_server:app -b localhost:5000; do
echo "unicorn server crashed with exit code $?. Respawning.." >&2
sleep 1
done

0 comments on commit 1de3412

Please sign in to comment.