Skip to content

Commit

Permalink
Remove the /plugin-proxy -> /plugin-proxy.php rewrite (#712)
Browse files Browse the repository at this point in the history
Since Plugin proxy is no longer needed for Playground core (See #711),
let's remove the related .htaccess rewrite.
  • Loading branch information
adamziel authored Oct 19, 2023
1 parent 9e30d52 commit 79b3128
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ You can deploy the content of the folder to your server using SSH, such as `scp`

It is a static site, except for these dynamic aspects.

- Apache server directive `.htaccess` file - the result of combining `.htaccess` from the packages `remote` and `website`
- Plugin download proxy, `plugin-proxy.php`
- Apache server directive `.htaccess` file from the package `remote`

For these to work, you need a server environment with Apache and PHP installed.

Expand All @@ -99,7 +98,6 @@ As an alternative to Apache, here is an example of using NGINX to serve the Play
This example may go out of date. It is recommended to refer to the source files.

- [packages/playground/remote/public/.htaccess](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/playground/remote/public/.htaccess)
- [packages/playground/website/public/.htaccess](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/playground/website/public/.htaccess)

:::

Expand All @@ -108,9 +106,6 @@ The combined Apache `.htaccess` file looks like this.
```htaccess
AddType application/wasm .wasm
AddType application/octet-stream .data
RewriteEngine on
RewriteRule ^plugin-proxy$ plugin-proxy.php [NC]
```

An equivalent in NGINX.
Expand All @@ -128,12 +123,6 @@ location ~* .data$ {
}
}
location /plugin-proxy {
try_files plugin-proxy.php /plugin-proxy.php$is_args$args;
include fastcgi_params;
fastcgi_pass php;
}
location /scope:.* {
rewrite ^scope:.*?/(.*)$ $1 last;
}
Expand Down
1 change: 1 addition & 0 deletions packages/php-wasm/web/public/.htaccess
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
AddType application/wasm .wasm
AddType application/octet-stream .data
2 changes: 1 addition & 1 deletion packages/playground/website/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"cp -r ./blueprints/blueprint-schema.json ./wasm-wordpress-net/",
"cp -r ./remote/* ./wasm-wordpress-net/",
"cp -r ./website/* ./wasm-wordpress-net/",
"cat ./remote/.htaccess ./website/.htaccess > ./wasm-wordpress-net/.htaccess"
"cat ./remote/.htaccess > ./wasm-wordpress-net/.htaccess"
],
"cwd": "dist/packages/playground",
"parallel": false
Expand Down
2 changes: 0 additions & 2 deletions packages/playground/website/public/.htaccess

This file was deleted.

2 changes: 1 addition & 1 deletion packages/playground/website/public/gutenberg.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}

// Verify that the PR exists and that GitHub CI finished building it
const zipArtifactUrl = `/plugin-proxy?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&pr=${prNumber}`;
const zipArtifactUrl = `/plugin-proxy.php?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&pr=${prNumber}`;
// Send the HEAD request to zipArtifactUrl to confirm the PR and the artifact both exist
const response = await fetch(zipArtifactUrl, { method: 'HEAD' });
if (response.status !== 200) {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/website/public/wordpress.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}

// Verify that the PR exists and that GitHub CI finished building it
const zipArtifactUrl = `/plugin-proxy?org=WordPress&repo=wordpress-develop&workflow=Build%20WordPress&artifact=wordpress-build-${prNumber}&pr=${prNumber}`;
const zipArtifactUrl = `/plugin-proxy.php?org=WordPress&repo=wordpress-develop&workflow=Build%20WordPress&artifact=wordpress-build-${prNumber}&pr=${prNumber}`;
// Send the HEAD request to zipArtifactUrl to confirm the PR and the artifact both exist
const response = await fetch(zipArtifactUrl, { method: 'HEAD' });
if (response.status !== 200) {
Expand Down

0 comments on commit 79b3128

Please sign in to comment.