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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WebHarbor — slim, self-contained image.
# 15 Flask mirror sites + control plane on :8101.
# 16 Flask mirror sites + control plane on :8101.

FROM python:3.12-slim-bookworm

Expand Down 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"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ WebHarbor takes a different approach. We leverage coding agent (e.g., Claude Cod
- **Deep features unlocked** — carts, checkouts, accounts, all fully testable
- **Evolving** — harder tasks drive richer mirrors; the environment grows with agents
- **RL-ready** — sub-second database resets between rollouts
- **Community-driven** — 15 sites today, scaling to 100+ together
- **Community-driven** — 16 sites today, scaling to 100+ together

## 🚀 Quickstart

One command to run all web environments:

```bash
docker run -p 8101:8101 -p 40000-40014:40000-40014 battalion7244/webharbor:latest
docker run -p 8101:8101 -p 40000-40015:40000-40015 battalion7244/webharbor:latest
```

Then point your agent at `http://localhost:40000` through `http://localhost:40014` to explore 15 local mirrors of webvoyager sites: `Allrecipes, Amazon, Apple, ArXiv, BBC News, Booking, GitHub, Google Flights, Google Maps, Google Search, Hugging Face, Wolfram Alpha, Cambridge Dictionary, Coursera, and ESPN`.
Then point your agent at `http://localhost:40000` through `http://localhost:40015` to explore 16 local mirrors of webvoyager sites plus community additions: `Allrecipes, Amazon, Apple, ArXiv, BBC News, Booking, GitHub, Google Flights, Google Maps, Google Search, Hugging Face, Wolfram Alpha, Cambridge Dictionary, Coursera, ESPN, and Cookpad`.

For sub-second reset between rollouts, expose the control plane and call `/reset/<site>`:

Expand Down Expand Up @@ -111,4 +111,4 @@ WebHarbor is initiated by UNC-Chapel Hill and Microsoft, with contributions from
url = {https://aiming-lab.github.io/webharbor.github.io},
note = {Project website.}
}
```
```
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', 'cookpad',
]
BASE_PORT = 40000
WEBSYN_DIR = '/opt/WebSyn'
Expand Down
69 changes: 69 additions & 0 deletions sites/cookpad/_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""cookpad mirror health check."""
from healthcheck import random_user


def run(p):
# Public pages
p.assert_get('home', '/', must_contain='Cookpad')
p.assert_get('search chicken', '/search?q=chicken', must_contain='chicken')
p.assert_get(
'recipe detail',
'/recipe/butter-chicken',
must_contain='Ingredients',
)

# Register
user = random_user()
html = p.assert_get('register page', '/register', must_contain='csrf_token')
token = p.csrf(html)
if not token:
p.check('register csrf', False, 'no csrf token found')
return
p.check('register csrf', True)
p.assert_post(
'register submit',
'/register',
{
'csrf_token': token,
'username': user['username'],
'email': user['email'],
'password': user['password'],
'confirm_password': user['password'],
},
accept_status=(200, 302, 303),
)

# Logout so /login renders a real form (register auto-logs-in).
p.get('/logout')

# Login (fresh cookie jar path 鈥?registration auto-logs-in, but exercise
# login form explicitly for smoke coverage).
html = p.assert_get('login page', '/login', must_contain='csrf_token')
token = p.csrf(html)
if not token:
p.check('login csrf', False, 'no csrf token found')
return
p.check('login csrf', True)
p.assert_post(
'login submit',
'/login',
{
'csrf_token': token,
'email': user['email'],
'password': user['password'],
},
accept_status=(200, 302, 303),
)

# Authenticated read 鈥?/recipe-box requires login.
p.assert_get(
'recipe box (auth)',
'/recipe-box',
accept_status=(200, 302),
)
p.assert_get(
'account (auth)',
'/account',
accept_status=(200, 302),
)

Loading