From e3d150fdac8c8f1897f707a9903335e3e2e6ed3d Mon Sep 17 00:00:00 2001 From: jebba Date: Wed, 22 Dec 2021 17:36:19 -0700 Subject: [PATCH] some domain lila config, still half there --- README-install.md | 185 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 181 insertions(+), 4 deletions(-) diff --git a/README-install.md b/README-install.md index 28df39f..c195105 100644 --- a/README-install.md +++ b/README-install.md @@ -878,7 +878,6 @@ Receiving objects: 100% (5577/5577), 1.04 MiB | 8.55 MiB/s, done. Resolving deltas: 100% (3494/3494), done. debian@mychestserver:~$ cd lila-ws/ debian@mychestserver:~/lila-ws$ sbt run -debian@mychestserver:~/lila-ws$ sbt run [info] [launcher] getting org.scala-sbt sbt 1.5.7 (this may take some time)... [info] welcome to sbt 1.5.7 (Debian Java 11.0.13) [info] loading settings for project lila-ws-build from plugins.sbt ... @@ -1017,29 +1016,207 @@ In your workstation browser, check: * https://www.mychestserver.org/ +# Configure +Now that the dependencies are in place, and the site is sort of +working, it is time to configure Lila and the web sockets +daemon to use the correct domain. This will require recompiling. + + ## Configure Web Sockets lila-ws Configure `lila-ws` thusly: ``` +# Go to Lila web sockets source dir +cd ~/lila-ws/ + +# Edit the configuration file vim ./src/main/resources/application.conf -# set + +# In the configuration, set this line csrf.origin = "https://www.mychestserver.org" ``` +Now that you have changed the configuration, you need to +restart the `lila-ws` daemon. Later, we'll set up a +system service, but for now, we'll just hammer it with +`CTRL-c` and restart it. So if you still have the lila-ws +running from earlier, go to that window and hit `CTRL-c`. +This window probably has a last line like this: -# Configure -Configure thusly... +``` +INFO l.w.n.NettyServer [run-main-0] Listening to 9664 +``` + +Stopping it looks like: + +``` +INFO l.w.n.NettyServer [run-main-0] Listening to 9664 +^C +[warn] Canceling execution... +Cancelled: run +[error] Cancelled: run +[error] Use 'last' for the full log. +``` + +Then just re-run it like: + +``` +sbt run +``` + + +## Configure Lila +To configure Lila to use your domain and the web sockets +server, do the following. Log into the server and run: + +``` +# Go to the lila git root dir +cd /var/www/html/ + +# Edit using your favorite editor +vim conf/base.conf + +# Update the following section from this: + +net { + domain = "localhost:9663" + socket.domains = [ "localhost:9664" ] + asset.domain = ${net.domain} + asset.base_url = "http://"${net.asset.domain} + asset.minified = false + base_url = "http://"${net.domain} + email = "" + crawlable = false + ratelimit = true + prodDomain = "lichess.org" + http.log = true + stage.banner = false +} + +# To this: + +net { + domain = "www.mychestserver.org" + socket.domains = [ "www.mychestserver.org" ] + asset.domain = ${net.domain} + asset.base_url = "https://"${net.asset.domain} + asset.minified = false + base_url = "https://"${net.domain} + email = "gm@mychestserver.org" + crawlable = false + ratelimit = true + prodDomain = "www.mychestserver.org" + http.log = true + stage.banner = false +} +``` + +Note, there are many other sections in `conf/base.conf` that should be +edited, but this is minimally viable. + +Now restart Lila. If you still are running it in a window, you +can `CTRL-c` that, which leaves you at `lila` prompt. Then quit, +recompile, and run. + +``` +# Looks like this + +[info] http - 200 browser GET / Lobby.home 206ms +^C +[warn] Canceling execution... +Cancelled: run +[error] Cancelled: run +[error] Use 'last' for the full log. +[lila] $ +[lila] $ exit +[lila] $ exit +[info] shutting down sbt server +... +[info] shutdown - <194ms> service-stop Closing mongodb driver +[info] p.c.server.AkkaHttpServer - Running provided shutdown stop hooks +``` + +I think you have to rebuild the static bits now... +XXX probably need to patch foo.scala with the base URL? + +``` +cd /var/www/html +./ui/build +``` + + +Then re-run `lila` at the server prompt (e.g. just hit up arrow). +Looks like: + + +``` +debian@mychestserver:/var/www/html$ ./lila + |\_ _ _ _ + /o \ | (_) ___| |__ ___ ___ ___ ___ _ __ __ _ + (_. || | | |/ __| '_ \ / _ \/ __/ __| / _ \| '__/ _` | + /__\ | | | (__| | | | __/\__ \__ \| (_) | | | (_| | + )___( |_|_|\___|_| |_|\___||___/___(_)___/|_| \__, | + |___/ +Java 11.0.13 +sbt -Dreactivemongo.api.bson.document.strict=false +[info] welcome to sbt 1.5.8 (Debian Java 11.0.13) +[info] loading settings for project html-build from plugins.sbt ... +[info] loading project definition from /var/www/html/project +[info] loading settings for project lila from build.sbt ... +[info] resolving key references (67100 settings) ... +[info] set current project to lila (in build file:/var/www/html/) +[info] sbt server started at local:///home/debian/.sbt/1.0/server/22a4d6cb6dbbe2874385/sock +[info] started sbt server +[lila] $ +``` + +Now recompile: + +``` +[lila] $ compile +[success] Total time: 22 s, completed Dec 23, 2021, 12:25:50 AM +``` + +And finally run it: + +``` +[lila] $ run +``` + +In less than a minute, should look like this: + +``` +[lila] $ run +[warn] Compile / run / javaOptions will be ignored, Compile / run / fork is set to false +[info] running play.core.server.ProdServerStart +[info] boot - lila Dev / java 11.0.13, memory: 2048MB +[info] reactivemongo.api.Driver - [Supervisor-1] Creating connection: main +[info] e.r.StaticListenerBinder - Starting connection listener ... +[info] r.c.actors.MongoDBSystem - [Supervisor-1/main] Starting the MongoDBSystem +[info] r.core.netty.Pack - Instantiated reactivemongo.core.netty.Pack +[info] db.main - MongoDB connected to mongodb://127.0.0.1:27017?appName=lila in 871 ms +[info] boot - <0ms> RoundSocket Done loading 0/0 round games +[info] boot - Loaded lila modules in 7350 ms +[info] play.api.Play - Application started (Dev) (no global state) +[info] p.c.server.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9663 +``` + +Now go test in your workstation browser: + +* https://www.mychestserver.org # Use Use thusly... + # Patch Example Lila patch: https://spacecruft.org/deepcrayon/lila/commit/d0fb110e218292921e35e8fe8181d7e7ea8883e4 + # Misc Potentially include items such as: