From d3e6a2d6a3dd83a5d7a292ece7188a922898cb15 Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 30 Apr 2022 21:52:15 +0200 Subject: [PATCH 01/21] Dependabot: Detect updates in docker, actions and mix --- .github/dependabot.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..c65905e2096 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 + +updates: + + - package-ecosystem: "docker" + directory: "/.github/container/" + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "mix" + directory: "/" + schedule: + interval: "weekly" From 56af8a1b2f02e75f345da024d98af39135402c06 Mon Sep 17 00:00:00 2001 From: badlop Date: Tue, 14 Feb 2023 14:58:34 +0100 Subject: [PATCH 02/21] Codacy: Add Codacy Security Scan --- .github/workflows/codacy.yml | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/codacy.yml diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml new file mode 100644 index 00000000000..af390e38398 --- /dev/null +++ b/.github/workflows/codacy.yml @@ -0,0 +1,61 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, performs a Codacy security scan +# and integrates the results with the +# GitHub Advanced Security code scanning feature. For more information on +# the Codacy security scan action usage and parameters, see +# https://github.com/codacy/codacy-analysis-cli-action. +# For more information on Codacy Analysis CLI in general, see +# https://github.com/codacy/codacy-analysis-cli. + +name: Codacy Security Scan + +on: + push: + branches: [ "dependabot" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "dependabot" ] + schedule: + - cron: '45 13 * * 6' + +permissions: + contents: read + +jobs: + codacy-security-scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + name: Codacy Security Scan + runs-on: ubuntu-latest + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout code + uses: actions/checkout@v3 + + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5 + with: + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + # Adjust severity of non-security issues + gh-code-scanning-compat: true + # Force 0 exit code to allow SARIF file generation + # This will handover control about PR rejection to the GitHub side + max-allowed-issues: 2147483647 + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif From b970d4da869f918a3c07cb4267a9fbb392d1bf14 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 14 Feb 2023 19:10:12 +0100 Subject: [PATCH 03/21] Codacy: Disable many checks in several tools for now --- .github/workflows/codacy.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index af390e38398..4eececa09b9 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -38,6 +38,52 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Setup Checkov + run: | + sed -i '/PASSWORD/i #checkov:skip=CKV_SECRET_6:' .github/workflows/ci.yml + sed -i '/PASSWORD/i #checkov:skip=CKV_SECRET_6:' test/docker/docker-compose.yml + + - name: Setup CSSlint + run: | + echo "{\"exclude-list\": [\"priv/css/\"]}" > .csslintrc + + - name: Setup Markdownlint + run: | + sed -i '1i\' .github/ISSUE_TEMPLATE/bug_report.md + sed -i '1i\' .github/ISSUE_TEMPLATE/feature_request.md + sed -i '1i\' CODE_OF_CONDUCT.md + sed -i '1i\' CHANGELOG.md + sed -i '1i\' README.md + sed -i '1i\' test/docker/README.md + sed -i '1i\' CONTAINER.md + sed -i '1i\' COMPILE.md + sed -i '1i\' CONTRIBUTING.md + sed -i '1i\' CONTRIBUTORS.md + + - name: Setup Shellcheck + run: | + sed -i '1a\# shellcheck disable=all' tools/captcha-ng.sh + sed -i '1a\# shellcheck disable=SC2013,SC3014,SC3060' tools/check_xep_versions.sh + + - name: Setup Stylelint + run: | + sed -i '1i\/* stylelint-disable */' priv/css/admin.css + sed -i '1i\/* stylelint-disable */' priv/css/bosh.css + sed -i '1i\/* stylelint-disable */' priv/css/muc.css + sed -i '1i\/* stylelint-disable */' priv/css/oauth.css + sed -i '1i\/* stylelint-disable */' priv/css/register.css + + - name: Setup TSQLlint + run: | + sed -i '1i\-- tsqllint-disable' sql/*.sql + sed -i '1s\disable\disable data-compression set-transaction-isolation-level\' sql/mssql*.sql + + - name: Remove escript files which are not shell scripts + run: | + rm tools/extract-tr.sh + rm tools/hook_deps.sh + rm tools/opt_types.sh + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5 From 0d53bb09c5aba3a5a8e30a7494e7a3d50ecc3b4f Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 11 Sep 2023 12:01:44 +0200 Subject: [PATCH 04/21] Codacy: Use actions main version, to help solve the problem uploading SARIF file --- .github/workflows/codacy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 4eececa09b9..780aef2019e 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -36,7 +36,7 @@ jobs: steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Setup Checkov run: | @@ -86,7 +86,7 @@ jobs: # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5 + uses: codacy/codacy-analysis-cli-action@master with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations @@ -102,6 +102,6 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@main with: sarif_file: results.sarif From 8da16698bafc7e1b2f3a412022bae3c90d80fac2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 20:31:20 +0100 Subject: [PATCH 05/21] Container: Delete untagged GHCR images --- .github/workflows/container.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index b9c655ffac9..264a77f9ced 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -121,3 +121,13 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} + + - name: Delete untagged ghcr + uses: Chizkiyahu/delete-untagged-ghcr-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository_owner: ${{ github.repository_owner }} + repository: ${{ github.repository }} + package_name: ejabberd + untagged_only: true + owner_type: user # or user From e97051b454b4528e40e52b02eba8b6453d4b90af Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 21:20:51 +0100 Subject: [PATCH 06/21] Revert "Container: Delete untagged GHCR images" This reverts commit 4babb1b280f1bb758b2e3df27920e2199850349d. --- .github/workflows/container.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 264a77f9ced..b9c655ffac9 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -121,13 +121,3 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} - - - name: Delete untagged ghcr - uses: Chizkiyahu/delete-untagged-ghcr-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - repository_owner: ${{ github.repository_owner }} - repository: ${{ github.repository }} - package_name: ejabberd - untagged_only: true - owner_type: user # or user From 367f922af75a9b6dd771eb9ee5e06e2fc9d7cda0 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 19:44:26 +0100 Subject: [PATCH 07/21] Codacy: Update config, trying to solve problem when uploading SARIF file Copied example confioguration from: https://github.com/marketplace/actions/codacy-analysis-cli#integration-with-github-code-scanning --- .github/workflows/codacy.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 780aef2019e..31aee649d32 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -1,16 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow checks out code, performs a Codacy security scan -# and integrates the results with the -# GitHub Advanced Security code scanning feature. For more information on -# the Codacy security scan action usage and parameters, see -# https://github.com/codacy/codacy-analysis-cli-action. -# For more information on Codacy Analysis CLI in general, see -# https://github.com/codacy/codacy-analysis-cli. - name: Codacy Security Scan on: @@ -22,19 +9,12 @@ on: schedule: - cron: '45 13 * * 6' -permissions: - contents: read jobs: codacy-security-scan: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status name: Codacy Security Scan runs-on: ubuntu-latest steps: - # Checkout the repository to the GitHub Actions runner - name: Checkout code uses: actions/checkout@main @@ -84,20 +64,15 @@ jobs: rm tools/hook_deps.sh rm tools/opt_types.sh - # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI uses: codacy/codacy-analysis-cli-action@master with: - # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository - # You can also omit the token and run the tools that support default configurations - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - verbose: true output: results.sarif format: sarif # Adjust severity of non-security issues gh-code-scanning-compat: true # Force 0 exit code to allow SARIF file generation - # This will handover control about PR rejection to the GitHub side + # This will hand over control about PR rejection to the GitHub side max-allowed-issues: 2147483647 # Upload the SARIF file generated in the previous step From d8d79745be5e130b567df4d814590b704ba7ac78 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 20:51:31 +0100 Subject: [PATCH 08/21] Codacy: Apply workaround for SARIF problem As seen in https://github.com/codacy/codacy-analysis-cli-action/issues/95 --- .github/workflows/codacy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 31aee649d32..eba4d3b5170 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -75,8 +75,12 @@ jobs: # This will hand over control about PR rejection to the GitHub side max-allowed-issues: 2147483647 + - name: Clean duplicates + run: + jq '.runs |= unique_by({tool, invocations, results})' codacy.sarif + # Upload the SARIF file generated in the previous step - name: Upload SARIF results file uses: github/codeql-action/upload-sarif@main with: - sarif_file: results.sarif + sarif_file: codacy.sarif From eb5713bf54be153016535c802cc77b5556cb6315 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 18:49:34 +0100 Subject: [PATCH 09/21] README.md: Add links to nightly builds --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b3fa78095f..a46c42ced42 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ Installation There are several ways to install ejabberd: - Source code: compile yourself, see [COMPILE](COMPILE.md) -- Installers from [ProcessOne Download][p1download] or [ejabberd GitHub Releases][releases] (run/deb/rpm for x64 and arm64) -- `ecs` container image available in [Docker Hub][hubecs] and [Github Packages][packagesecs], see [ecs README][docker-ecs-readme] (for x64) -- `ejabberd` container image available in [Github Packages][packages], see [CONTAINER](CONTAINER.md) (for x64 and arm64) +- Installers: [ProcessOne Download][p1download] and [GitHub Releases][releases] for releases, [GitHub Actions](https://github.com/processone/ejabberd/actions/workflows/installers.yml) for master branch (run/deb/rpm for x64 and arm64) +- `ecs` container image: [Docker Hub][hubecs] and [Github Packages][packagesecs], see [ecs README][docker-ecs-readme] (for x64) +- `ejabberd` container image: [Github Packages][packages] for releases and master branch, see [CONTAINER](CONTAINER.md) (for x64 and arm64) - Using your [Operating System package][osp] - Using the [Homebrew][homebrew] package manager @@ -71,6 +71,10 @@ or in your local machine as explained in [Localization][localization]. Documentation for developers is available in [ejabberd docs: Developers][docs-dev]. +There are nightly builds of ejabberd, both for `master` branch and for Pull Requests: +- Installers: go to [GitHub Actions: Installers](https://github.com/processone/ejabberd/actions/workflows/installers.yml), open the most recent commit, on the bottom of that commit page, download the `ejabberd-packages.zip` artifact. +- `ejabberd` container image: go to [ejabberd Github Packages][packages] + Security reports or concerns should preferably be reported privately, please send an email to the address: contact at process-one dot net or some other method from [ProcessOne Contact][p1contact]. @@ -123,3 +127,4 @@ and [ejabberd translations](https://github.com/processone/ejabberd-po/) under MI [xeps]: https://www.process-one.net/en/ejabberd/protocols/ [xmpp]: https://xmpp.org/ [xmppej]: https://xmpp.org/software/servers/ejabberd/ + From ddae102a20708850bb436ecf00c11cdae6373d8c Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 13:26:47 +0100 Subject: [PATCH 10/21] ejabberdctl: Fix crash running defined commands in container and installers --- src/ejabberd_ctl.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 61731f65cf9..783b290ed9e 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -898,7 +898,7 @@ print_usage_command2(Cmd, C, MaxC, ShCode) -> IsDefinerMod = case Definer of unknown -> true; - _ -> lists:member(gen_mod, proplists:get_value(behaviour, Definer:module_info(attributes))) + _ -> lists:member([gen_mod], proplists:get_all_values(behaviour, Definer:module_info(attributes))) end, ModuleFmt = case IsDefinerMod of true -> [" ",?B("Module"),": ", atom_to_list(Definer), "\n\n"]; From e69b2f8f44228dcc346e134f25bf7c3436f0fbfd Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 8 Feb 2024 13:56:33 +0100 Subject: [PATCH 11/21] ejabberdctl: Fix problem when running ejabberdctl in container --- .github/container/ejabberdctl.template | 9 ++++++--- ejabberdctl.template | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 6098b7edbbd..84eafcb5c7a 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -228,7 +228,9 @@ help() # dynamic node name helper uid() { - if erl -noinput -boot start_clean -eval 'case erlang:system_info(otp_release) >= "23" of true -> halt(1); _ -> halt(0) end.' ; then + ERTSVERSION="$("$ERL" -version 2>&1 | sed 's|.*\([0-9][0-9]\).*|\1|g')" + if [ $ERTSVERSION -lt 11 ] ; then # otp 23.0 includes erts 11.0 + # Erlang/OTP lower than 23, which doesn's support dynamic node code N=1 PF=$(( $$ % 97 )) while @@ -241,11 +243,12 @@ uid() { ;; esac N=$(( N + 1 + ( $$ % 5 ) )) - epmd -names 2>/dev/null | grep -q " ${NN%@*} " + "$EPMD" -names 2>/dev/null | grep -q " ${NN%@*} " do :; done echo $NN else - # for R23+ use native dynamic node code + # Erlang/OTP 23 or higher: use native dynamic node code + # https://www.erlang.org/patches/otp-23.0#OTP-13812 echo undefined fi } diff --git a/ejabberdctl.template b/ejabberdctl.template index 80fcab41b4c..f558e93b2fa 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -249,7 +249,9 @@ help() # dynamic node name helper uid() { - if erl -noinput -boot start_clean -eval 'case erlang:system_info(otp_release) >= "23" of true -> halt(1); _ -> halt(0) end.' ; then + ERTSVERSION="$("$ERL" -version 2>&1 | sed 's|.*\([0-9][0-9]\).*|\1|g')" + if [ $ERTSVERSION -lt 11 ] ; then # otp 23.0 includes erts 11.0 + # Erlang/OTP lower than 23, which doesn's support dynamic node code N=1 PF=$(( $$ % 97 )) while @@ -262,11 +264,12 @@ uid() { ;; esac N=$(( N + 1 + ( $$ % 5 ) )) - epmd -names 2>/dev/null | grep -q " ${NN%@*} " + "$EPMD" -names 2>/dev/null | grep -q " ${NN%@*} " do :; done echo $NN else - # for R23+ use native dynamic node code + # Erlang/OTP 23 or higher: use native dynamic node code + # https://www.erlang.org/patches/otp-23.0#OTP-13812 echo undefined fi } From a6ccd0950cc5232e5792a817c1096413e38bb255 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Feb 2024 19:06:20 +0100 Subject: [PATCH 12/21] make-binaries: Bump OpenSSL 3.2.1, Erlang/OTP 26.2.2, Elixir 1.16.1 The update of OpenSSL follows: https://github.com/processone/eturnal/commit/eae4ab473de7042daf28d538bbc9be2bfbbda12a https://github.com/processone/eturnal/commit/39823a8009f97e309d4144ef66761f11263481f1 https://github.com/processone/eturnal/commit/92e9a41888f1a3008ed7b89a263c84e5e3381082 --- tools/make-binaries | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/make-binaries b/tools/make-binaries index 30165290c59..c32771d2867 100755 --- a/tools/make-binaries +++ b/tools/make-binaries @@ -70,9 +70,9 @@ termcap_vsn='1.3.1' expat_vsn='2.5.0' zlib_vsn='1.3' yaml_vsn='0.2.5' -ssl_vsn='1.1.1w' -otp_vsn='26.1.1' -elixir_vsn='1.15.6' +ssl_vsn='3.2.1' +otp_vsn='26.2.2' +elixir_vsn='1.16.1' pam_vsn='1.5.2' png_vsn='1.6.40' jpeg_vsn='9e' @@ -180,7 +180,7 @@ check_configured_dep_vsns() { check_vsn 'OpenSSL' "$ssl_vsn" \ 'https://www.openssl.org/source/' \ - 'openssl-\(1\.[0-9][0-9a-z.]*\)\.tar\.gz' + 'openssl-\(3\.[1-9]\.[0-9.]*\)\.tar\.gz' check_vsn 'LibYAML' "$yaml_vsn" \ 'https://pyyaml.org/wiki/LibYAML' \ 'yaml-\([0-9][0-9.]*\)\.tar\.gz' @@ -578,9 +578,11 @@ build_deps() info "Building OpenSSL $ssl_vsn for $arch-$libc ..." cd "$target_src_dir/$ssl_dir" - CFLAGS="$CFLAGS -O3 -fPIC" ./Configure no-shared no-ui-console \ + CFLAGS="$CFLAGS -O3 -fPIC" \ + ./Configure no-shared no-module no-ui-console \ --prefix="$prefix" \ --openssldir="$prefix" \ + --libdir='lib' \ "linux-${target%-linux-*}" make build_libs make install_dev From 78e7a05d86554de33c86382746ff3abb931961ba Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 12:56:24 +0100 Subject: [PATCH 13/21] Container: Update to Erlang/OTP 26.2, Elixir 1.16.1 and Alpine 3.19 --- .github/container/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/container/Dockerfile b/.github/container/Dockerfile index 94a9422f2ac..24029d2b66c 100644 --- a/.github/container/Dockerfile +++ b/.github/container/Dockerfile @@ -1,9 +1,9 @@ #' Define default build variables ## specifc ARGs for METHOD='direct' -ARG OTP_VSN='25.3' -ARG ELIXIR_VSN='1.14.4' +ARG OTP_VSN='26.2' +ARG ELIXIR_VSN='1.16.1' ## specifc ARGs for METHOD='package' -ARG ALPINE_VSN='3.17' +ARG ALPINE_VSN='3.19' ## general ARGs ARG UID='9000' ARG USER='ejabberd' From 9997d66c5fec013c6aec2addaadcdf5a2498ab44 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:00:27 +0100 Subject: [PATCH 14/21] Container: Apply commit 122af79 move spool dir to make it fully configurable per ejabberdctl.cfg (#3863) --- .github/container/ejabberdctl.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 84eafcb5c7a..3ece1c287a6 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -60,7 +60,6 @@ done # define ejabberd variables if not already defined from the command line : "${CONFIG_DIR:="{{config_dir}}"}" : "${LOGS_DIR:="{{logs_dir}}"}" -: "${SPOOL_DIR:="{{spool_dir}}"}" : "${EJABBERD_CONFIG_PATH:="$CONFIG_DIR/ejabberd.yml"}" : "${EJABBERDCTL_CONFIG_PATH:="$CONFIG_DIR/ejabberdctl.cfg"}" # Allows passing extra Erlang command-line arguments in vm.args file @@ -69,6 +68,7 @@ done [ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH" [ -n "$ERLANG_NODE_ARG" ] && ERLANG_NODE="$ERLANG_NODE_ARG" [ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] && S="-s" +: "${SPOOL_DIR:="{{spool_dir}}"}" : "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}" # define erl parameters From e350ff151bd921ad34e199142d16276dac54cdeb Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:06:18 +0100 Subject: [PATCH 15/21] Container: Apply commit 19e2e16 Let "ejabberdctl etop" work in a release (if observer is available) --- .github/container/ejabberdctl.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 3ece1c287a6..945488c06ec 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -366,10 +366,10 @@ case $1 in ;; etop) set_dist_client - exec_erl "$(uid top)" -hidden -node "$ERLANG_NODE" \ + exec_erl "$(uid top)" -hidden -remsh "$ERLANG_NODE" \ -eval 'net_kernel:connect_node('"'$ERLANG_NODE'"')' \ -s etop \ - -s erlang halt -output text + -output text ;; iexdebug) debugwarning From a3b7f3f7cf8bf753b010d445b74f0f038f7b3642 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:07:32 +0100 Subject: [PATCH 16/21] Container: Apply commit 841d5c0 and 81ceefe Fix startup problem when having set EJABBERD_OPTS and logger options Remove spurious line --- .github/container/ejabberdctl.template | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 945488c06ec..c8c1d1fb18a 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -90,11 +90,12 @@ ERL_CRASH_DUMP="$LOGS_DIR"/erl_crash_$(date "+%Y%m%d-%H%M%S").dump ERL_INETRC="$CONFIG_DIR"/inetrc # define ejabberd parameters -EJABBERD_OPTS="$EJABBERD_OPTS\ -$(sed '/^log_rotate_size/!d;s/:[ \t]*\([0-9]\{1,\}\).*/ \1/;s/:[ \t]*\(infinity\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ -$(sed '/^log_rotate_count/!d;s/:[ \t]*\([0-9]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ -$(sed '/^log_burst_limit_count/!d;s/:[ \t]*\([0-9]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ -$(sed '/^log_burst_limit_window_time/!d;s/:[ \t]*\([0-9]*[a-z]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")" +EJABBERD_OPTS="\ +$(sed '/^log_rotate_size/!d;s/:[ \t]*\([0-9]\{1,\}\).*/ \1/;s/:[ \t]*\(infinity\).*/ \1 /;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_rotate_count/!d;s/:[ \t]*\([0-9]*\).*/ \1 /;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_burst_limit_count/!d;s/:[ \t]*\([0-9]*\).*/ \1 /;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_burst_limit_window_time/!d;s/:[ \t]*\([0-9]*[a-z]*\).*/ \1 /;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$EJABBERD_OPTS" [ -n "$EJABBERD_OPTS" ] && EJABBERD_OPTS="-ejabberd $EJABBERD_OPTS" EJABBERD_OPTS="-mnesia dir \"$SPOOL_DIR\" $MNESIA_OPTIONS $EJABBERD_OPTS -s ejabberd" From 5dd0aa9cfe4e5f82a10cd41adb2fe8c46ea62e0d Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:09:10 +0100 Subject: [PATCH 17/21] Container: Apply commit e1f14ac Rebar3: Provide proper path to iex --- .github/container/ejabberdctl.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index c8c1d1fb18a..938f5d8f866 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -15,8 +15,8 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd -P)" # shellcheck disable=SC2034 ERTS_VSN="{{erts_vsn}}" ERL="{{erl}}" -IEX="{{bindir}}/iex" EPMD="{{epmd}}" +IEX="{{iexpath}}" COOKIE_FILE="$HOME"/.erlang.cookie [ -n "$ERLANG_COOKIE" ] && [ ! -f "$COOKIE_FILE" ] && echo "$ERLANG_COOKIE" > "$COOKIE_FILE" && chmod 400 "$COOKIE_FILE" From b4bb31b3e9707a9cc52c0b5681cae7024dea6424 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:10:08 +0100 Subject: [PATCH 18/21] Container: Apply commit abf0796 ejabberdctl: Detect problem running etop and show some help --- .github/container/ejabberdctl.template | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 938f5d8f866..7a56ae96ecb 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -200,6 +200,21 @@ livewarning() fi } +check_etop_result() +{ + result=$? + if [ $result -eq 1 ] ; then + echo "" + echo "It seems there was some problem running 'ejabberdctl etop'." + echo "Is the error message something like this?" + echo " Failed to load module 'etop' because it cannot be found..." + echo "Then probably ejabberd was compiled with development tools disabled." + echo "To use 'etop', recompile ejabberd with: ./configure --enable-tools" + echo "" + exit $result + fi +} + help() { echo "" @@ -371,6 +386,7 @@ case $1 in -eval 'net_kernel:connect_node('"'$ERLANG_NODE'"')' \ -s etop \ -output text + check_etop_result ;; iexdebug) debugwarning From 6002a4107405fb36dc1d330b096d3ad66fd92eee Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 9 Feb 2024 11:10:48 +0100 Subject: [PATCH 19/21] Container: Apply commit 35b727a ejabberdctl: Detect problem running iex and show explanation --- .github/container/ejabberdctl.template | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/container/ejabberdctl.template b/.github/container/ejabberdctl.template index 7a56ae96ecb..22e4177b134 100755 --- a/.github/container/ejabberdctl.template +++ b/.github/container/ejabberdctl.template @@ -215,6 +215,24 @@ check_etop_result() fi } +check_iex_result() +{ + result=$? + if [ $result -eq 127 ] ; then + echo "" + echo "It seems there was some problem finding 'iex' binary from Elixir." + echo "Probably ejabberd was compiled with Rebar3 and Elixir disabled, like:" + echo " ./configure" + echo "which is equivalent to:" + echo " ./configure --with-rebar=rebar3 --disable-elixir" + echo "To use 'iex', recompile ejabberd enabling Elixir or using Mix:" + echo " ./configure --enable-elixir" + echo " ./configure --with-rebar=mix" + echo "" + exit $result + fi +} + help() { echo "" @@ -392,10 +410,12 @@ case $1 in debugwarning set_dist_client exec_iex "$(uid debug)" --remsh "$ERLANG_NODE" + check_iex_result ;; iexlive) livewarning exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS" + check_iex_result ;; ping) PEER=${2:-$ERLANG_NODE} From 89fafb0ccf866dbb7158e327b6ab623793bf5d76 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 9 Jan 2024 16:08:57 +0100 Subject: [PATCH 20/21] Test: Check that the message we get is the welcome message, not other --- test/ejabberd_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ejabberd_SUITE.erl b/test/ejabberd_SUITE.erl index 1e2fb3c378b..d2394083ca6 100644 --- a/test/ejabberd_SUITE.erl +++ b/test/ejabberd_SUITE.erl @@ -897,7 +897,8 @@ presence_broadcast(Config) -> IQ = #iq{type = get, from = JID, sub_els = [#disco_info{node = Node}]} = recv_iq(Config), - #message{type = normal} = recv_message(Config), + #message{type = normal, + subject = [#text{lang = <<"en">>,data = <<"Welcome!">>}]} = recv_message(Config), #presence{from = JID, to = JID} = recv_presence(Config), send(Config, #iq{type = result, id = IQ#iq.id, to = JID, sub_els = [Info]}), From b7527287c010f18f139328c27000de5a767025bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 06:33:42 +0000 Subject: [PATCH 21/21] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a04993d2a39..c86d7d15846 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -301,7 +301,7 @@ jobs: - name: Upload CT logs if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ejabberd-ct-logs-${{matrix.otp}} #