easynet.run · 全部问题场景

网站都写好了,发出去的却还是 localhost。

你用 AI 做好了一个产品页,在自己的电脑上看起来都正常。想让朋友提点意见,把浏览器地址发过去,对方却打不开。localhost 指向的是访问者自己的电脑,并不是你的作品已经有了一个别人能访问的地址。

接下来真正要交付的不是一张截图,而是能让对方点开、滚动和尝试的页面。为一次展示,你可能并不需要数据库或复杂后台;你需要知道该发布哪些文件、别人如何访问,以及展示结束后怎样撤下。

成熟的静态托管平台通常是很好的选择,尤其当你需要长期在线、自定义域名和稳定资源分发时。EasyNet 的 Pages 更适合已经在使用 EasyNet 设备环境、希望沿用现有入口发布静态作品的情况,不必为了一个网页先换掉熟悉的托管方式。

下面用一个虚构的 North Tea 产品页演示:public-demo 里只有首页、说明页和样式表。Pages 将这个目录接到 Hub 的网页地址,文件仍留在提供设备。当前只支持公开访问,所以不要放客户私密材料,更不要发布整个代码仓库。你自己的项目则先构建,再检查真正要公开的产物目录。

拿到地址以后,还要以访问者的方式检查。换一台设备、一个网络,不依赖开发电脑上的登录,打开首页和深层页面,再看图片、脚本和字体是否齐全。某个发布动作返回成功,不能单独证明你准备分享的那套网络环境已经通了。

也要提前试一次结束。停止发布后链接如何表现,运行设备离线时访问者会看到什么,都应清楚。若重要演示依赖宿主持续在线,就安排稳定的运行环境;不能把自己暂时开着的一台电脑,误认为已经获得全天候托管。

完成这些检查后,你发出去的才是别人可以实际体验的作品。Pages 处理的是静态内容,不会顺便替网页提供数据库或服务端业务。需要那些能力时,应分别选择和接入,而不是直到朋友点下按钮,才发现页面背后还有一半服务只在本机。

  1. 01

    选择公开目录

    只取静态页面和必要资源。

  2. 02

    发布访问地址

    使用实际部署的Pages入口。

  3. 03

    另一端试用

    检查资源、深链接与撤下后的状态。

构建产物变成可访问页面,再由另一端实际打开。

发布前检查目录里的文件名

Python本地预检只筛出常见危险文件名,不证明目录没有秘密;public-demo须是待审静态目录。

本地示例 · python
from pathlib import Path

root = Path('public-demo')
if not root.is_dir():
    raise SystemExit('Missing public-demo directory')
suspect = [p for p in root.rglob('*')
           if p.name.startswith('.env') or p.suffix == '.pem']
if suspect:
    raise SystemExit('Review private configuration before publishing')
print('Filename check passed; review content and links next')

预期结果:发现.env或.pem就停止;通过后仍检查内容与实际访客访问。

把三份已检查的静态文件发布出去

下载下方 index.html、details.html 和 styles.css,放在独立的 public-demo 目录。将 PAGES_DEMO_FOLDER 设为它的绝对路径,PAGES_DEMO_PROJECT 设为未使用的项目名。当前只支持 public:确认这三份文件可以向任何访客公开后再运行。

Runtime 命令 · bash
easynet pages list --json
easynet pages create "${PAGES_DEMO_PROJECT:?Choose an unused project ID}" \
  --folder "${PAGES_DEMO_FOLDER:?Set the absolute reviewed directory path}" \
  --visibility public --json
easynet pages show "$PAGES_DEMO_PROJECT" --json
easynet pages url "$PAGES_DEMO_PROJECT"

预期结果:取得实际 url_root。文件仍在提供设备,不是已上传到独立存储;Runtime、Hub 与网络必须可用。Hub 通过能力目录解析项目入口,设备已配对不等于项目已可访问。用实际返回文件确认访问的是这次发布内容。

不是只看首页能不能打开

将 PAGES_DEMO_URL 设为上一条返回的完整地址。这个例子的样式和子页面使用相对链接,适合 /web/<user>/<project>/ 子路径。先检查返回内容,再让访客打开子页面;不要假设任意 SPA 路由会自动回退首页。

Runtime 命令 · bash
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL:?Set the actual returned URL}"
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL%/}/styles.css"
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL%/}/details.html"

预期结果:三个响应分别包含 EASYPAGES-DEMO-12、EASYPAGES-DEMO-12-CSS、EASYPAGES-DEMO-12-DETAILS 标记。还需用访客环境确认样式和链接;本页提供的是演练文件,不是公网访问成功实录。

把发布和验收交给编程 Agent

附件包含公开前检查、发布命令、访客测试和经确认后的撤回步骤。AGENTS.md 与演练文件保留英文;不会自动发布你的目录或停止共享服务。

阅读完整交接任务
# Publish a reviewed static preview with EasyNet Pages

