From 9ec01dbd8821fc5d56cee22f2b625be9e7a1e90d Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Sat, 13 Jan 2024 20:29:56 +0000 Subject: [PATCH] https://github.com/bonfire-networks/bonfire-app/issues/594 --- .tool-versions | 4 ++-- docs/DEPLOY.md | 2 +- docs/HACKING.md | 6 +++--- flavours/classic/config/config.exs | 14 ++++++++++++++ flavours/classic/config/test.exs | 14 -------------- justfile | 3 +++ mix.exs | 2 +- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.tool-versions b/.tool-versions index 53f9005ed9..dbd9802fcf 100755 --- a/.tool-versions +++ b/.tool-versions @@ -1,8 +1,8 @@ -# You can use asdf or rtx to install these +# You can use asdf or [mise](https://github.com/jdx/mise) to install these # NOTE: see upgrade instructions in .tool-versions.env erlang 26.2.1 elixir 1.16.0-otp-26 -just 1.22 +just 1.23 yarn 1.22.19 nodejs 21.5.0 chromedriver latest diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index 6a7978f0e3..5850d3c480 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -206,7 +206,7 @@ For production, we recommend to set up a CI workflow to automate this, for an ex - Postgres (or Postgis) version 12 or newer - [just](https://github.com/casey/just#packages) -- Elixir version 1.15+ with OTP 25+. If your distribution only has an old version available, check [Elixir's install page](https://elixir-lang.org/install.html) or use a tool like [rtx](https://github.com/jdxcode/rtx) (run `rtx install` in this directory). +- Elixir version 1.15+ with OTP 25+. If your distribution only has an old version available, check [Elixir's install page](https://elixir-lang.org/install.html) or use a tool like [mise](https://github.com/jdx/mise) (run `mise install` in this directory) or asdf. #### C-1. Building the release diff --git a/docs/HACKING.md b/docs/HACKING.md index c3d4fc5649..4f0801f442 100755 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -60,7 +60,7 @@ You may also want to put this in the appropriate place in your system so your ch ### Option B - the easy way (with bare-metal elixir, and docker-managed tooling, database & search index, recommended for active development) -> Note: you can use a tool like [rtx](https://github.com/jdxcode/rtx) or asdf to setup the environment (run `rtx install` in the root directory). +> Note: you can use a tool like [mise](https://github.com/jdx/mise) or asdf to setup the environment (run `mise install` in the root directory). - Dependencies: - Recent versions of [Elixir](https://elixir-lang.org/install.html) (1.15+) and OTP/erlang (25+) @@ -73,7 +73,7 @@ You may also want to put this in the appropriate place in your system so your ch ### Option C - the partial way (with bare-metal elixir and tooling, and docker-managed database & search index) -> Note: you can use a tool like [rtx](https://github.com/jdxcode/rtx) or asdf to setup the environment (run `rtx install` in the root directory). +> Note: you can use a tool like [mise](https://github.com/jdx/mise) or asdf to setup the environment (run `mise install` in the root directory). - Dependencies: - Recent versions of [Elixir](https://elixir-lang.org/install.html) (1.15+) and OTP/erlang (25+) @@ -87,7 +87,7 @@ You may also want to put this in the appropriate place in your system so your ch ### Option D - the bare metal (if you don't use docker) -> Note: you can use a tool like [rtx](https://github.com/jdxcode/rtx) or asdf to setup your the environment (run `rtx install` in the root directory). You will still need to install Postgres and Meili seperately though. +> Note: you can use a tool like [mise](https://github.com/jdx/mise) or asdf to setup the environment (run `mise install` in the root directory). You will still need to install Postgres and Meili seperately though. - Dependencies: - Recent versions of [Elixir](https://elixir-lang.org/install.html) (1.15+) and OTP/erlang (25+) diff --git a/flavours/classic/config/config.exs b/flavours/classic/config/config.exs index 959b1ff975..0d81acc367 100755 --- a/flavours/classic/config/config.exs +++ b/flavours/classic/config/config.exs @@ -61,6 +61,20 @@ config :bonfire, Bonfire.Web.Endpoint, # NOTE: see also `LV_TIMEOUT` and `LV_FULLSWEEP_AFTER` for the socket in the endpoint module ] +# Optionally run a 2nd endpoint for testing federation (only used in dev/prod) +config :bonfire, Bonfire.Web.FakeRemoteEndpoint, + server: true, + url: [ + host: "localhost", + port: 4002 + ], + http: [ + port: 4002 + ], + secret_key_base: System.get_env("SECRET_KEY_BASE"), + live_view: [signing_salt: System.get_env("SIGNING_SALT")], + render_errors: [view: Bonfire.UI.Common.ErrorView, accepts: ~w(html json), layout: false] + config :bonfire, :markdown_library, MDEx config :phoenix, :json_library, Jason diff --git a/flavours/classic/config/test.exs b/flavours/classic/config/test.exs index ddb95ddd2d..c0adb39908 100755 --- a/flavours/classic/config/test.exs +++ b/flavours/classic/config/test.exs @@ -44,20 +44,6 @@ config :bonfire, Bonfire.Common.Repo, log: false, stacktrace: true -# Optionally run a 2nd endpoint for testing federation -config :bonfire, Bonfire.Web.FakeRemoteEndpoint, - server: true, - url: [ - host: "localhost", - port: 4002 - ], - http: [ - port: 4002 - ], - secret_key_base: System.get_env("SECRET_KEY_BASE"), - live_view: [signing_salt: System.get_env("SIGNING_SALT")], - render_errors: [view: Bonfire.UI.Common.ErrorView, accepts: ~w(html json), layout: false] - test_instance? = System.get_env("TEST_INSTANCE") == "yes" federate? = test_instance? or System.get_env("FEDERATE") == "yes" diff --git a/justfile b/justfile index 4f80c0a25c..0d51685b2f 100644 --- a/justfile +++ b/justfile @@ -539,6 +539,9 @@ test-federation-dance-positions: test-federation-live-DRAGONS *args='': FEDERATE=yes START_SERVER=yes HOSTNAME=$(just local-tunnel-hostname) PUBLIC_PORT=443 just test --only live_federation $@ +load_testing: + TEST_INSTANCE=yes just mix bonfire.load_testing + # dev-test-watch: init ## Run tests # docker compose run --service-ports -e MIX_ENV=test web iex -S mix phx.server diff --git a/mix.exs b/mix.exs index 4dd2cc6bb9..bff4b639da 100755 --- a/mix.exs +++ b/mix.exs @@ -72,7 +72,7 @@ defmodule Bonfire.Umbrella.MixProject do {:benchee_html, "~> 1.0", only: [:dev, :test]}, # for Telemetry store {:circular_buffer, "~> 0.4", only: :dev}, - {:chaperon, "~> 0.3.1", only: [:dev, :test]}, + # {:chaperon, "~> 0.3.1", only: [:dev, :test]}, # logging {:sentry, "~> 9.0", only: :prod, override: true},