parent
734cd69206
commit
44c659046b
@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "How to Deploy Lichess's Lila With Nginx"
|
||||
layout: post
|
||||
---
|
||||
|
||||
I was getting ready to have a public test of some changes I made to [lichess.org](https://lichess.org)'s [open source chess platform](https://lichess.org/source).
|
||||
In preperation, I got my Let's Encrypt certificates and nginx configurations setup...
|
||||
and it wouldn't work.
|
||||
Here are some tips for myself and future Lichess developers.
|
||||
|
||||
## Reasoning
|
||||
|
||||
My pull request involves accessibility.
|
||||
It will extend Lichess's NVUI (Non-Visual User Interface) to be more accessible to beginner level chess players.
|
||||
At the time of writing this, Lichess's NVUI only supports searching pieces by type, rank and file.
|
||||
It does not support any kind of interactive board.
|
||||
|
||||
I wanted to play chess with a friend of mine who uses a screen reader.
|
||||
Even though Lichess does indeed have a separate rendering of the page for visually impaired users,
|
||||
I have heard from a few people that it is not the best.
|
||||
|
||||
I don't use a screen reader myself, so I thought having a public latest changes deployed server would work better for testing.
|
||||
It would certainly work better than getting some of my less computer literate friends to connect to me via VSCode/VPN and view my local repository.
|
||||
|
||||
So here is how to deploy it:
|
||||
|
||||
## Setup a development environment
|
||||
|
||||
This is described [in Lichess's documentation itself](https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding).
|
||||
I will not elaborate further as it is not necessary.
|
||||
|
||||
## Setup nginx
|
||||
|
||||
This is the part that stumps most people.
|
||||
Getting a local development server usually works alright, but once you want to reverse proxy it for security and professionalism purposes, it get more interesting.
|
||||
|
||||
### lila
|
||||
|
||||
[Lila](https://github.com/ornicar/lila/) is the name for the main chess server, we need to change a few settings. Here is my git diff for the `conf/base.conf` file:
|
||||
|
||||
<pre class="file">
|
||||
- domain = "localhost:9663"
|
||||
- socket.domains = [ "localhost:9664" ]
|
||||
+ domain = "chess.tait.tech"
|
||||
+ socket.domains = [ "ws.chess.tait.tech" ]
|
||||
asset.domain = ${net.domain}
|
||||
- asset.base_url = "http://"${net.asset.domain}
|
||||
+ asset.base_url = "https://"${net.asset.domain}
|
||||
asset.minified = false
|
||||
- base_url = "http://"${net.domain}
|
||||
+ base_url = "https://"${net.domain}
|
||||
</pre>
|
||||
|
||||
### lila-ws
|
||||
|
||||
[Lila-ws](https://github.com/ornicar/lila-ws/) is the websocket component of Lila.
|
||||
|
||||
The most common complaint amongst aspiring Lichess developers is websockets not working.
|
||||
They constantly get these '101' responses from the websocket,
|
||||
and it also seems that the websocket returns instead of staying in the 'pending' state as it should be.
|
||||
|
||||
Here is how to fix that (in diff format):
|
||||
|
||||
<pre class="file">
|
||||
-csrf.origin = "http://127.0.0.1:9000"
|
||||
+csrf.origin = "https://chess.tait.tech"
|
||||
</pre>
|
||||
|
||||
You need to tell lila-ws where the websocket requests will be coming from. This is how to do that.
|
||||
|
||||
## Conclusion
|
||||
|
||||
This is not a long article, but just some notes for future me and Lila developers.
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>/2020/01/22/padding-and-margin/</loc> <lastmod>2020-01-22T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/01/26/rsa1/</loc> <lastmod>2020-01-26T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/02/19/rsa2/</loc> <lastmod>2020-02-19T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/04/02/rsa3/</loc> <lastmod>2020-04-02T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/06/rsa4/</loc> <lastmod>2020-04-06T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/12/nas1/</loc> <lastmod>2020-04-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/21/rfi/</loc> <lastmod>2020-04-21T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/25/xss/</loc> <lastmod>2020-04-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/01/nginx-socket-io-projects/</loc> <lastmod>2020-05-01T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/19/clue-announcement/</loc> <lastmod>2020-05-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/04/site-update/</loc> <lastmod>2020-06-04T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/25/tmux-minecraft/</loc> <lastmod>2020-06-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/12/independence/</loc> <lastmod>2020-07-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/19/multicraft-php-gentoo/</loc> <lastmod>2020-07-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/30/canadian-parliament/</loc> <lastmod>2020-07-30T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/15/openbsd1/</loc> <lastmod>2020-08-15T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/18/django-deployment/</loc> <lastmod>2020-08-18T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/09/lamegames/</loc> <lastmod>2020-09-09T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/12/minesweeper/</loc> <lastmod>2020-09-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/10/26/curiosity/</loc> <lastmod>2020-10-26T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/11/15/nas2/</loc> <lastmod>2020-11-15T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/01/pacaur-rpi/</loc> <lastmod>2020-12-01T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/14/orca-raspberry-pi-manjaro/</loc> <lastmod>2020-12-14T00:00:00-07:00</lastmod> </url> <url> <loc>/2020-04-27-quiz-your-friends-xss/</loc> </url> <url> <loc>/blog/</loc> </url> <url> <loc>/tests/live-label/</loc> </url> <url> <loc>/tests/chess/</loc> </url> <url> <loc>/</loc> </url> <url> <loc>/tutoring/</loc> </url> <url> <loc>/cover-letters/bloombase/</loc> </url> <url> <loc>/resume/</loc> </url> <url> <loc>/links/</loc> </url> <url> <loc>/cover-letter-vcc/</loc> </url> <url> <loc>/contact/</loc> </url> <url> <loc>/about/</loc> </url> <url> <loc>/scholarships/2020/cnib/</loc> </url> <url> <loc>/test/</loc> </url> <url> <loc>/test2/</loc> </url> </urlset>
|
||||
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>/2020/01/22/padding-and-margin/</loc> <lastmod>2020-01-22T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/01/26/rsa1/</loc> <lastmod>2020-01-26T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/02/19/rsa2/</loc> <lastmod>2020-02-19T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/04/02/rsa3/</loc> <lastmod>2020-04-02T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/06/rsa4/</loc> <lastmod>2020-04-06T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/12/nas1/</loc> <lastmod>2020-04-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/21/rfi/</loc> <lastmod>2020-04-21T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/04/25/xss/</loc> <lastmod>2020-04-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/01/nginx-socket-io-projects/</loc> <lastmod>2020-05-01T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/05/19/clue-announcement/</loc> <lastmod>2020-05-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/04/site-update/</loc> <lastmod>2020-06-04T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/06/25/tmux-minecraft/</loc> <lastmod>2020-06-25T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/12/independence/</loc> <lastmod>2020-07-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/19/multicraft-php-gentoo/</loc> <lastmod>2020-07-19T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/07/30/canadian-parliament/</loc> <lastmod>2020-07-30T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/15/openbsd1/</loc> <lastmod>2020-08-15T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/08/18/django-deployment/</loc> <lastmod>2020-08-18T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/09/lamegames/</loc> <lastmod>2020-09-09T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/09/12/minesweeper/</loc> <lastmod>2020-09-12T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/10/26/curiosity/</loc> <lastmod>2020-10-26T00:00:00-06:00</lastmod> </url> <url> <loc>/2020/11/15/nas2/</loc> <lastmod>2020-11-15T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/01/pacaur-rpi/</loc> <lastmod>2020-12-01T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/14/orca-raspberry-pi-manjaro/</loc> <lastmod>2020-12-14T00:00:00-07:00</lastmod> </url> <url> <loc>/2020/12/20/deploy-lichess/</loc> <lastmod>2020-12-20T00:00:00-07:00</lastmod> </url> <url> <loc>/2020-04-27-quiz-your-friends-xss/</loc> </url> <url> <loc>/blog/</loc> </url> <url> <loc>/tests/live-label/</loc> </url> <url> <loc>/tests/chess/</loc> </url> <url> <loc>/</loc> </url> <url> <loc>/tutoring/</loc> </url> <url> <loc>/cover-letters/bloombase/</loc> </url> <url> <loc>/resume/</loc> </url> <url> <loc>/links/</loc> </url> <url> <loc>/cover-letter-vcc/</loc> </url> <url> <loc>/contact/</loc> </url> <url> <loc>/about/</loc> </url> <url> <loc>/scholarships/2020/cnib/</loc> </url> <url> <loc>/test/</loc> </url> <url> <loc>/test2/</loc> </url> </urlset>
|
Loading…
Reference in new issue