From fa04b1f44fc1b2316d264a1fb891fa898781658c Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Sun, 10 Mar 2024 09:52:03 -0400 Subject: [PATCH 01/11] Add lila-fishnet app state (#64) --- docker-compose.yml | 1 + docker/lila-fishnet.Dockerfile | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4222d4d1..1d038d38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,6 +132,7 @@ services: dockerfile: lila-fishnet.Dockerfile environment: - KAMON_ENABLED=${ENABLE_MONITORING:-false} + # - HTTP_API_LOGGER=true restart: unless-stopped networks: - lila-network diff --git a/docker/lila-fishnet.Dockerfile b/docker/lila-fishnet.Dockerfile index 45af6a8c..92353e2b 100644 --- a/docker/lila-fishnet.Dockerfile +++ b/docker/lila-fishnet.Dockerfile @@ -4,6 +4,9 @@ ENV CONFIG_FORCE_kamon_influxdb_authentication_token="secret" ENV CONFIG_FORCE_kamon_influxdb_hostname="influxdb" ENV REDIS_HOST="redis" +ENV APP_BACKUP_FILE=/backup.json +RUN touch $APP_BACKUP_FILE + WORKDIR /lila-fishnet ENTRYPOINT sbt app/run From 4aff3bb794c07e820934265f7f837c24c63b9a97 Mon Sep 17 00:00:00 2001 From: Carbrex <95964955+Carbrex@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:57:02 +0000 Subject: [PATCH 02/11] Start all containers including optional ones (#66) --- lila-docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lila-docker b/lila-docker index f2ed0d16..4e85e1d3 100755 --- a/lila-docker +++ b/lila-docker @@ -18,7 +18,7 @@ run_start() { run_setup else if [ ! -z "$(docker compose ps -a --services --status=exited | xargs)" ]; then - docker compose start + COMPOSE_PROFILES=$(all_profiles) docker compose start else echo "There are no stopped services to resume" fi From 5173837048fd45a6cd759e6d74b8d4c0ba36d2c7 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Tue, 12 Mar 2024 17:42:28 -0400 Subject: [PATCH 03/11] double quote around env var --- docker/lila-fishnet.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/lila-fishnet.Dockerfile b/docker/lila-fishnet.Dockerfile index 92353e2b..53c72a14 100644 --- a/docker/lila-fishnet.Dockerfile +++ b/docker/lila-fishnet.Dockerfile @@ -5,7 +5,7 @@ ENV CONFIG_FORCE_kamon_influxdb_hostname="influxdb" ENV REDIS_HOST="redis" ENV APP_BACKUP_FILE=/backup.json -RUN touch $APP_BACKUP_FILE +RUN touch "$APP_BACKUP_FILE" WORKDIR /lila-fishnet From 7206d4294949f710967ff74252bbffa2de007840 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Tue, 12 Mar 2024 17:42:53 -0400 Subject: [PATCH 04/11] Show log before creating database indexes since it take a little longer now --- lila-docker | 1 + 1 file changed, 1 insertion(+) diff --git a/lila-docker b/lila-docker index 4e85e1d3..f811cf4f 100755 --- a/lila-docker +++ b/lila-docker @@ -64,6 +64,7 @@ setup_database() { --tokens \ --es --es-host=elasticsearch:9200 + echo "Creating database indexes..." docker compose run --rm mongodb mongo --quiet --host mongodb lichess /lila/bin/mongodb/indexes.js docker compose run --rm mongodb mongo --quiet --host mongodb lichess /lila/bin/mongodb/create-trophy-kinds.js docker compose run --rm python python /scripts/users.py From f8d06c471abf52b9f11fcabee22732661eac3efd Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Thu, 14 Mar 2024 23:04:51 -0400 Subject: [PATCH 05/11] Make mailpit and mongo-express optional services --- command/src/main.rs | 16 ++++++++++++++++ docker-compose.yml | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/command/src/main.rs b/command/src/main.rs index 80b19c47..56d59542 100644 --- a/command/src/main.rs +++ b/command/src/main.rs @@ -397,6 +397,22 @@ fn prompt_for_optional_services() -> Result>, Error "Select which optional services to include:\n (Use arrows, to toggle, to continue)\n", ) .required(false) + .item( + OptionalService { + compose_profile: vec!["mongo-express"].into(), + repositories: None, + }, + "Database admin interface", + "Mongo Express for viewing database structure and data", + ) + .item( + OptionalService { + compose_profile: vec!["email"].into(), + repositories: None, + }, + "Outbound email testing", + "for capturing and debugging outbound email", + ) .item( OptionalService { compose_profile: vec!["stockfish-play"].into(), diff --git a/docker-compose.yml b/docker-compose.yml index 1d038d38..87d73e30 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -259,6 +259,8 @@ services: - 8025:8025 networks: - lila-network + profiles: + - email mongo_express: image: mongo-express:1.0.2-20-alpine3.19 @@ -272,6 +274,8 @@ services: - lila-network depends_on: - mongodb + profiles: + - mongo-express influxdb: image: influxdb:2.7.5-alpine From 1211c3fffe241763e0ad08db8062bfe24477352b Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Thu, 14 Mar 2024 23:12:06 -0400 Subject: [PATCH 06/11] Elasticvue for search debugging (#67) --- .gitpod.yml | 4 ++-- README.md | 2 +- conf/elasticsearch.yml | 7 +++++++ docker-compose.yml | 14 +++++++------- 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 conf/elasticsearch.yml diff --git a/.gitpod.yml b/.gitpod.yml index 5ffe76ae..85ddf8cb 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -38,8 +38,8 @@ ports: - port: 3001 name: picfit onOpen: ignore - - port: 5601 - name: kibana + - port: 8092 + name: elasticvue description: Elasticsearch manager onOpen: ignore diff --git a/README.md b/README.md index adbc70b4..c2a8aee4 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Depending on which optional services you start: | --------------------- | -------------------------------------------------------- | | lila-gif | http://localhost:6175/image.gif?fen=4k3/6KP/8/8/8/8/7p/8 | | Picfit | http://localhost:3001/healthcheck | -| Elasticsearch manager | http://localhost:5601/ | +| Elasticsearch manager | http://localhost:8092/ | | API docs | http://localhost:8089/ | | Chessground | http://localhost:8090/demo.html | | PGN Viewer | http://localhost:8091/ | diff --git a/conf/elasticsearch.yml b/conf/elasticsearch.yml new file mode 100644 index 00000000..025e4e0b --- /dev/null +++ b/conf/elasticsearch.yml @@ -0,0 +1,7 @@ +cluster.name: "docker-cluster" +network.host: 0.0.0.0 + +http.cors.enabled: true +http.cors.allow-origin: "http://localhost:8092" + +http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length,Authorization diff --git a/docker-compose.yml b/docker-compose.yml index 87d73e30..c1ec0604 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -194,20 +194,20 @@ services: - discovery.type=single-node networks: - lila-network + ports: + - 9200:9200 + volumes: + - ./conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml profiles: - search - kibana: - image: kibana:7.17.4 + elasticvue: + image: cars10/elasticvue:1.0.4 restart: unless-stopped - environment: - - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 ports: - - 5601:5601 + - 8092:8080 networks: - lila-network - depends_on: - - elasticsearch profiles: - search From fcd4e853ec7e97c94d0b57515cc541da3bac5f4a Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Thu, 14 Mar 2024 23:12:49 -0400 Subject: [PATCH 07/11] update readme with optional service urls --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2a8aee4..36a09331 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ Always available: | Service | URL | | ------------------ | ---------------------- | | Main lila instance | http://localhost:8080/ | -| Mongodb manager | http://localhost:8081/ | -| Email inbox | http://localhost:8025/ | Depending on which optional services you start: | Service | URL | | --------------------- | -------------------------------------------------------- | +| Mongodb manager | http://localhost:8081/ | +| Email inbox | http://localhost:8025/ | | lila-gif | http://localhost:6175/image.gif?fen=4k3/6KP/8/8/8/8/7p/8 | | Picfit | http://localhost:3001/healthcheck | | Elasticsearch manager | http://localhost:8092/ | From fb6a8d1e4feaa9dd15641c57b27abe4d39c26d28 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Fri, 15 Mar 2024 10:41:19 -0400 Subject: [PATCH 08/11] run mongo commands on existing container --- lila-docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lila-docker b/lila-docker index f811cf4f..6b89f766 100755 --- a/lila-docker +++ b/lila-docker @@ -65,8 +65,8 @@ setup_database() { --es --es-host=elasticsearch:9200 echo "Creating database indexes..." - docker compose run --rm mongodb mongo --quiet --host mongodb lichess /lila/bin/mongodb/indexes.js - docker compose run --rm mongodb mongo --quiet --host mongodb lichess /lila/bin/mongodb/create-trophy-kinds.js + docker compose exec mongodb mongo --quiet lichess /lila/bin/mongodb/indexes.js + docker compose exec mongodb mongo --quiet lichess /lila/bin/mongodb/create-trophy-kinds.js docker compose run --rm python python /scripts/users.py } From 58548101cb0e40f94d3dbcc016c85bdbbece85af Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Fri, 15 Mar 2024 23:40:11 -0400 Subject: [PATCH 09/11] fix elasticvue for gitpod --- command/Cargo.lock | 20 ++++++++++---------- conf/elasticsearch.yml | 7 ------- conf/elasticvue.json | 1 + docker-compose.yml | 10 ++++++---- 4 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 conf/elasticsearch.yml create mode 100644 conf/elasticvue.json diff --git a/command/Cargo.lock b/command/Cargo.lock index 82735a75..f12e55b7 100644 --- a/command/Cargo.lock +++ b/command/Cargo.lock @@ -194,9 +194,9 @@ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -297,18 +297,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -317,9 +317,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" dependencies = [ "serde", "serde_spanned", @@ -338,9 +338,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" dependencies = [ "indexmap", "serde", diff --git a/conf/elasticsearch.yml b/conf/elasticsearch.yml deleted file mode 100644 index 025e4e0b..00000000 --- a/conf/elasticsearch.yml +++ /dev/null @@ -1,7 +0,0 @@ -cluster.name: "docker-cluster" -network.host: 0.0.0.0 - -http.cors.enabled: true -http.cors.allow-origin: "http://localhost:8092" - -http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length,Authorization diff --git a/conf/elasticvue.json b/conf/elasticvue.json new file mode 100644 index 00000000..a07cdaef --- /dev/null +++ b/conf/elasticvue.json @@ -0,0 +1 @@ +[{ "name": "lila", "uri": "http://localhost:9200" }] diff --git a/docker-compose.yml b/docker-compose.yml index c1ec0604..82aa67f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -190,20 +190,22 @@ services: image: elasticsearch:7.17.4 restart: unless-stopped environment: - - xpack.security.enabled=false - discovery.type=single-node + - http.cors.allow-origin=/.*/ + - http.cors.enabled=true + - xpack.security.enabled=false networks: - lila-network ports: - 9200:9200 - volumes: - - ./conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml profiles: - search elasticvue: image: cars10/elasticvue:1.0.4 restart: unless-stopped + volumes: + - ./conf/elasticvue.json:/usr/share/nginx/html/api/default_clusters.json ports: - 8092:8080 networks: @@ -253,7 +255,7 @@ services: - thumbnails mailpit: - image: axllent/mailpit:v1.14.1 + image: axllent/mailpit:v1.14.4 restart: unless-stopped ports: - 8025:8025 From a55bc5fd05e1cee74608e9c58414772759c9e54f Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Fri, 15 Mar 2024 23:49:26 -0400 Subject: [PATCH 10/11] register port 9200 in gitpod config --- .gitpod.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitpod.yml b/.gitpod.yml index 85ddf8cb..22296ae8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -42,6 +42,10 @@ ports: name: elasticvue description: Elasticsearch manager onOpen: ignore + - port: 9200 + name: elasticsearch + description: Elasticsearch + onOpen: ignore vscode: extensions: From 4cc9a9d2a8a93701a4a21e67a0fff761c454066c Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Sat, 16 Mar 2024 00:00:21 -0400 Subject: [PATCH 11/11] gitpod port 9200 public, for elasticvue connection --- .gitpod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitpod.yml b/.gitpod.yml index 22296ae8..8c3d1c00 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -46,6 +46,7 @@ ports: name: elasticsearch description: Elasticsearch onOpen: ignore + visibility: public vscode: extensions: