You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
57 KiB

<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="https://jekyllrb.com/" version="4.1.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml"/><link href="/" rel="alternate" type="text/html"/><updated>2020-12-21T10:02:48-07:00</updated><id>/feed.xml</id><entry><title type="html">How to Deploy Lichesss Lila With Nginx</title><link href="/2020/12/20/deploy-lichess/" rel="alternate" type="text/html" title="How to Deploy Lichesss Lila With Nginx"/><published>2020-12-20T00:00:00-07:00</published><updated>2020-12-20T00:00:00-07:00</updated><id>/2020/12/20/deploy-lichess</id><content type="html" xml:base="/2020/12/20/deploy-lichess/">&lt;p&gt;I was getting ready to have a public test of some changes I made to &lt;a href=&quot;https://lichess.org&quot;&gt;lichess.org&lt;/a&gt;s &lt;a href=&quot;https://lichess.org/source&quot;&gt;open source chess platform&lt;/a&gt;. 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.&lt;/p&gt; &lt;h2 id=&quot;reasoning&quot;&gt;Reasoning&lt;/h2&gt; &lt;p&gt;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.&lt;/p&gt; &lt;p&gt;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.&lt;/p&gt; &lt;p&gt;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.&lt;/p&gt; &lt;p&gt;So here is how to deploy it:&lt;/p&gt; &lt;h2 id=&quot;setup-a-development-environment&quot;&gt;Setup a development environment&lt;/h2&gt; &lt;p&gt;This is described &lt;a href=&quot;https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding&quot;&gt;in Lichesss documentation itself&lt;/a&gt;. I will not elaborate further as it is not necessary.&lt;/p&gt; &lt;h2 id=&quot;setup-nginx&quot;&gt;Setup nginx&lt;/h2&gt; &lt;p&gt;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.&lt;/p&gt; &lt;p&gt;Here is the relevant portion of my nginx configuration:&lt;/p&gt; &lt;pre class=&quot;file&quot;&gt; server_name chess.tait.tech; location / { proxy_pass http://127.0.0.1:9663; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; } &lt;/pre&gt; &lt;pre class=&quot;file&quot;&gt; server_name ws.chess.tait.tech; location / { proxy_pass http://127.0.0.1:9664; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection &quot;upgrade&quot;; } &lt;/pre&gt; &lt;p&gt;You will need to deploy these on two virtual hosts.&lt;/p&gt; &lt;h2 id=&quot;lila&quot;&gt;Lila&lt;/h2&gt; &lt;p&gt;&lt;a href=&quot;https://github.com/ornicar/lila/&quot;&gt;Lila&lt;/a&gt; is the name for the main chess server, we need to change a few settings. Here is my git diff for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conf/base.conf&lt;/code&gt; file:&lt;/p&gt; &lt;pre class=&quot;file&quot;&gt; - domain = &quot;localhost:9663&quot; - socket.domains = [ &quot;localhost:9664&quot; ] + domain = &quot;chess.tait.tech&quot; + socket.domains = [ &quot;ws.chess.tait.tech&quot; ] asset.domain = ${net.domain} - asset.base_url = &quot;http://&quot;${net.asset.domain} + asset.base_url = &quot;https://&quot;${net.