Skip to content

Commit

Permalink
Minor update and README update
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed Mar 19, 2024
1 parent 087f868 commit 811a81a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ A fully operational development environment is provided by [Docker](https://docs

A publicly accessible URL is required if your plugin receives third-party webhooks or responds to events from
ShipStream via ShipStream's webhooks. For development environments this can be obtained easily and for free with
[localhost.run](https://localhost.run).
[ngrok](https://ngrok.com) or [localhost.run](https://localhost.run).

### Windows

Expand Down Expand Up @@ -158,8 +158,15 @@ You can use a `.env` file in the root of the project to set some configuration o
### HTTPS Tunnel

If you need to support callbacks and webhooks from systems not in your local development environment you need your
url to be publicly accessible. One easy and free way to accomplish this is to use [localhost.run](https://localhost.run)
which is a simple tunneling service that only requires the common `ssh` command.
url to be publicly accessible. One easy and free way to accomplish this is to use [ngrok](https://ngrok.com) or [localhost.run](https://localhost.run)
which are simple tunneling services. The ngrok service uses it's own command line interface and is more robust, while
localhost.run only requires the common `ssh` command.

```
$ ngrok http 80
```

Or:

```
$ ssh -R 80:localhost:80 localhost.run
Expand All @@ -168,14 +175,21 @@ $ ssh -R 80:localhost:80 localhost.run
If you changed the `HOST_PORT` in
your `.env` file you will need to specify the correct port in the ssh command:

```
$ source .env
$ ngrok http $HTTP_PORT
```

Or:

```
$ source .env
$ ssh -R 80:localhost:${HOST_PORT} localhost.run
```

Upon a successful connection, you will be given a unique domain name like `user-938444e1.localhost.run`. On the free plan this will
only last a few hours before it needs to be refreshed with a new domain name. Use this url in the `app/etc/local.xml`
config file for the `default/middleware/system/base_url` value:
Upon a successful connection, you will be given a unique domain name like `user-938444e1.localhost.run`. On the free
plans this will only last a few hours before it needs to be refreshed with a new domain name. Use this url in the
`app/etc/local.xml` config file for the `default/middleware/system/base_url` value:

```xml
<?xml version="1.0"?>
Expand All @@ -192,7 +206,8 @@ config file for the `default/middleware/system/base_url` value:
</config>
```

Another honorable mention for an HTTPS via SSH tunneling service is [ngrok](https://ngrok.com/).
***NOTE:***
If you update your `base_url`, you may need to also re-register that url for any plugins that make use of callbacks.

Developer Guide
===============
Expand Down
2 changes: 1 addition & 1 deletion lib/Plugin/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ final public function call($method, $args = array())
* @param int|string|array|stdClass|null $value
* @param int|string|null $ifEquals - if specified, the value is only updated if the value was previously equal to $ifEquals value
* @return mixed
* @throws Exception
* @throws Plugin_Exception
*/
final public function setState($data, $value = NULL, $ifEquals = NULL)
{
Expand Down

0 comments on commit 811a81a

Please sign in to comment.