diff --git a/pocwww/generate_cert.sh b/pocwww/generate_cert.sh new file mode 100644 index 0000000..88f285f --- /dev/null +++ b/pocwww/generate_cert.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir -p /root/ssl +FQDN=$(hostname -f) +openssl req -newkey rsa:2048 -nodes -keyout poc.key -x509 -days 365 -out poc.crt -subj "/C=US/ST=Texas/L=Dallas/O=Henry Pump/CN=$FQDN" +mv poc.key /root/ssl/ +mv poc.crt /root/ssl/ diff --git a/pocwww/pocwww/__init__.py b/pocwww/pocwww/__init__.py index fd2a0dd..d696977 100644 --- a/pocwww/pocwww/__init__.py +++ b/pocwww/pocwww/__init__.py @@ -124,6 +124,7 @@ def main(global_config, **settings): config.add_route('home', '/') config.add_route('json_snapshot', '/json') + config.add_route('cards_page', '/cards/{cards_date}/{page_num}') config.add_route('json_cards_page', '/json/cards/{cards_date}/{page_num}') config.add_route('cards_date', '/cards/{cards_date}') config.add_route('json_cards_date', '/json/cards/{cards_date}') diff --git a/pocwww/pocwww/views.py b/pocwww/pocwww/views.py index 21396d8..9c3163e 100644 --- a/pocwww/pocwww/views.py +++ b/pocwww/pocwww/views.py @@ -18,6 +18,7 @@ def cards(request): return {'datelist': get_all_dates_with_cards(request), 'navgroup': 'cards'} +@view_config(route_name='cards_page', renderer='templates/cardlist.jinja2') @view_config(route_name='cards_date', renderer='templates/cardlist.jinja2') @view_config(route_name='json_cards_date', renderer='prettyjson') @view_config(route_name='json_cards_page', renderer='prettyjson') diff --git a/pocwww/production.ini b/pocwww/production.ini index ee0a476..5b98c2f 100644 --- a/pocwww/production.ini +++ b/pocwww/production.ini @@ -3,14 +3,24 @@ # http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### -[app:main] -use = egg:pocwww - +[app:pocwww] +use = egg:pocwww#main pyramid.reload_templates = false pyramid.debug_authorization = false pyramid.debug_notfound = false pyramid.debug_routematch = false pyramid.default_locale_name = en +mongo_uri = mongodb://localhost:27017/poc + + +#---------- Pipeline Configuration ---------- +[filter:paste_prefix] +use = egg:PasteDeploy#prefix + +[pipeline:main] +pipeline = + paste_prefix + pocwww ### # wsgi server configuration @@ -18,7 +28,10 @@ pyramid.default_locale_name = en [server:main] use = egg:waitress#main -listen = *:6543 +host = 127.0.0.1 +port = %(http_port)s + + ### # logging configuration