Skip to content

Commit

Permalink
Start
Browse files Browse the repository at this point in the history
  • Loading branch information
DrNixx committed Sep 12, 2020
1 parent f196102 commit a9b7b53
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 58 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://editorconfig.org/

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
33 changes: 23 additions & 10 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: Build assets
on:
push:
paths:
- '.github/workflows/assets.yml'
- 'public/**'
- 'ui/**'
- 'package.json'
- 'yarn.lock'
pull_request:
paths:
- '.github/workflows/assets.yml'
- 'public/**'
- 'ui/**'
- 'package.json'
Expand All @@ -18,22 +20,33 @@ jobs:
assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/cache@v1
submodules: recursive
- run: git submodule absorbgitdirs
- uses: actions/checkout@v2
with:
path: ~/.cache/yarn
repository: lichess-org/ab
ssh-key: ${{ secrets.id_rsa_ab }}
ref: master
path: ab
continue-on-error: true
id: ab
- run: yarn link --cwd "$GITHUB_WORKSPACE/ab" && yarn link ab --cwd ui/round
if: steps.ab.outcome == 'success'
- run: echo "::set-output name=dir::$(yarn cache dir)"
id: yarn-cache
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- run: sudo apt-get install -y parallel
- run: yarn global add gulp-cli
- run: ./ui/build prod
- run: mkdir assets && mv public assets/ && cp LICENSE COPYING.md README.md assets/ && git log -n 1 --pretty=oneline > assets/commit.txt
- run: cd assets && tar -cvpJf ../assets.tar.xz . && cd -
env:
XZ_OPT: '-0'
- uses: actions/upload-artifact@v1
with:
name: lila-assets
path: assets
path: assets.tar.xz
40 changes: 26 additions & 14 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,52 @@ name: Build server
on:
push:
paths:
- '.github/workflows/server.yml'
- 'app/**'
- 'conf/**'
- 'modules/**'
- 'project/**'
- 'translation/**'
- 'build.sbt'
- 'lila'
- 'conf/application.conf.default'
- '.sbtopts.default'
branches-ignore:
- 'l10n_master'
pull_request:
paths:
- '.github/workflows/server.yml'
- 'app/**'
- 'conf/**'
- 'modules/**'
- 'project/**'
- 'translation/source/**'
- 'build.sbt'
branches-ignore:
- 'l10n_master'
- 'lila'
- 'conf/application.conf.default'
- '.sbtopts.default'

jobs:
server:
openjdk14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
fetch-depth: 1
- run: echo "autoformat=false" > ~/.scalariform.conf
- run: mkdir -p target/universal/stage && cp LICENSE COPYING.md README.md target/universal/stage/ && git log -n 1 --pretty=oneline > target/universal/stage/commit.txt
- uses: actions/cache@v1
path: |
~/.sbt
~/.ivy2/cache
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- uses: actions/setup-java@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy2
- uses: olafurpg/setup-scala@6068b77a47ebd5c365972f14142aa0d1b6aa4ced
- run: ./bin/dev.default test:compile test stage
- run: du -d2 -h ~
java-version: 14.0.1
- run: TZ=UTC git log -1 --date=iso-strict-local --pretty='format:app.version.commit = "%h"%napp.version.date = "%ad"%napp.version.message = """%s"""%n' | tee conf/version.conf
- run: ./lila -Depoll=true "test;stage"
- run: cp LICENSE COPYING.md README.md target/universal/stage && git log -n 1 --pretty=oneline > target/universal/stage/commit.txt
- run: cd target/universal/stage && tar -cvpJf ../../../lila-3.0.tar.xz . && cd -
env:
XZ_OPT: '-0'
- uses: actions/upload-artifact@v1
with:
name: lila-server
path: target/universal/stage
path: lila-3.0.tar.xz
8 changes: 4 additions & 4 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: Lint translations
on:
push:
paths:
- '.github/workflows/translations.yml'
- 'translation/**'
- 'bin/trans-lint.py'
pull_request:
paths:
- '.github/workflows/translations.yml'
- 'translation/**'
- 'bin/trans-lint.py'

jobs:
translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v2
- name: Install xmllint
run: sudo apt-get install -y libxml2-utils
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: Validate translation files
run: xmllint --noout --dtdvalid translation/resources.dtd translation/**/*.xml
- name: Lint translation files
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
.sbtopts
conf/application.conf
conf/version.conf

bin/dev
bin/dev.bat
logs
project/project
project/target
public/trans
public/compiled
public/vendor/bar-rating
public/vendor/highcharts-4.2.5
public/vendor/hopscotch
public/vendor/stockfish.wasm
public/vendor/stockfish-mv.wasm
public/vendor/stockfish.pexe
public/vendor/stockfish.js
public/css/
target
bin/.translate_version
data/
dist/
node_modules/
local/
ui/*/npm-debug.log
ui/*/tsconfig.tsbuildinfo
hs_*.log
yarn-error.log

