-
Notifications
You must be signed in to change notification settings - Fork 406
Document how to self-host Playground #459
Description
Currently in the documentation, there is a warning under Playground APIs -> Concepts.
Careful with the demo site
The site at https://playground.wordpress.net/ is there to support the community, but there are no guarantees it will continue to work if the traffic grows significantly.
If you need certain availability, you should host your own WordPress Playground copy.
It would be helpful to link to a page that describes how to self-host an instance of the Playground.
The server setup involves a number of details, such as:
- Run
npm run buildand look indist/packagesfolder for built static assets - Server directives
- Apache
.htaccessfiles - NGINX configuration equivalent to .htaccess #55 (comment)
- Apache
- ? Two subdomains with SSL certificates
- Why
- Maybe Load the iframe-worker.html from a separate domain
- And/or, as described in Architecture -> PHP Worker Threads -> Worker thread backends: Iframe (source)
The browser will typically run an iframe in a separate thread in one of the two cases:1. The
iframe-worker.htmlis served with theOrigin-Agent-Cluster: ?1header. If you're running the Apache webserver, this package ships a.htaccessthat will add the header for you.
2. Theiframe-worker.htmlis served from a different origin. For convenience, you could point a second domain name to the same server and directory and use it just for theiframe-worker.html.
playground.wordpress.net- Content of
dist/packages/playground/remote.htaccessremote.html- Static assets of WordPress versions
- Content of
wasm.wordpress.net- Where is this domain referenced in the code?
- See
packages/playground/website/project.json, targetbuild:wasm-wordpress-net- Copy of
blueprint-schema.jsonfromdist/playground/client - Content of
dist/packages/playground/remote - Content of
dist/packages/playground/website - Combined
.htaccessfromremoteandwebsite
- Copy of
- Why
- Plugin proxy - If plugin/theme install is desired
- Can copy and customize
packages/playground/website/public/plugin-proxy.php - Stream from
downloads.wordpress.org - Optional support for GitHub Releases with token from environment variable
- Can copy and customize
- Scoped URL