summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ROUTES12
-rwxr-xr-xconf/nginx.conf10
-rwxr-xr-xdb/0-create.psql8
-rwxr-xr-xdb/0-create.psql-altered8
-rwxr-xr-xphotobooth/fullscreenphotobooth.st4
-rwxr-xr-xscripts/emailposter.py7
-rwxr-xr-xscripts/fill.image_altars.py2
-rwxr-xr-xscripts/fill.image_urls.py18
-rwxr-xr-xscripts/fix_fav_counts.py3
-rwxr-xr-xscripts/hiscores.py2
-rwxr-xr-xscripts/idgi/rename.sh2
-rwxr-xr-xscripts/logreport.py2
-rwxr-xr-xscripts/s3upload.py8
13 files changed, 47 insertions, 39 deletions
diff --git a/ROUTES b/ROUTES
index 8f3e4fb..2d8f31a 100644
--- a/ROUTES
+++ b/ROUTES
@@ -14,15 +14,15 @@
(GET "/irhell" (redirect-to "/irhell/"))
(GET "/irhell/" (serve-static "static/319" "irhell.html"))
(GET "/irhell/*" (serve-static "static/319" (params :*)))
- (GET "http://www.dump.fm/*" (redirect-to "http://dump.fm"))
- (GET "http://:sub.dump.fm/" (validated-chat session (params :sub)))
- (GET "http://:sub.dump.fm/chat" (validated-chat session (params :sub)))
- (GET "http://:sub.dump.fm/chat" (validated-chat session (params :sub) (params :t)))
+ (GET "http://www.hump.fm/*" (redirect-to "https://hump.fm"))
+ (GET "https://:sub.hump.fm/" (validated-chat session (params :sub)))
+ (GET "https://:sub.hump.fm/chat" (validated-chat session (params :sub)))
+ (GET "https://:sub.hump.fm/chat" (validated-chat session (params :sub) (params :t)))
(GET "/:room/chat" (validated-chat session (params :room)))
(GET "/chat" (validated-chat session *default-room*))
(GET "/chat/:t" (validated-chat session *default-room* (params :t)))
- (GET "http://:sub.dump.fm/log" (validated-log session (params :sub) "0" params))
- (GET "http://:sub.dump.fm/log/:offset" (validated-log session (params :sub) (params :offset) params))
+ (GET "https://:sub.hump.fm/log" (validated-log session (params :sub) "0" params))
+ (GET "https://:sub.hump.fm/log/:offset" (validated-log session (params :sub) (params :offset) params))
(GET "/log" (validated-log session *default-room* "0" params))
(GET "/log/:offset" (validated-log session *default-room* (params :offset) params))
(GET "/r/:room/log" (validated-log session (params :room) "0" params))
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 4b2f403..47a613e 100755
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -1,4 +1,4 @@
-user dumpfmprod;
+user humpfmprod;
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
@@ -29,7 +29,7 @@ http {
server {
listen 80;
error_page 502 = /static/error/502.html;
- server_name .dump.fm;
+ server_name .hump.fm;
client_max_body_size 15m;
location /502test {
@@ -38,16 +38,16 @@ http {
location ~* /(avatars|images)/ {
if (!-f $request_filename) {
- rewrite ^(.*)$ http://dumpfm.s3.amazonaws.com$1;
+ rewrite ^(.*)$ https://archive.hump.fm$1;
break;
}
- root /home/dumpfmprod/prod;
+ root /home/humpfmprod/prod;
expires 30d;
}
location ~* /static/ {
- root /home/dumpfmprod/prod;
+ root /home/humpfmprod/prod;
expires 5m;
}
diff --git a/db/0-create.psql b/db/0-create.psql
index 9a9b771..979eb68 100755
--- a/db/0-create.psql
+++ b/db/0-create.psql
@@ -1,8 +1,8 @@
--- dump.fm schema
+-- hump.fm schema
--
-- Run with:
--- createdb dumpfm
--- psql -d dumpfm -f db/0-create.psql
+-- createdb humpfm
+-- psql -d humpfm -f db/0-create.psql
CREATE TABLE users (
user_id SERIAL PRIMARY KEY,
@@ -106,7 +106,7 @@ CREATE TABLE mutes (
CREATE INDEX mutes_expires_idx ON mutes ((set_on + duration));
INSERT INTO rooms (key, name, description, admin_only)
- VALUES ('dumpfm', 'Room A', 'Hangout', false);
+ VALUES ('humpfm', 'Room A', 'Hangout', false);
INSERT INTO rooms (key, name, description, admin_only)
VALUES ('VIP', 'The VIP Room', 'Command Post', true);
diff --git a/db/0-create.psql-altered b/db/0-create.psql-altered
index 68c9f1e..48dba34 100755
--- a/db/0-create.psql-altered
+++ b/db/0-create.psql-altered
@@ -1,8 +1,8 @@
--- dump.fm schema (altered copy)
+-- hump.fm schema (altered copy)
--
-- Run with:
--- createdb dumpfm
--- psql -d dumpfm -f db/0-create.psql-altered
+-- createdb humpfm
+-- psql -d humpfm -f db/0-create.psql-altered
CREATE TABLE users (
user_id SERIAL PRIMARY KEY,
@@ -106,7 +106,7 @@ CREATE TABLE mutes (
CREATE INDEX mutes_expires_idx ON mutes ((set_on + duration));
INSERT INTO rooms (key, name, description, admin_only)
- VALUES ('dumpfm', 'Room A', 'Hangout', false);
+ VALUES ('humpfm', 'Room A', 'Hangout', false);
INSERT INTO rooms (key, name, description, admin_only)
VALUES ('VIP', 'The VIP Room', 'Command Post', true);
diff --git a/photobooth/fullscreenphotobooth.st b/photobooth/fullscreenphotobooth.st
index 6d3f3c3..a43c532 100755
--- a/photobooth/fullscreenphotobooth.st
+++ b/photobooth/fullscreenphotobooth.st
@@ -1,7 +1,7 @@
<html>
<head>
- <title>dump.fm - fullscreen</title>
+ <title>hump.fm - fullscreen</title>
<script src="/static/js/jquery-1.4.2.min.js?v=20260126"></script>
<script src="$domain$/static/js/pichat.js"></script>
<script src="$domain$/static/js/fullscreenphotobooth.js"></script>
@@ -108,7 +108,7 @@
<div id="big-image">
- waiting 4 new image from dump.fm.............
+ waiting 4 new image from hump.fm.............
<input id="webcam-button-upload" value="Webcam" type="submit">
<input id="webcam-button-snap" value="Send Pic" type="submit" class="invisible blink">
diff --git a/scripts/emailposter.py b/scripts/emailposter.py
index b1dddf2..dbdc82c 100755
--- a/scripts/emailposter.py
+++ b/scripts/emailposter.py
@@ -57,14 +57,14 @@ def is_image(name):
return l.endswith('jpg') or l.endswith('gif') or l.endswith('png') or l.endswith('jpeg')
def upload_image(fname, data):
- resp = post_multipart('dump.fm', '/upload/photo',
- [['room', 'dumpfm']],
+ resp = post_multipart('hump.fm', '/upload/photo',
+ [['room', 'humpfm']],
[['image', fname, data]])
print resp
def fetch_msg():
pop_conn = poplib.POP3_SSL('pop.secureserver.net')
- pop_conn.user('post@dump.fm')
+ pop_conn.user('post@hump.fm')
pop_conn.pass_('UHR4Moghu5a2')
numMessages = len(pop_conn.list()[1])
@@ -102,4 +102,3 @@ while True:
-
diff --git a/scripts/fill.image_altars.py b/scripts/fill.image_altars.py
index 8321ffa..1181214 100755
--- a/scripts/fill.image_altars.py
+++ b/scripts/fill.image_altars.py
@@ -5,7 +5,7 @@ import sys
import postgresql
from urllib.parse import urlparse
-db = postgresql.open("pq://postgres:root@localhost/dumpfm")
+db = postgresql.open("pq://postgres:root@localhost/humpfm")
db.execute("SET CLIENT_ENCODING to 'UNICODE'")
def get_highest_message_id_in_db():
diff --git a/scripts/fill.image_urls.py b/scripts/fill.image_urls.py
index b7e0f2e..d3a10de 100755
--- a/scripts/fill.image_urls.py
+++ b/scripts/fill.image_urls.py
@@ -5,7 +5,7 @@ import sys
import postgresql
from urllib.parse import urlparse
-db = postgresql.open("pq://postgres:root@localhost/dumpfm")
+db = postgresql.open("pq://postgres:root@localhost/humpfm")
db.execute("SET CLIENT_ENCODING to 'UNICODE'")
def get_num_images_in_db():
@@ -58,15 +58,23 @@ def get_urls_from_messages(messages):
return urls
# this does 3 things...
-# convert 'http://dumpfm.s3.amazonaws.com' to '/'
+# convert archive URLs to a shorter local form
# drops 'http://' from urls
-# drops 'dump.fm/images' from urls
+# drops 'hump.fm/images' from urls
# the client is expected to rebuild urls based on this heuristic:
# if the url starts with '/', prepend '/'
# otherwise, prepend 'http://'
def make_url_smaller(url):
- if url[:37] == 'http://dumpfm.s3.amazonaws.com/images':
- url = '/images' + url[37:]
+ prefixes = [
+ 'https://archive.hump.fm/images',
+ 'http://archive.hump.fm/images',
+ 'https://s3.amazonaws.com/archive.hump.fm/images',
+ 'http://s3.amazonaws.com/archive.hump.fm/images',
+ ]
+ for prefix in prefixes:
+ if url[:len(prefix)] == prefix:
+ url = '/images' + url[len(prefix):]
+ break
if url[:21] == '/images':
url = url[21:]
else:
diff --git a/scripts/fix_fav_counts.py b/scripts/fix_fav_counts.py
index 0472488..2d6660a 100755
--- a/scripts/fix_fav_counts.py
+++ b/scripts/fix_fav_counts.py
@@ -28,7 +28,7 @@ import postgresql
import redis
import csv
-db = postgresql.open("pq://postgres:root@localhost/dumpfm")
+db = postgresql.open("pq://postgres:root@localhost/humpfm")
db.execute("SET CLIENT_ENCODING to 'UNICODE'")
r = redis.Redis("192.168.156.111")
@@ -110,4 +110,3 @@ if __name__ == "__main__":
load_faves_by_user()
load_faves_by_date()
print("done!")
-
diff --git a/scripts/hiscores.py b/scripts/hiscores.py
index b81269e..c4328c6 100755
--- a/scripts/hiscores.py
+++ b/scripts/hiscores.py
@@ -5,7 +5,7 @@ import sys
import postgresql
import redis
-db = postgresql.open("pq://postgres:root@localhost/dumpfm")
+db = postgresql.open("pq://postgres:root@localhost/humpfm")
db.execute("SET CLIENT_ENCODING to 'UNICODE'")
r = redis.Redis("localhost")
diff --git a/scripts/idgi/rename.sh b/scripts/idgi/rename.sh
index 18af639..30eca21 100755
--- a/scripts/idgi/rename.sh
+++ b/scripts/idgi/rename.sh
@@ -7,6 +7,6 @@ while read LINE
NEWL=${NEWL/%jpg/removed.jpg}
NEWL=${NEWL/%jpeg/removed.jpeg}
NEWL=${NEWL/%png/removed.png}
- CMDLINE="mv /home/dumpfmprod/prod/$LINE /home/dumpfmprod/prod/$NEWL"
+ CMDLINE="mv /home/humpfmprod/prod/$LINE /home/humpfmprod/prod/$NEWL"
$CMDLINE
done
diff --git a/scripts/logreport.py b/scripts/logreport.py
index 88bceaf..3e6dbaf 100755
--- a/scripts/logreport.py
+++ b/scripts/logreport.py
@@ -18,7 +18,7 @@ Nickset = None
MaxRequestTime = 10
SlowReqThreshold = 1000
WindowInterval = datetime.timedelta(minutes=5)
-ConnStr = "dbname=dumpfm user=postgres password=root"
+ConnStr = "dbname=humpfm user=postgres password=root"
def fetch_nicks():
try:
diff --git a/scripts/s3upload.py b/scripts/s3upload.py
index f39ea19..f3e7cd5 100755
--- a/scripts/s3upload.py
+++ b/scripts/s3upload.py
@@ -6,13 +6,15 @@ import time
import S3
CONN = None
-AWS_ACCESS_KEY_ID = 'AKIAIVBEMR22OOG7OMMQ'
-AWS_SECRET_ACCESS_KEY = '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'
-BUCKET_NAME = 'dumpfm'
+AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
+AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')
+BUCKET_NAME = os.environ.get('HUMPFM_S3_BUCKET', 'humpfm')
def get_or_initialize_aws_connection():
global CONN
if not CONN:
+ if not AWS_ACCESS_KEY_ID or not AWS_SECRET_ACCESS_KEY:
+ raise Exception("Missing AWS credentials (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)")
print "Initializing AWS connection with ID %s, bucket %s" % (AWS_ACCESS_KEY_ID,
BUCKET_NAME)
CONN = S3.AWSAuthConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)