Expand Down
9 changes: 0 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
[submodule "public/vendor/tagmanager"]
path = public/vendor/tagmanager
url = https://github.com/max-favilli/tagmanager
[submodule "public/vendor/ChessPursuit"]
path = public/vendor/ChessPursuit
url = https://github.com/ornicar/ChessPursuit
[submodule "public/vendor/multiple-select"]
path = public/vendor/multiple-select
url = https://github.com/ornicar/multiple-select
[submodule "public/vendor/hopscotch"]
path = public/vendor/hopscotch
url = https://github.com/linkedin/hopscotch
[submodule "public/vendor/shepherd"]
path = public/vendor/shepherd
url = https://github.com/HubSpot/shepherd
[submodule "public/vendor/bar-rating"]
path = public/vendor/bar-rating
url = https://github.com/antennaio/jquery-bar-rating
6 changes: 3 additions & 3 deletions COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Exceptions (free)

Files | Author(s) | License
--- | --- | ---
public/font/lichess.{sfd,woff,woff2} | [Dave Gandy](http://fontawesome.io/), [GitHub](https://github.com/primer/octicons), [Webalys](http://www.webalys.com/), [Zurb](http://zurb.com/playground/foundation-icon-fonts-3), [Daniel Bruce](http://www.entypo.com/), [Shapemade](http://steadysets.com/), [Sergey Shmidt](http://designmodo.com/linecons-free/) and the lichess authors | [OFL](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), [MIT](https://github.com/primer/octicons/blob/master/LICENSE), [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), AGPLv3+
public/font/lichess.{sfd,woff,woff2} | [Dave Gandy](http://fontawesome.io/), [GitHub](https://github.com/primer/octicons), [Webalys](http://www.webalys.com/), [Zurb](http://zurb.com/playground/foundation-icon-fonts-3), [Daniel Bruce](http://www.entypo.com/), [Shapemade](http://steadysets.com/), [Sergey Shmidt](http://designmodo.com/linecons-free/) and the Lichess authors | [OFL](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), [MIT](https://github.com/primer/octicons/blob/master/LICENSE), [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), AGPLv3+
public/font/lichess.chess.{sfd,woff,woff2} | the [pgn4web](http://pgn4web.casaschi.net/home.html) authors | [GPLv2+](https://www.gnu.org/licenses/gpl-2.0.txt)
Noto Sans in public/font | [Google](https://fonts.google.com/specimen/Noto+Sans) | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
Roboto in public/font | [Christian Robertson](https://fonts.google.com/specimen/Roboto) | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
Expand All @@ -57,6 +57,7 @@ public/piece/california | [Jerry S.](https://sites.google.com/view/jerrychess/ho
public/piece/maestro | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/fresca | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/cardinal | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/icpieces | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/gioco | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/tatiana | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/staunty | [sadsnake1](https://github.com/sadsnake1) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
Expand Down Expand Up @@ -91,15 +92,14 @@ External services

Lichess as deployed on https://lichess.org/ also uses these external services:

* [Cloudflare](https://www.cloudflare.com/) to serve static assets
* [Cloudflare](https://www.cloudflare.com/) to serve static assets, DNS lookups for email validation
* [Mailgun](https://www.mailgun.com/) for transactional email
* [prismic.io](https://prismic.io/) for help/documentation pages and the blog
* [twitch](https://www.twitch.tv/) for featured livestreams
* [YouTube](https://www.youtube.com) for featured livestreams and the [Video library](https://lichess.org/video)
* [stripe](https://stripe.com/) and [PayPal](https://www.paypal.com) for [Patron donations](https://lichess.org/patron)
* [Spreadshirt](https://shop.spreadshirt.com/lichess-org) for the [Swag store](https://lichess.org/swag)
* [check.torproject.org](https://check.torproject.org/exit-addresses) for a list or Tor exit nodes
* [getipintel.net](https://getipintel.net/)
* [detectlanguage.com](https://detectlanguage.com/)
* Fallback to [Google Fonts](https://fonts.google.com/)
* [Google Cloud Messaging](https://developers.google.com/cloud-messaging/) and [OneSignal](https://onesignal.com/) for mobile notifications
Expand Down
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/lichess/localized.svg)](https://crowdin.com/project/lichess)
[![Twitter](https://img.shields.io/badge/Twitter-%40lichess-blue.svg)](https://twitter.com/lichess)

<img src="https://raw.githubusercontent.com/ornicar/lila/master/public/images/home-bicolor.png" alt="lichess.org" />
<img src="https://raw.githubusercontent.com/ornicar/lila/master/public/images/home-bicolor.png" alt="Lichess homepage" title="Lichess comes with light and dark theme, this screenshot shows both." />


Lila (li[chess in sca]la) is a free online chess game server focused on [realtime](https://lichess.org/games) gameplay and ease of use.

Expand All @@ -21,20 +22,21 @@ a [mobile app](https://lichess.org/mobile),
and a [shared analysis board](https://lichess.org/study).
The UI is available in more than [130 languages](https://crowdin.com/project/lichess) thanks to the community.

Lichess is written in [Scala 2.11](https://www.scala-lang.org/),
and relies on the [Play 2.4](https://www.playframework.com/) framework.
Lichess is written in [Scala 2.13](https://www.scala-lang.org/),
and relies on the [Play 2.8](https://www.playframework.com/) framework.
[scalatags](http://www.lihaoyi.com/scalatags/) is used for templating.
Pure chess logic is contained in the [scalachess](https://github.com/ornicar/scalachess) submodule.
The server is fully asynchronous, making heavy use of Scala Futures and [Akka 2 actors](http://akka.io).
Some WebSocket connections are handled by a [seperate server](https://github.com/ornicar/lila-ws) that communicates using [redis](https://redis.io/).
The server is fully asynchronous, making heavy use of Scala Futures and [Akka streams](http://akka.io).
WebSocket connections are handled by a [seperate server](https://github.com/ornicar/lila-ws) that communicates using [redis](https://redis.io/).
Lichess talks to [Stockfish](http://stockfishchess.org/) deployed in an [AI cluster](https://github.com/niklasf/fishnet) of donated servers.
It uses [MongoDB](https://mongodb.org) to store more than 1 billion games, which are indexed by [elasticsearch](http://elasticsearch.org).
HTTP requests and WebSocket connections are proxied by [nginx](http://nginx.org).
The web client is written in [TypeScript](https://typescriptlang.org) and [snabbdom](https://github.com/snabbdom/snabbdom), using [Sass](https://sass-lang.com/) to generate CSS.
It uses [MongoDB](https://mongodb.org) to store more than 1.7 billion games, which are indexed by [elasticsearch](http://elasticsearch.org).
HTTP requests and WebSocket connections can be proxied by [nginx](http://nginx.org).
The web client is written in [TypeScript](https://www.typescriptlang.org/) and [snabbdom](https://github.com/snabbdom/snabbdom), using [Sass](https://sass-lang.com/) to generate CSS.
The [blog](https://lichess.org/blog) uses a free open content plan from [prismic.io](https://prismic.io).
All rated games are published in a [free PGN database](https://database.lichess.org).
Browser testing done with [![Browserstack](https://raw.githubusercontent.com/ornicar/lila/master/public/images/browserstack.png)](https://www.browserstack.com).
Please help us [translate lichess with Crowdin](https://crowdin.com/project/lichess).
Proxy detection done with [IP2Proxy database](https://www.ip2location.com/database/ip2proxy).
Please help us [translate Lichess with Crowdin](https://crowdin.com/project/lichess).

See [lichess.org/source](https://lichess.org/source) for a list of repositories.

Expand All @@ -44,9 +46,12 @@ Use [GitHub issues](https://github.com/ornicar/lila/issues) for bug reports and
Installation
------------

The Wiki describes [how to setup a development environment](https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding).
```
./lila # thin wrapper around sbt
run
```

The source code is available for learning and contribution, but please don't just setup a public Lichess clone. Don't expect developers to help you run your own instance. Questions about the installation and runtime issues will probably be ignored.
The Wiki describes [how to setup a development environment](https://github.com/ornicar/lila/wiki/Lichess-Development-Onboarding).

HTTP API
--------
Expand All @@ -63,15 +68,14 @@ Supported browsers

| Name | Version | Notes |
| ----------------- | ------- | ----- |
| Chromium / Chrome | last 10 | Full support, fastest local analysis |
| Firefox | 55+ | Full support, second fastest local analysis |
| Chromium / Chrome | last 10 | Full support |
| Firefox | 55+ | Full support (fastest local analysis since FF 79) |
| Safari | 10.1+ | Reasonable support |
| Opera | 55+ | Reasonable support |
| Edge | 17+ | Reasonable support |

Older browsers (including any version of Internet Explorer) will not work.
For your own sake, please upgrade. Security and performance, think about
it!
For your own sake, please upgrade. Security and performance, think about it!

License
-------
Expand Down

0 comments on commit a9b7b53

Please sign in to comment.