-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Lichess Development Onboarding (Windows)
The following instructions explain how to set up your development environment for Lichess on Windows.
GNU/Linux instructions: https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding
Note that Windows is not officially supported for lila builds. You can get it to work now, but there is no guarantee that it stays like that.
-
Clone the lila project to your computer:
git clone https://github.com/ornicar/lila.git -
Using the command prompt, navigate to the directory where you cloned it into:
cd lila -
Set up the submodules:
git submodule update --init --recursive -
Before we compile, we have to change some options related to the memory management of Java, otherwise you'll get an OutOfMemoryException.
set JAVA_OPTS=-Xms64M -Xmx2048M -Xss4M -XX:ReservedCodeCacheSize=64m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -
If you want to compile now, you'll run into an
UnmappableCharacterExceptionfrom the i18n module. It looks like it's related to something with the encoding, but I couldn't figure out the root cause of the issue. There is a workaround though: inmodules\i18n\messages\, delete everything except themessagesfile (the one without file extension). This works unless you want to do something specific to the i18n module, so it's still very ugly. If you find a better way to make the compilation work - without deleting the messages files - please edit this section. Also note that if you want to make a Git commit to submit a pull request to lila, make sure that you do not accidentally commit the deletion of these messages files. -
Compile the application using
sbt compile. -
Run
npm install -g gulp-clito be able to build the lichess UI. -
Run this
build-ui.batscript to build the UI (based onui/build): https://gist.github.com/ProgramFOX/5608e07f81daa6a4aa5b9501c684bdf4 (make sure to run it from the lila root directory) -
Download http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz and unpack it. Then create a
datafolder in your lila application root and put GeoLite2-City.mmdb in there.
-
Add the following line to your hosts file (
C:\Windows\System32\drivers\etc\hosts):127.0.0.1 l.org socket.l.org en.l.org -
Open your
nginx.conffile, and add this 'Server' block to thehttpblock:server { server_name l.org ~^\w\w\.l\.org$; listen 80; error_log logs\lila.access.log; access_log logs\lila.error.log; charset utf-8; location /assets { add_header "Access-Control-Allow-Origin" "*"; alias <path\to\>\lila\public; } location / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 90s; proxy_http_version 1.1; proxy_pass http://127.0.0.1:9663/; } error_page 500 501 502 503 /oops/servererror.html; error_page 504 /oops/timeout.html; error_page 429 /oops/toomanyrequests.html; location /oops/ { root <path\to\>\lila\public; } location = /robots.txt { root <path\to\>\lila\public; } } server { server_name socket.l.org; listen 80; charset utf-8; location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:9663/; } }
Don't forget to change <path\to\> into an actual path.
-
Navigate into the
confdirectory of your lila application root. Create a fileapplication.confwith these contents:include "base" net { domain = "l.org" asset.domain = "en.l.org" extra_ports = [] } geoip { file = "data/GeoLite2-City.mmdb" } http { port = 9663 } -
Make sure nginx is running.
-
Make sure a MongoDB server instance is running.
-
Run
sbt. -
When you can input a command, type
run 9663and press enter. -
In your browser, navigate to
l.org