Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ COPY control_server.py /opt/control_server.py
COPY site_runner.py /opt/site_runner.py
RUN chmod +x /opt/websyn_start.sh

EXPOSE 8101 40000-40014
EXPOSE 8101 40000-40015

CMD ["/opt/websyn_start.sh"]
2 changes: 1 addition & 1 deletion control_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'allrecipes', 'amazon', 'apple', 'arxiv', 'bbc_news', 'booking',
'github', 'google_flights', 'google_map', 'google_search',
'huggingface', 'wolfram_alpha', 'cambridge_dictionary',
'coursera', 'espn',
'coursera', 'espn', 'compass',
]
BASE_PORT = 40000
WEBSYN_DIR = '/opt/WebSyn'
Expand Down
36 changes: 36 additions & 0 deletions sites/compass/_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""compass mirror health check."""
from healthcheck import random_user


def run(p):
p.assert_get('home', '/', must_contain='Compass')
p.assert_get('search New York', '/search?q=New York', must_contain='New York')
p.assert_get('city for-sale', '/homes-for-sale/new-york-ny/',
must_contain='Homes')
p.assert_get('agents directory', '/agents', must_contain='Agent')
p.assert_get('open houses', '/open-houses', must_contain='Open')

user = random_user()
html = p.assert_get('register page', '/register')
token = p.csrf(html)
if not token:
p.check('register csrf', False, 'no csrf'); return
p.assert_post('register submit', '/register', {
'csrf_token': token,
'name': f"{user['first_name']} {user['last_name']}",
'email': user['email'],
'password': user['password'],
'confirm': user['password'],
}, accept_status=(200, 302, 303))

p.get('/logout')
html = p.assert_get('login page', '/login')
token = p.csrf(html)
if not token:
p.check('login csrf', False, 'no csrf'); return
p.assert_post('login submit', '/login', {
'csrf_token': token,
'email': user['email'],
'password': user['password'],
}, accept_status=(200, 302, 303))
p.assert_get('account', '/account', accept_status=(200, 302))
Loading