The user wants someone outside their development environment to open a static
site, follow a link and see its styling. Use the supplied fictional North Tea
demo first. It has no forms, scripts, external services or private information.
Do not publish any directory until the user explicitly approves its contents
and public visibility. Current Pages supports public visibility only; it does
not provide a private client-preview mode.

## Obtain and inspect the exact output

Ask for the case-page URL if the files were not supplied. Resolve
`/examples/static-pages/public-demo/` against that user-provided origin and
obtain index.html, details.html and styles.css. Keep those three files together
in a new approved directory named public-demo. Do not guess an origin or
overwrite existing files. A localhost URL on another computer refers to that
computer, not the author's preview server; arrange an approved file transfer
when needed. Read local repository instructions before taking actions.

Inspect all three files. The homepage contains EASYPAGES-DEMO-12, the second
page EASYPAGES-DEMO-12-DETAILS, and the stylesheet EASYPAGES-DEMO-12-CSS.
These are synthetic test markers, not evidence of publication. Relative links
keep assets under the eventual project URL instead of the Hub domain root.

For the user's real site, use its documented build process and select only
reviewed static output. Do not publish the repository root, .git, .env files,
credentials, private attachments or unreviewed source maps. Checking filenames
alone does not prove content is safe. A static file with a token inside it is
still public data. Confirm fonts, images and JavaScript use the right asset
base; server-rendered routes and a database are not provided by this example.

## Confirm the environment and approve publication

Inspect the installed `easynet pages --help`, Runtime status and the configured
Hub. Do not install, pair, restart services, open firewall ports or alter DNS
without approval. Set PAGES_DEMO_FOLDER to the absolute path of the reviewed
public-demo directory. Set PAGES_DEMO_PROJECT to an unused project ID containing
only letters, digits, underscores or hyphens (at most 64 characters).

Run `easynet pages list --json` to check existing publications. Do not unpublish
an existing project to reuse its name. The owner must approve exposing these
files publicly before the create command:

```bash
easynet pages create "${PAGES_DEMO_PROJECT:?Choose an unused project ID}" \
  --folder "${PAGES_DEMO_FOLDER:?Set the absolute reviewed directory path}" \
  --visibility public --json
easynet pages show "$PAGES_DEMO_PROJECT" --json
easynet pages url "$PAGES_DEMO_PROJECT"
```

Record the actual project ID and returned url_root. The production URL is
path-based: `https://<realm>/web/<user>/<project>/`. Use the returned value,
not a guessed domain or a dev_listener URL. Keep the trailing slash for
relative assets. Publication success proves registration, not that the Hub
is reachable from the intended visitor's network.

Files remain on the provider device; the Hub forwards requests to it. Do not
tell the user that Pages uploaded the files to permanent independent storage.
The backend resolves the project ability through its capability directory.
In a multi-device account, verify that the published project has an available
directory route and that a visitor receives this project's exact files. A
paired device alone is not proof of a resolvable project. If lookup fails,
record the directory/publication error; do not remove other devices, guess a
fallback host or manipulate identities to hide it. Source changes do not prove
that the deployed Hub is running the same version.

## Check the real visitor path

After publication approval, set PAGES_DEMO_URL to the actual returned URL:

```bash
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL:?Set the actual returned URL}"
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL%/}/styles.css"
curl --fail --show-error --max-time 20 "${PAGES_DEMO_URL%/}/details.html"
```

Check the corresponding marker and expected HTML/CSS, not just HTTP 200.
Then open the actual URL from a separate visitor environment without borrowing
the developer's login. Check styling, the details link, direct navigation to
details.html, and the return link. A local browser opening local files is not
this test. Test deeper routes separately for a real single-page application;
do not assume automatic index.html fallback or root-relative asset rewriting.

If the URL cannot be reached, distinguish DNS/TLS, Hub routing, provider
availability, publication and missing file failures. Do not report a fake
public URL or work around failure by publicly exposing an unreviewed dev server.

## End the approved demo

Unpublishing is a separate destructive action to the publication, not a step
to run automatically after creation. Confirm the exact demo project and ask
the user before withdrawing it. Never use another publication as a test:

```bash
easynet pages show "${PAGES_DEMO_PROJECT:?Identify this demo project}" --json
# Only after confirming that this is the approved demo to withdraw:
easynet pages delete "$PAGES_DEMO_PROJECT" --force
```

Check that fresh visitor requests no longer return the demo. Current public
responses carry a 60-second cache lifetime, so previously cached content may
remain visible. Distinguish a cached copy from a fresh origin response. Do not
assume a particular error code across deployments. Unpublishing does not delete the
source files or retract copies already downloaded. Test provider-offline
behavior only with explicit approval, without stopping shared services.

Report separately: files reviewed, publication registered, public HTML fetched,
CSS fetched, direct details page opened, visitor check, withdrawal check, and
offline check. Mark unrun checks as unrun. No website unit test or printed URL
establishes that the user's public deployment works.
接入时的检查项
  • 不登录开发电脑的访问者能打开页面及静态资源。
  • 发布目录之外的文件不能被读取。
  • 撤回发布和宿主离线时表现明确且不泄露目录信息。
源码与接入资料