Skip to content

Document how to self-host Playground #459

@eliot-akira

Description

@eliot-akira

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 build and look in dist/packages folder for built static assets
  • Server directives
  • ? 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.html is served with the Origin-Agent-Cluster: ?1 header. If you're running the Apache webserver, this package ships a .htaccess that will add the header for you.

        2. The iframe-worker.html is 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 the iframe-worker.html.

    • playground.wordpress.net
      • Content of dist/packages/playground/remote
        • .htaccess
        • remote.html
        • Static assets of WordPress versions
    • wasm.wordpress.net
      • Where is this domain referenced in the code?
      • See packages/playground/website/project.json, target build:wasm-wordpress-net
        • Copy of blueprint-schema.json from dist/playground/client
        • Content of dist/packages/playground/remote
        • Content of dist/packages/playground/website
        • Combined .htaccess from remote and website
  • 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
  • Scoped URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions