Add new Lila article; fix pi article with installing dummy driver

master
Tait Hoyem 3 years ago
parent 734cd69206
commit 44c659046b

@ -140,6 +140,46 @@ Interesting though for such a young browser to have a minimal level of accessibi
I would be interested where this goes in the future.
## P.S.
Somehow I forgot that you would need to setup the dummy display driver to work with the graphics without a display attached.
To do this, install the `xf86-video-dummy` pacakge:
<pre class="terminal">
# pacman -S xf86-video-dummy
</pre>
Next, override any `/etc/X11/xorg.conf` you may have with this:
<pre class="file">
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection
</pre>
Now, when you boot, you should head 'Screen reader on'.
## Conclusion
It took a bit of messing around to get this working, but I'm glad I did!

@ -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.

@ -9,4 +9,32 @@ export ENABLE_ACCESSIBILITY=1
</pre> <p>Next, add two flags to the <code class="language-plaintext highlighter-rouge">$HOME/.config/chromium-flags.conf</code> file.</p> <pre class="file">
--force-renderer-accessibility
--enable-caret-browsing
</pre> <p>You will need to relog to set the ENABLE_ACCESSIBILITY environment variable. Now Chromium should work with Orca.</p> <h3 id="badwolf">Badwolf</h3> <p>The <a href="https://www.mankier.com/1/badwolf">Badwolf browser</a> is based on the WebkitGTK engine, as opposed to Firefoxs Gecko and Googles Blink engines. It <em>almost</em> works out of the box. It is really fast compared to the other two, but it lacks some features like announcing a page is done loading and it doesnt appear to support caret browsing, which will cause some other problems. Interesting though for such a young browser to have a minimal level of accessibility so early!</p> <p>I would be interested where this goes in the future.</p> <h2 id="conclusion">Conclusion</h2> <p>It took a bit of messing around to get this working, but Im glad I did! Now I can nerd out with another Linux friend and given how well they seem to find problems with accessibility, hopefully a few upstream patches can be made.</p> <p>Happy hacking, for everyone!</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/12/14/orca-raspberry-pi-manjaro/">beta.tait.tech</a>. </footer> </div> </body> </html>
</pre> <p>You will need to relog to set the ENABLE_ACCESSIBILITY environment variable. Now Chromium should work with Orca.</p> <h3 id="badwolf">Badwolf</h3> <p>The <a href="https://www.mankier.com/1/badwolf">Badwolf browser</a> is based on the WebkitGTK engine, as opposed to Firefoxs Gecko and Googles Blink engines. It <em>almost</em> works out of the box. It is really fast compared to the other two, but it lacks some features like announcing a page is done loading and it doesnt appear to support caret browsing, which will cause some other problems. Interesting though for such a young browser to have a minimal level of accessibility so early!</p> <p>I would be interested where this goes in the future.</p> <h2 id="ps">P.S.</h2> <p>Somehow I forgot that you would need to setup the dummy display driver to work with the graphics without a display attached. To do this, install the <code class="language-plaintext highlighter-rouge">xf86-video-dummy</code> pacakge:</p> <pre class="terminal">
# pacman -S xf86-video-dummy
</pre> <p>Next, override any <code class="language-plaintext highlighter-rouge">/etc/X11/xorg.conf</code> you may have with this:</p> <pre class="file">
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection
</pre> <p>Now, when you boot, you should head Screen reader on.</p> <h2 id="conclusion">Conclusion</h2> <p>It took a bit of messing around to get this working, but Im glad I did! Now I can nerd out with another Linux friend and given how well they seem to find problems with accessibility, hopefully a few upstream patches can be made.</p> <p>Happy hacking, for everyone!</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/12/14/orca-raspberry-pi-manjaro/">beta.tait.tech</a>. </footer> </div> </body> </html>

@ -0,0 +1,15 @@
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>How to Deploy Lichess's Lila With Nginx | tait.tech</title> <link rel="stylesheet" href="/assets/css/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Tait Hoyem"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <div id="wrapper"> <header> <nav> <input type="checkbox" id="menu"> <label for="menu">&#9776;</label> <div class="menu-content"> <a href="/" class="nav-link">Home</a> <a href="/blog/" class="nav-link">Blog</a> <a href="https://github.com/TTWNO/" class="nav-link" target="_blank" rel="noopener noreferrer">Github</a> </div> </nav> </header> <main> <article> <header> <h1 class="post-title">How to Deploy Lichess's Lila With Nginx</h1> <time datetime="20-12-20" class="post-date">Sunday, December 20 2020</time> </header> <hr> <p>I was getting ready to have a public test of some changes I made to <a href="https://lichess.org">lichess.org</a>s <a href="https://lichess.org/source">open source chess platform</a>. In preperation, I got my Lets Encrypt certificates and nginx configurations setup… and it wouldnt work. Here are some tips for myself and future Lichess developers.</p> <h2 id="reasoning">Reasoning</h2> <p>My pull request involves accessibility. It will extend Lichesss NVUI (Non-Visual User Interface) to be more accessible to beginner level chess players. At the time of writing this, Lichesss NVUI only supports searching pieces by type, rank and file. It does not support any kind of interactive board.</p> <p>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.</p> <p>I dont 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.</p> <p>So here is how to deploy it:</p> <h2 id="setup-a-development-environment">Setup a development environment</h2> <p>This is described <a href="https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding">in Lichesss documentation itself</a>. I will not elaborate further as it is not necessary.</p> <h2 id="setup-nginx">Setup nginx</h2> <p>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.</p> <h3 id="lila">lila</h3> <p><a href="https://github.com/ornicar/lila/">Lila</a> is the name for the main chess server, we need to change a few settings. Here is my git diff for the <code class="language-plaintext highlighter-rouge">conf/base.conf</code> file:</p> <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> <h3 id="lila-ws">lila-ws</h3> <p><a href="https://github.com/ornicar/lila-ws/">Lila-ws</a> is the websocket component of Lila.</p> <p>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.</p> <p>Here is how to fix that (in diff format):</p> <pre class="file">
-csrf.origin = "http://127.0.0.1:9000"
+csrf.origin = "https://chess.tait.tech"
</pre> <p>You need to tell lila-ws where the websocket requests will be coming from. This is how to do that.</p> <h2 id="conclusion">Conclusion</h2> <p>This is not a long article, but just some notes for future me and Lila developers.</p> </article> </main> <hr> <footer> This page is mirrored on <a href="https://beta.tait.tech/2020/12/20/deploy-lichess/">beta.tait.tech</a>. </footer> </div> </body> </html>

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…
Cancel
Save