From 907c5212e42a9ad45e79e47d667a288e7c849dc8 Mon Sep 17 00:00:00 2001 From: programarivm Date: Thu, 25 Jan 2024 10:39:08 +0100 Subject: [PATCH 1/2] Renamed async.chesslablab.net as async.chesslablab.org --- .env.example | 2 +- README.md | 2 +- docs/getting-started.md | 4 ++-- docs/installation.md | 2 +- docs/online-games.md | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 35d31329..8313c033 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -JWT_ISS=async.chesslablab.net +JWT_ISS=async.chesslablab.org JWT_SECRET=password UID=1000 diff --git a/README.md b/README.md index 2fc1913e..866d1734 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Asynchronous PHP chess server. Open a console in your favorite browser and run the following commands: ``` -const ws = new WebSocket('wss://async.chesslablab.net:8443'); +const ws = new WebSocket('wss://async.chesslablab.org:8443'); ws.send('/start classical fen'); ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index 24154c6f..ba238544 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -11,7 +11,7 @@ Probably the easiest way to get familiar with the chess commands is by reading t Also a WebSocket connection with the chess server can be opened in the JavaScript console. ```js -const ws = new WebSocket('wss://async.chesslablab.net:8443'); +const ws = new WebSocket('wss://async.chesslablab.org:8443'); ``` That's it! @@ -101,7 +101,7 @@ Let's recap. Described below is the series of steps required to start a classical chess game with 1.e4 e5. Remember, computers and graphic user interfaces (GUIs) usually prefer the Long Algebraic Notation (LAN) format instead: e2e4 and e7e5. ```js -const ws = new WebSocket('wss://async.chesslablab.net:8443'); +const ws = new WebSocket('wss://async.chesslablab.org:8443'); ws.send('/start classical fen'); ws.send('/play_lan w e2e4'); ws.send('/play_lan b e7e5'); diff --git a/docs/installation.md b/docs/installation.md index 71463da4..e5046593 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -27,7 +27,7 @@ cp .env.example .env Finally, you may want to add the following entry to your `/etc/hosts` file if running the PHP chess server on your localhost along with [React Chess](https://github.com/chesslablab/react-chess) as per the `REACT_APP_WS_HOST` variable defined in the [react-chess/.env.example](https://github.com/chesslablab/react-chess/blob/master/.env.example) file. ``` -127.0.0.1 async.chesslablab.net +127.0.0.1 async.chesslablab.org ``` ## Run the Chess Server diff --git a/docs/online-games.md b/docs/online-games.md index f7f2cc68..ccc6f084 100644 --- a/docs/online-games.md +++ b/docs/online-games.md @@ -14,7 +14,7 @@ ws.send('/online_games'); { "/online_games": [ { - "iss": "async.chesslablab.net", + "iss": "async.chesslablab.org", "iat": 1704983331, "exp": 1704986931, "variant": "classical", @@ -26,7 +26,7 @@ ws.send('/online_games'); "hash": "84a4e20138e54e1869b9b79e7d3111f1" }, { - "iss": "async.chesslablab.net", + "iss": "async.chesslablab.org", "iat": 1704983347, "exp": 1704986947, "variant": "960", @@ -39,7 +39,7 @@ ws.send('/online_games'); "hash": "c6b79ac68055766c2a33364f69c72e4c" }, { - "iss": "async.chesslablab.net", + "iss": "async.chesslablab.org", "iat": 1704983367, "exp": 1704986967, "variant": "capablanca", From 6e0a8a6f9e0b65cc99444f15a23b3de5faba6f2a Mon Sep 17 00:00:00 2001 From: programarivm Date: Thu, 25 Jan 2024 10:41:27 +0100 Subject: [PATCH 2/2] Certbot certificates --- cli/prod.php | 4 ++-- cli/staging.php | 4 ++-- docs/installation.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/prod.php b/cli/prod.php index f4889f29..812bca4c 100644 --- a/cli/prod.php +++ b/cli/prod.php @@ -27,8 +27,8 @@ $server = new Server("0.0.0.0:{$_ENV['WSS_PORT']}", $loop); $secureServer = new SecureServer($server, $loop, [ - 'local_cert' => __DIR__ . '/../ssl/certificate.crt', - 'local_pk' => __DIR__ . '/../ssl/private.key', + 'local_cert' => __DIR__ . '/../ssl/fullchain.pem', + 'local_pk' => __DIR__ . '/../ssl/privkey.pem', 'verify_peer' => false, ]); diff --git a/cli/staging.php b/cli/staging.php index 54363417..adea3a64 100644 --- a/cli/staging.php +++ b/cli/staging.php @@ -22,8 +22,8 @@ $server = new Server("0.0.0.0:{$_ENV['WSS_PORT']}", $loop); $secureServer = new SecureServer($server, $loop, [ - 'local_cert' => __DIR__ . '/../ssl/certificate.crt', - 'local_pk' => __DIR__ . '/../ssl/private.key', + 'local_cert' => __DIR__ . '/../ssl/fullchain.pem', + 'local_pk' => __DIR__ . '/../ssl/privkey.pem', 'verify_peer' => false, ]); diff --git a/docs/installation.md b/docs/installation.md index e5046593..c40bc3b0 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -60,7 +60,7 @@ php cli/dev.php ### Staging -> Before starting the secure WebSocket server for the first time, make sure to have created the `certificate.crt` and `private.key` files into the `ssl` folder. +> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. Run the staging secure WebSocket server if you don't want to check the website's origin. @@ -72,7 +72,7 @@ This will allow any origin to send a request to it. ### Production -> Before starting the secure WebSocket server for the first time, make sure to have created the `certificate.crt` and `private.key` files into the `ssl` folder. +> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. Run the secure WebSocket server to check the website's origin as defined in the `WSS_ALLOWED` variable in the `.env.example` file.