Compare commits

...

1986 Commits

Author SHA1 Message Date
Pawel Chmielowski 27b87d4a8a Add SECURITY.md in hex docs
Container / build (amd64, <nil>) (push) Failing after 45s
Installers / binaries (amd64, <nil>) (push) Failing after 1m48s
CI / compile (28) (push) Has been cancelled
Container / build (arm64, -arm) (push) Has been cancelled
Installers / binaries (arm64, -arm) (push) Has been cancelled
Runtime / rebars (25, rebar) (push) Has been cancelled
Runtime / rebars (25, rebar3) (push) Has been cancelled
Runtime / rebars (26, rebar) (push) Has been cancelled
Runtime / rebars (26, rebar3) (push) Has been cancelled
Runtime / rebars (27, rebar3) (push) Has been cancelled
Runtime / rebars (28, rebar3) (push) Has been cancelled
Runtime / rebars (29, rebar3) (push) Has been cancelled
Runtime / rebar3-elixir (1.14) (push) Has been cancelled
Runtime / rebar3-elixir (1.18) (push) Has been cancelled
Runtime / rebar3-elixir (1.19) (push) Has been cancelled
Runtime / mix (1.14) (push) Has been cancelled
Runtime / mix (1.18) (push) Has been cancelled
Runtime / mix (1.19) (push) Has been cancelled
CI / static (28) (push) Has been cancelled
CI / dynamic (28) (push) Has been cancelled
CI / ct (agnostic, 28, multi) (push) Has been cancelled
CI / ct (extauth, 28, multi) (push) Has been cancelled
CI / ct (ldap, 28, multi) (push) Has been cancelled
CI / ct (mnesia, 28, multi) (push) Has been cancelled
CI / ct (mysql, 28, multi) (push) Has been cancelled
CI / ct (mysql, 28, single) (push) Has been cancelled
CI / ct (pgsql, 28, multi) (push) Has been cancelled
CI / ct (pgsql, 28, single) (push) Has been cancelled
CI / ct (redis, 28, multi) (push) Has been cancelled
CI / ct (sqlite, 28, multi) (push) Has been cancelled
CI / ct (sqlite, 28, single) (push) Has been cancelled
CI / cover (push) Has been cancelled
CI / schema (28) (push) Has been cancelled
Container / merge (push) Has been cancelled
Installers / Release (push) Has been cancelled
2026-03-25 16:42:17 +01:00
Badlop 6e90f5e681 Set version to 26.03
Container / build (amd64, <nil>) (push) Failing after 41s
Installers / binaries (amd64, <nil>) (push) Failing after 27s
CI / compile (28) (push) Has been cancelled
Container / build (arm64, -arm) (push) Has been cancelled
Installers / binaries (arm64, -arm) (push) Has been cancelled
Runtime / rebars (25, rebar) (push) Has been cancelled
Runtime / rebars (25, rebar3) (push) Has been cancelled
Runtime / rebars (26, rebar) (push) Has been cancelled
Runtime / rebars (26, rebar3) (push) Has been cancelled
Runtime / rebars (27, rebar3) (push) Has been cancelled
Runtime / rebars (28, rebar3) (push) Has been cancelled
Runtime / rebars (29, rebar3) (push) Has been cancelled
Runtime / rebar3-elixir (1.14) (push) Has been cancelled
Runtime / rebar3-elixir (1.18) (push) Has been cancelled
Runtime / rebar3-elixir (1.19) (push) Has been cancelled
Runtime / mix (1.14) (push) Has been cancelled
Runtime / mix (1.18) (push) Has been cancelled
Runtime / mix (1.19) (push) Has been cancelled
CI / static (28) (push) Has been cancelled
CI / dynamic (28) (push) Has been cancelled
CI / ct (agnostic, 28, multi) (push) Has been cancelled
CI / ct (extauth, 28, multi) (push) Has been cancelled
CI / ct (ldap, 28, multi) (push) Has been cancelled
CI / ct (mnesia, 28, multi) (push) Has been cancelled
CI / ct (mysql, 28, multi) (push) Has been cancelled
CI / ct (mysql, 28, single) (push) Has been cancelled
CI / ct (pgsql, 28, multi) (push) Has been cancelled
CI / ct (pgsql, 28, single) (push) Has been cancelled
CI / ct (redis, 28, multi) (push) Has been cancelled
CI / ct (sqlite, 28, multi) (push) Has been cancelled
CI / ct (sqlite, 28, single) (push) Has been cancelled
CI / cover (push) Has been cancelled
CI / schema (28) (push) Has been cancelled
Container / merge (push) Has been cancelled
Installers / Release (push) Has been cancelled
2026-03-25 15:37:09 +01:00
Badlop 9a82a28c8d CHANGELOG.md: Update to 26.03 2026-03-25 15:37:09 +01:00
Badlop c44c259180 Update man page to 26.03 2026-03-25 15:29:47 +01:00
Pawel Chmielowski 13c89279a2 Include ezlib in included_applications 2026-03-25 13:27:17 +01:00
Pawel Chmielowski fcf685a4dc Use tagged deps 2026-03-25 12:22:22 +01:00
Badlop 07580e6787 mod_mam: Allow backend modules to add fulltext namespace in Service Discovery 2026-03-25 02:10:37 +01:00
Pawel Chmielowski 6ce687262e Bump idna to 7.1 as used in xmpp 2026-03-24 16:40:50 +01:00
Pawel Chmielowski 2c8156dcd0 Update xmpp with fixes for dialyzer 2026-03-24 16:26:15 +01:00
Pawel Chmielowski bb8d65b68a Improve handling of c=y flag during sasl scram authentication
With this change we will no longer abort connection if all -PLUS
methods are disabled by administrator using `disable_sasl_mechanisms`.

Additionally when using SASL2 authentication we will also allow
connections to continue, if filtering methods based on stored
user passwords, removed all offered -PLUS mechanisms.
2026-03-24 14:47:21 +01:00
Badlop c43b15b3cd make-binaries: Bump libexpat 2.7.5 2026-03-23 16:01:03 +01:00
Badlop acc6beb3f3 Result of running "make format options" 2026-03-23 15:59:50 +01:00
Badlop bf2692a710 Annotate improvements in new version 2026-03-23 15:59:49 +01:00
Badlop 42e5a443ed Update Chinese Simplified translation (thanks to Sketch6580) 2026-03-23 15:59:48 +01:00
Badlop c5221f9350 Update German translation (thanks to Stefan Strigler) 2026-03-23 15:59:47 +01:00
Badlop 16739180f5 Update Bulgarian translation (thanks to Mr. EddX) 2026-03-23 15:59:45 +01:00
Pawel Chmielowski 181465ea3e Fix dialyzer warning 2026-03-20 17:43:00 +01:00
Pawel Chmielowski 23a32cae1a Add handling of Etag and If-Modified-Since headers to files served by mod_http_upload 2026-03-20 17:01:07 +01:00
badlop b2e2bd7ca8 Merge pull request #4547 from sstrigler/invites-broken-paths
fix mod_invites broken paths
2026-03-19 10:33:55 +01:00
Badlop efdc90b7b8 Bump Erlang/OTP 28.4.1 2026-03-16 19:23:34 +01:00
Badlop 010a6901b3 mod_invites: Fix minor typos in documentation 2026-03-16 19:23:19 +01:00
Badlop 8fb6257388 Fix warning about unused variable 2026-03-16 19:23:14 +01:00
Pawel Chmielowski 2832c4f513 Don't use gen_server:call for resolving pubsub host in mod_pubsub_serverinfo
Because each disco query do call this, this can be a bottleneck,
we can now get this value straight from options.
2026-03-16 19:08:19 +01:00
Pawel Chmielowski 6022105f39 Add ability for mod_options values to depend on other options 2026-03-16 18:56:15 +01:00
Pawel Chmielowski 3a78d6cf2a Fix test on mnesia 2026-03-16 15:29:36 +01:00
Pawel Chmielowski 975dcc1128 Start with tests for sasl2 2026-03-16 15:10:44 +01:00
Pawel Chmielowski 00e61dd816 Make mod_fast_auth filter offered methods, based on available channel bindings
This is a fix for issue #4549
2026-03-16 15:10:31 +01:00
Pawel Chmielowski c0134fe820 Ignore whitespaces at end of host header 2026-03-13 14:50:42 +01:00
Pawel Chmielowski ab59302204 Revert "Use global value for default_version as failback in mod_http_api if host is not recognized"
This fail tests.
This reverts commit 89b11829ce.
2026-03-13 14:48:57 +01:00
Pawel Chmielowski 89b11829ce Use global value for default_version as failback in mod_http_api if host is not recognized 2026-03-13 14:39:55 +01:00
Holger Weiss 267d8ca124 Don't fail to classify stand-alone chat states
Ignore XEP-0359 elements when checking whether a stanza has non-XEP-0085
content.  This allows mod_client_state to filter chat states with an
<origin-id/> element.
2026-03-12 19:12:23 +01:00
Stefan Strigler 427f68daa6 fix(mod_invites): broken path when behind proxy with prefix 2026-03-12 14:34:56 +01:00
Stefan Strigler b15bae267d fix path to bootstrap files 2026-03-12 13:47:52 +01:00
Pawel Chmielowski 6bbed5854a Fix duplicate stanza-id in muc mam responses generated from local history
This fixes issue #4544
2026-03-11 13:03:53 +01:00
Pawel Chmielowski 15661f16c4 Always hide password in mod_http_api log entries 2026-03-10 11:41:06 +01:00
Pawel Chmielowski 54b30cf0c4 Improve transformation code in mod_roster_mnesia 2026-03-10 11:39:29 +01:00
Badlop b7940ba360 Workflows: Don't use jsdelivr mirror: not up-to-date, unnecessary and problematic
* Not up-to-date

jsdelivr takes some days or weeks to get latest erlang versions, compare
  https://builds.hex.pm/builds/otp/arm64/ubuntu-24.04/builds.txt
  https://cdn.jsdelivr.net/hex/builds/otp/arm64/ubuntu-24.04/builds.txt

* Unnecessary

As builds.hex.pm is already geodistributed, there's no need to add mirror
Reference: https://www.hex.pm/docs/mirrors

* Problematic in parallel jobs

The ci.yml workflow is split in separate jobs that run in parallel,
and all of them must use the exact same erlang version.
When using mirrors, different erlang versions may be used...
and then the compiled files require more recompilation, which fail
  ===> Compiling /home/runner/work/ejabberd/ejabberd/c_src/epam.c
  ===> /home/runner/work/ejabberd/ejabberd/c_src/epam.c:18:10: fatal error: security/pam_appl.h: No such file or directory
   18 | #include <security/pam_appl.h>
      |          ^~~~~~~~~~~~~~~~~~~~~

Instead of removing mirrors, an alternative solution would be
to specify exact OTP version: "28.3.2", but then we would need to update
all those strings in ci.yml for every erlang release.
2026-03-10 02:07:41 +01:00
Badlop ee2fd8446a Update Catalan and Spanish translations 2026-03-09 19:26:00 +01:00
Badlop b41a8b0925 Update Czech translation (thanks to hollymrklm) 2026-03-09 19:26:00 +01:00
Badlop 8603cd85db manage-ejabberd: Compile with test profile to get all required deps 2026-03-09 19:25:22 +01:00
Badlop 3a2d1bd12b Makefile: Run invites-deps only when files are missing 2026-03-09 19:24:53 +01:00
Badlop a04ed90e25 Rename target test-eunit to avoid name pattern test-GROUP
Example:
$ make test-eunit
Makefile:696: warning: overriding recipe for target 'test-eunit'
Makefile:692: warning: ignoring old recipe for target 'test-eunit'
...
2026-03-09 19:20:41 +01:00
Holger Weiss 383b498fbb Merge remote-tracking branch 'processone/pr/4542'
* processone/pr/4542:
  make-binaries: Enable missing crypto features
2026-03-09 17:19:34 +01:00
Pawel Chmielowski af3987fc0a Update one more place where store_mam_message hook is triggered 2026-03-09 14:57:28 +01:00
Pawel Chmielowski 9fd1ed34ee Call store_mam_message hook for messages that user_mucsub_from_muc_archive was filtering out
Just adjust mod_mam callback for it to not store them.

This callback is used by mod_push for triggering push, and previous
behaviour did disable pushes for muc messages with that option
enabled.
2026-03-09 14:05:19 +01:00
Holger Weiss a9ae72ba9f make-binaries: Download unixODBC from GitHub
The unixODBC web site (unixodbc.org) seems to be unreachable.
2026-03-07 21:38:22 +01:00
badlop aa704c0d75 Merge pull request #4540 from sstrigler/overuse_limit
fix: set overuse limits
2026-03-06 19:00:24 +01:00
Badlop bc48fa4c55 CONTRIBUTORS: Add Stefan Strigler 2026-03-06 18:19:26 +01:00
Badlop 2251cb7547 container.yml: Disable the container cleanup action; it's dry anyway 2026-03-06 18:19:23 +01:00
badlop 15b51d7a7b Merge pull request #4539 from sstrigler/security_fixes
Even more security fixes (and other minor things)
2026-03-06 17:23:12 +01:00
Stefan Strigler 5721f77d5a fix: set overuse limits
This is an effort to detect abuse where accounts get created to create more
invites (invite chaining) and so on.
2026-03-06 17:11:09 +01:00
Badlop fa32fecd97 Update French translation (thanks to Dyxux) 2026-03-06 15:58:37 +01:00
Badlop e291d84cf8 Update German translation (thanks to Stefan Strigler) 2026-03-06 15:57:20 +01:00
Badlop 934fdcdc5d Update Bulgarian translation (thanks to Mr. EddX) 2026-03-06 15:56:51 +01:00
Stefan Strigler eba6868a3f styling improvements 2026-03-06 15:18:25 +01:00
Stefan Strigler 5bb989d998 invites: bring yaxim back 2026-03-06 15:18:25 +01:00
Stefan Strigler e9645ffec0 improv(invites): add favicon and change color to match ejabberd branding 2026-03-06 15:18:25 +01:00
Stefan Strigler 179c5c4cbb feat(invites: enable dark mode 2026-03-06 15:18:25 +01:00
Stefan Strigler f210803202 fix(invites): no inline scripts 2026-03-06 15:18:25 +01:00
Stefan Strigler 793855ad91 fix(invites): make format csrf token 2026-03-06 15:18:25 +01:00
Stefan Strigler 1a423743af feat(invites): add support for webchat_url 2026-03-06 15:18:25 +01:00
Stefan Strigler b8f20fb663 fix(invites): add csrf token to failed post 2026-03-06 15:18:25 +01:00
Stefan Strigler 7b4338e7df invites: update jquery 2026-03-06 15:18:25 +01:00
Stefan Strigler e6b1e55705 invites: migrate to bootstrap5 2026-03-06 15:18:25 +01:00
Stefan Strigler eb784b4026 fix(invites): include js/css deps in static dir 2026-03-06 15:18:25 +01:00
Stefan Strigler 07d363ed0c fix(invites): correct hashes for bootstrap 4.6.2 2026-03-06 15:18:25 +01:00
Stefan Strigler 8a7cf45d0b fix(invites): hint at type for landing_page opt 2026-03-06 15:18:25 +01:00
Badlop d93ece6540 Result of running "make format" 2026-03-06 13:48:21 +01:00
Badlop 2a65a5001d Bump Erlang/OTP 28.4 2026-03-06 13:47:50 +01:00
Badlop 1ffcd1ce6e ejabberd_ctl: Document how to set empty lists in ejabberdctl and WebAdmin 2026-03-06 13:47:48 +01:00
Badlop d5c14406db mod_roster: Fix display of groups in WebAdmin when it's a list 2026-03-06 13:47:46 +01:00
Badlop 67b87ac892 mod_roster: in WebAdmin page, first execute SET actions, later GET 2026-03-06 13:47:44 +01:00
Holger Weiss a44f865432 make-binaries: Enable missing crypto features
With OTP's --enable-static-nifs, libcrypto features detected by
configure aren't propagated to the static NIF build flags.  Work
around this issue by patching OTP's Makefile until the following
PR is merged:

https://github.com/erlang/otp/pull/10817
2026-03-02 22:44:10 +01:00
Pawel Chmielowski a4ff3f3a65 Make table cleanup in test more robust 2026-02-27 11:31:59 +01:00
Pawel Chmielowski ca56f11dc6 Add abilty to mark that column can be null in e_sql_schema 2026-02-27 09:47:40 +01:00
badlop 1695385912 Merge pull request #4538 from sstrigler/security_fixes
Security fixes
2026-02-26 17:16:40 +01:00
Stefan Strigler b9e3841186 fix: check CSRF token in register form 2026-02-26 16:22:57 +01:00
Stefan Strigler 0680f6ac5e fix: add integrity hashes to scripts and css 2026-02-26 15:18:02 +01:00
Stefan Strigler ff15018b24 fix: comment unused resources 2026-02-26 15:18:02 +01:00
Stefan Strigler 635054007d fix: add security headers 2026-02-26 15:18:02 +01:00
Stefan Strigler f1527ba21e fix: remove debug log of whole query parameters (including pw) 2026-02-26 15:18:02 +01:00
Stefan Strigler 3b1a8a6c00 fix: don't crash on unknown host from http host header 2026-02-26 15:18:02 +01:00
Stefan Strigler c862f58c78 fix: make creating invite transactional 2026-02-26 15:18:02 +01:00
Badlop 6e938dcc84 CI and Weekly: If sending to coveralls fails, continue anyway 2026-02-26 13:49:55 +01:00
Badlop ecb88d9ebc Result of running "make format options" 2026-02-24 16:34:39 +01:00
Badlop b7464e19ff mod_roster_mnesia: Fix compilation warning in recent commit 2026-02-24 16:31:35 +01:00
badlop 1bcd52300f Merge pull request #4512 from sstrigler/roster-pre-approval
Roster Subscription Pre-Approval
2026-02-24 16:00:42 +01:00
Badlop 0c55beff6e Runtime and Weekly: Add Erlang/OTP 29 2026-02-24 15:47:46 +01:00
Badlop 3adb30c859 Bump Erlang/OTP 28.3.2 2026-02-24 15:46:35 +01:00
Badlop 5378d177e2 Revert "rebar.config: Bump rebar3_lint to 4.2.2, used for Elvis"
This breaks compiling ejabberd with Erlang/OTP 29 in many libraries,
for example:
    ┌─ _build/default/lib/eredis/src/eredis.erl:
    │
 10 │  -include("eredis.hrl").
    │           ╰── can't find include file "eredis.hrl"

Compiling with Erlang 28 or older works,
but Elvis fails as it includes many new tests that are not passed.

This reverts commit 5b89ee0fe8.
2026-02-24 15:46:31 +01:00
Badlop 160cd976b4 mod_mam_sql: Only provide the new XEP-0431 fulltext field, not old custom withtext 2026-02-23 16:39:46 +01:00
Badlop 95d8f6c531 mod_muc_room: Fix hook name in commit 7732984 (thanks to trixnz)(#4526) 2026-02-23 16:39:44 +01:00
Badlop cdcf3ef1b9 mod_invites: Check at start time the syntax of landing_page option (#4525) 2026-02-23 16:39:42 +01:00
Badlop afd49b9847 make-binaries: Bump zlib to 1.3.2 2026-02-23 16:39:40 +01:00
Badlop 5b89ee0fe8 rebar.config: Bump rebar3_lint to 4.2.2, used for Elvis 2026-02-23 16:39:38 +01:00
Badlop 4ce63d9a6c rebar.config: Remove nowarn_deprecated_function, seems useless nowadays 2026-02-23 16:39:33 +01:00
Pawel Chmielowski 29ac776a98 Update p1_pgsql once more 2026-02-20 11:25:01 +01:00
Pawel Chmielowski 8cf9a0b79b Update p1_pgsql 2026-02-20 11:12:35 +01:00
badlop d0d9b2f968 Merge pull request #4535 from sstrigler/no_redirect-url_if_preauth
set meta.pre-auth to skip redirect_url if token validated
2026-02-19 21:52:04 +01:00
Stefan Strigler 785412be5c fix: set meta.pre-auth to skip redirect_url if token validated
otherwise if redirect_url for mod_register is set, then we can't register even
if a valid invite token has been presented
2026-02-19 09:02:55 +01:00
badlop 3b05cb0700 Merge pull request #4531 from sstrigler/mod_invites_http_set_link_header
imprv: send 'Link' http header
2026-02-17 13:15:36 +01:00
Stefan Strigler 1fc1626d3f imprv: send 'Link' http header
Conversations' QR code scanner does a HEAD request on embedded http links and
extracts and interprets any XMPP URI if found. This way skipping the step of
having the user handle the landing page.
2026-02-17 13:02:14 +01:00
Badlop 56f47dbec7 rebar.config: Add temporary workarounds for Erlang/OTP 29 warnings (#4527) 2026-02-17 12:42:18 +01:00
Badlop 05cd172b77 Use also *.lock files to determine dependencies cache key
The cache key must change too when a dependency is updated
only in the lock file.
2026-02-17 12:42:13 +01:00
Badlop 0876662a20 rebar.lock: Update also rebar.lock 2026-02-17 12:42:11 +01:00
Badlop 9402dbb16f CI: Don't finish a parallel build in converalls in case of error
Because we may want to re-run the job in Github Actions, and coveralls
would then refuse new cover submits as the build is already closed.
2026-02-17 12:42:10 +01:00
Badlop 99f9443ec8 Fix some warnings compiling with Erlang/OTP 29 (#4527) 2026-02-17 12:42:08 +01:00
Badlop 84f698c489 Runtime: Remove obsolete step for Erlang lower than 25 2026-02-17 12:42:07 +01:00
Badlop 274a5dfbc8 Weekly: Clean useless newline 2026-02-17 12:42:05 +01:00
Badlop 641aa88bbc CI: Test with Erlang 28, the one included in installers and container 2026-02-17 12:42:03 +01:00
Badlop 029aa67ccf Fix URL in documentation to work correctly with "make archive" 2026-02-17 12:42:01 +01:00
Pawel Chmielowski 120973074a Update p1_mysql 2026-02-16 17:29:52 +01:00
Badlop 8138b48cad Set version to 26.02
Container / build (amd64, <nil>) (push) Failing after 45s
Installers / binaries (amd64, <nil>) (push) Failing after 38s
CI / compile (27) (push) Has been cancelled
Container / build (arm64, -arm) (push) Has been cancelled
Installers / binaries (arm64, -arm) (push) Has been cancelled
Runtime / rebars (25, rebar) (push) Has been cancelled
Runtime / rebars (25, rebar3) (push) Has been cancelled
Runtime / rebars (26, rebar) (push) Has been cancelled
Runtime / rebars (26, rebar3) (push) Has been cancelled
Runtime / rebars (27, rebar3) (push) Has been cancelled
Runtime / rebars (28, rebar3) (push) Has been cancelled
Runtime / rebar3-elixir (1.14) (push) Has been cancelled
Runtime / rebar3-elixir (1.18) (push) Has been cancelled
Runtime / rebar3-elixir (1.19) (push) Has been cancelled
Runtime / mix (1.14) (push) Has been cancelled
Runtime / mix (1.18) (push) Has been cancelled
Runtime / mix (1.19) (push) Has been cancelled
CI / static (27) (push) Has been cancelled
CI / dynamic (27) (push) Has been cancelled
CI / ct (agnostic, 27, multi) (push) Has been cancelled
CI / ct (extauth, 27, multi) (push) Has been cancelled
CI / ct (ldap, 27, multi) (push) Has been cancelled
CI / ct (mnesia, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, single) (push) Has been cancelled
CI / ct (pgsql, 27, multi) (push) Has been cancelled
CI / ct (pgsql, 27, single) (push) Has been cancelled
CI / ct (redis, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, single) (push) Has been cancelled
CI / cover (push) Has been cancelled
CI / schema (27) (push) Has been cancelled
Container / merge (push) Has been cancelled
Installers / Release (push) Has been cancelled
2026-02-11 10:09:39 +01:00
Badlop 7de0afb613 CHANGELOG.md: Add links to issues 2026-02-11 10:08:11 +01:00
Badlop c407e87da3 CHANGELOG.md: Update to 26.02 2026-02-11 09:33:36 +01:00
Badlop 2681f3b5d8 Update man page to 26.02 2026-02-11 09:31:06 +01:00
Badlop f9a187c3aa Update Catalan and Spanish translations 2026-02-11 09:28:39 +01:00
Badlop 40fffe6cf4 Update Bulgarian translation (thanks to Mr. EddX) 2026-02-11 09:28:38 +01:00
Badlop 903943362e Update Chinese Simplified translation (thanks to Sketch6580) 2026-02-11 09:28:36 +01:00
Badlop e6120641f9 Update German translation (thanks to Stefan Strigler) 2026-02-11 09:28:34 +01:00
Badlop 43f0b811f5 New 'configure' input in manage-ejabberd to append in ./configure 2026-02-10 15:34:38 +01:00
Badlop bd61571ce5 Result of running "make format" 2026-02-10 15:34:34 +01:00
badlop e06bdd6b30 Merge pull request #4524 from sstrigler/invites_a11y_fixes
Invites a11y fixes
2026-02-10 15:28:10 +01:00
Stefan Strigler 75c66cba9c accessibility improvements 2026-02-10 15:06:45 +01:00
Badlop 531d17ddb9 mod_muc: Document all the protocols implemented 2026-02-10 11:12:09 +01:00
Badlop 1aa2e75a21 Update Catalan and Spanish translations 2026-02-10 11:12:07 +01:00
Badlop 416bee969f Update German translation (thanks to Stefan Strigler) 2026-02-10 11:12:06 +01:00
Badlop fa75800ee1 Update Czech translation (thanks to ffunk) 2026-02-10 11:12:04 +01:00
Badlop 5426358959 weekly.yml: Don't test mssql, as it fails
Right start fails with:

2026-02-09 11:48:05.211061+00:00 [warning]
 <0.26972.0>@ejabberd_sql:handle_reconnect/2:540
 mssql connection failed:
  ** Reason: {"01000",0,
              "[unixODBC][Driver Manager]Can't open lib 'libtdsodbc.so' :
               file not found Connection to database failed."}
2026-02-09 16:47:26 +01:00
Badlop 8e01c04e96 Use manage-ejabberd action in workflows to compile ejabberd 2026-02-09 16:47:25 +01:00
Badlop 809d9d2d0f gen_mod: Fix recent commit, deleting global hook when module in no more hosts 2026-02-09 16:47:23 +01:00
Badlop 7c2db2aebb mod_muc_mnesia: Fix bug introduced in 2b7285e when upgrading old database
If mod_muc uses Mnesia database,
and there is any room created using ejabberd older than 21.12,
and its room config was never modified using newer ejabberd versions...
in that case the room configuration does not contain hats_users.

When upgrading to ejabberd 25.10 or 26.01,
it tries to upgrade the MUC rooms configuration but fails with error:
  ejabberd_mnesia:transform_fun/2:382
  Failed to transform Mnesia table muc_room
2026-02-09 16:47:22 +01:00
Badlop 4f930cb94d mod_register_web: Document that enabling the module adds link to WebAdmin 2026-02-09 16:47:20 +01:00
Badlop 9a48088d84 Remove mod_muc_occupantid in example config: feature is now in mod_muc 2026-02-09 16:47:19 +01:00
Badlop 2e9b538c27 Ammend recent commit to fix warning, also run "make format" 2026-02-09 16:47:17 +01:00
Badlop 1a6d22615d make-binaries: Bump OpenSSL 3.5.5, Expat 2.7.4 2026-02-09 16:47:16 +01:00
Pawel Chmielowski 97fc89bc7f Fix dialyzer warning 2026-02-06 12:54:11 +01:00
Pawel Chmielowski fbc3349e04 Add odbc to dialyzer only if odbc is configured 2026-02-06 12:54:01 +01:00
Pawel Chmielowski 42122b7aa7 Prevent crash in mod_pubsub_serverinfo when parsing bad disco responses 2026-02-06 12:38:29 +01:00
Pawel Chmielowski ee05a863f7 Better handling of invalid percent encoded urls in ejabberd_http 2026-02-06 12:31:11 +01:00
Badlop 44fa357534 Result of running "make doap format options" 2026-02-06 00:52:46 +01:00
Badlop 354e4920b3 mod_invites: Handle 'auto' value as an atom in the 'landing_page' option 2026-02-06 00:28:06 +01:00
Badlop 9bfdb2b8d4 mod_conversejs: Report problem in WebAdmin autologin if WebSocket is disabled 2026-02-06 00:26:51 +01:00
Badlop e31fced208 mod_conversejs: Support in autologin for WebAdmin authentication with just username
WebAdmin supports to login by providing just the username, in that case
the HTTP Host is considered to be also the JID domain.
2026-02-06 00:26:49 +01:00
Badlop f65903a181 Mark changed options/commands with same emoji already used in CONTAINER.md 2026-02-06 00:26:47 +01:00
Paweł Chmielowski f21bd9b96e Merge pull request #4515 from sstrigler/mod_invites_fixes
Fixes for mod_invites
2026-02-05 14:08:06 +01:00
Pawel Chmielowski 0647a23ea7 Delete mnesia muc_occupant_id table 2026-02-05 13:57:22 +01:00
Pawel Chmielowski 9b5ea84ee5 Check in tests if room offer occupant-id feature 2026-02-05 13:56:56 +01:00
Pawel Chmielowski 7732984133 Move occupant_id storage and processing to mod_muc_room 2026-02-05 13:56:55 +01:00
Pawel Chmielowski 6f59b7e63d Fix dialyzer warning 2026-02-04 13:58:52 +01:00
Pawel Chmielowski 40d6ef6156 Use jid from mediated invitation instead of confernce jid in mod_block_strangers checks
For issue #4523
2026-02-04 13:00:54 +01:00
Badlop b5f8bc7c15 mod_muc_occupantid: When reloading config, clean obsolete salts (#4521) 2026-02-02 16:57:54 +01:00
Badlop 97e0530be1 mod_muc_occupantid: Fix Mnesia table creation (#4521) 2026-02-02 16:57:52 +01:00
Badlop 3ab3c71cf6 Don't delete global hook if stopping module that is alive in other host 2026-02-02 16:57:47 +01:00
Pawel Chmielowski 7bc96ee464 Add tests for muc hats 2026-01-30 12:24:41 +01:00
Stefan Strigler ca07b182c6 pretty print command errors 2026-01-30 11:34:04 +01:00
Stefan Strigler 3ffe6383b2 fix privacy tests 2026-01-30 10:36:38 +01:00
Stefan Strigler 47d898bb8b add support for roster pre-approval
Implementation of RFC 6121 section 3.4: Pre-Approving a Subscription Request
https://datatracker.ietf.org/doc/html/rfc6121#section-3.4
2026-01-30 10:36:38 +01:00
Pawel Chmielowski 3a5f7e6cfe Fix exception with adding hats info in presence
This should fix issue #4516
2026-01-30 09:49:16 +01:00
Stefan Strigler c8ba793851 fix type in docs for templates_dir 2026-01-30 08:18:24 +01:00
Stefan Strigler d0646e8009 traverse priv/mod_invites on install target
Fixes processone/ejabberd#4514
2026-01-30 08:18:24 +01:00
Stefan Strigler d89da2d3eb mentione dl script to get jquery and bootstrap 2026-01-30 08:18:24 +01:00
Stefan Strigler 99b54916f4 link to more specific places for jquery and bootstrap 2026-01-30 08:18:24 +01:00
Stefan Strigler d0437ab19a fix stale comma 2026-01-30 08:18:24 +01:00
Pawel Chmielowski 12910ed023 Define :TEST when using test MIX_ENV
This is needed for invites test
2026-01-26 13:40:55 +01:00
Pawel Chmielowski ae5356b2a6 Recognize -behavior attribute in opt_types script 2026-01-22 15:07:37 +01:00
Badlop f417b9f7c3 Amend previous commit: only Rebar2 needs this override
and that override, when using Rebar3,
breaks Dialyzer for mod_avatar and mod_http_upload
2026-01-21 23:05:38 +01:00
Badlop bd3c805e67 Use erlydtl 0.14.0 from hex.pm, or 0.15.0 from git
Rebar3 and Mix support hex.pm:
download its latest package 0.14.0

Rebar2 doesn't support hex.pm:
download 0.15.0 from git and delete its require_otp_vsn option.
2026-01-21 18:08:22 +01:00
Badlop 0375cea2ce Set version to 26.01
Container / build (amd64, <nil>) (push) Failing after 38s
Installers / binaries (amd64, <nil>) (push) Failing after 42s
CI / compile (27) (push) Has been cancelled
Container / build (arm64, -arm) (push) Has been cancelled
Installers / binaries (arm64, -arm) (push) Has been cancelled
Runtime / rebars (25, rebar) (push) Has been cancelled
Runtime / rebars (25, rebar3) (push) Has been cancelled
Runtime / rebars (26, rebar) (push) Has been cancelled
Runtime / rebars (26, rebar3) (push) Has been cancelled
Runtime / rebars (27, rebar3) (push) Has been cancelled
Runtime / rebars (28, rebar3) (push) Has been cancelled
Runtime / rebar3-elixir (1.14) (push) Has been cancelled
Runtime / rebar3-elixir (1.18) (push) Has been cancelled
Runtime / rebar3-elixir (1.19) (push) Has been cancelled
Runtime / mix (1.14) (push) Has been cancelled
Runtime / mix (1.18) (push) Has been cancelled
Runtime / mix (1.19) (push) Has been cancelled
CI / static (27) (push) Has been cancelled
CI / dynamic (27) (push) Has been cancelled
CI / ct (agnostic, 27, multi) (push) Has been cancelled
CI / ct (extauth, 27, multi) (push) Has been cancelled
CI / ct (ldap, 27, multi) (push) Has been cancelled
CI / ct (mnesia, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, single) (push) Has been cancelled
CI / ct (pgsql, 27, multi) (push) Has been cancelled
CI / ct (pgsql, 27, single) (push) Has been cancelled
CI / ct (redis, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, single) (push) Has been cancelled
CI / cover (push) Has been cancelled
CI / schema (27) (push) Has been cancelled
Container / merge (push) Has been cancelled
Installers / Release (push) Has been cancelled
2026-01-21 10:54:18 +01:00
Badlop 1d67918b8d CHANGELOG.md: Convert issues text to links 2026-01-21 10:54:18 +01:00
Badlop 3da3ced880 CHANGELOG.md: Update to 26.01 2026-01-21 10:26:04 +01:00
Badlop 85ca3cbd1b Update man page to 26.01 2026-01-21 10:07:16 +01:00
Badlop cef212145f mod_invites: Document that jQuery 3 and Bootstrap 4 are the supported versions 2026-01-21 10:00:36 +01:00
Badlop cf40d73f95 Dockerfile: Bump jQuery to 3.7.1, the latest supported 2026-01-21 10:00:33 +01:00
Badlop 7df7c7664d CONTAINER.md: Improve some explanations; update to 26.01 2026-01-20 20:51:49 +01:00
Badlop d0a91cc9de make-binaries: Don't strip attributes, they are needed by erlydtl 2026-01-20 20:51:49 +01:00
Badlop a7a11ef287 Dockerfile: Install JavaScript libraries for mod_invites using npm 2026-01-20 20:51:49 +01:00
Badlop db924b488c Revert "install mod_invites dependencies"
This reverts commit 41c8dbb135.
2026-01-20 20:51:01 +01:00
Pawel Chmielowski a213f6862d Remove extra logic for handling unsubscribed in mod_shared_roster
This breaks some state changes, and it's original purpose (removing
pending flag from roster item) works correctly without this it.
2026-01-20 18:07:42 +01:00
Badlop b70337513c Result of running "make format" 2026-01-20 12:16:19 +01:00
Badlop 0a0bb72501 Update version notes in modules, options and API commands 2026-01-20 12:16:19 +01:00
Badlop 5cbe7ebf54 Update other translations automatically 2026-01-20 12:16:19 +01:00
Badlop 9f165996b7 Update Spanish translation 2026-01-20 12:16:19 +01:00
Badlop 56589d491f Update Swedish translation (thanks to Stefan Strigler) 2026-01-20 12:16:19 +01:00
Badlop 35d082da8c Update German translation (thanks to Stefan Strigler) 2026-01-20 12:16:19 +01:00
Badlop 343f462ca5 Update German translation (thanks to poVoq and nautilusx) 2026-01-20 12:16:19 +01:00
Badlop 87a6ab7aee Update Chinese Simplified translation (thanks to Sketch6580) 2026-01-20 12:16:19 +01:00
Badlop 6e4a8ae015 Update French translation (thanks to Mickaël Rémond) 2026-01-20 12:16:19 +01:00
Badlop b2c7929d23 Update Bulgarian translation (thanks to Mr. EddX and Kiril Panayotov) 2026-01-20 12:16:19 +01:00
Badlop 956c0488c9 Update a few more copyright year 2026-01-20 12:16:19 +01:00
Badlop 5f0a26cf08 mod_invites: Mention implemented XEPs in the documentation 2026-01-20 12:16:19 +01:00
Badlop 5de8d8619f mod_invites: Update supported XEPs, then run "make doap" 2026-01-20 12:12:47 +01:00
badlop eb46646eb1 Merge pull request #4513 from sstrigler/fix-dl_invites_page_deps.sh
validate checksum for downloads
2026-01-20 12:00:12 +01:00
Stefan Strigler 6ce338e8e2 validate checksum for downloads
also use mktemp for temporary files
also use set -e to stop in case of error
2026-01-20 09:21:31 +01:00
Pawel Chmielowski 0bb0dcc6b1 Make mod_invites sql schema compatible with mysql<8 2026-01-19 20:29:17 +01:00
Badlop a315046af8 Result of running "make format" 2026-01-19 18:31:52 +01:00
Badlop 04946dbf74 mod_invites: Split paragraphs in shorter lines in source code
Also update some capitalization, punctuation, minor clarifications,
and try to differentiate "create account" and "create invitation".
2026-01-19 18:30:56 +01:00
Badlop bb900099a7 Update mix.lock and mix.lock 2026-01-19 18:30:53 +01:00
badlop 903c48f3a5 Merge pull request #4493 from sstrigler/great_invitations
Great invitations
2026-01-19 17:15:09 +01:00
Stefan Strigler 41c8dbb135 install mod_invites dependencies 2026-01-19 17:03:42 +01:00
Stefan Strigler 47b419dd98 add script to download landing page deps 2026-01-19 17:03:42 +01:00
Stefan Strigler 41e57f89c9 add js packages as recommended for debian packages 2026-01-19 17:03:42 +01:00
Stefan Strigler 480c6e0995 add support for 'great invitations' as mod_invites 2026-01-19 17:03:42 +01:00
Pawel Chmielowski ca364541e7 Properly parse presence_broadcast values passed to change_room_options command
This fixes issue #4510
2026-01-19 13:46:20 +01:00
Pawel Chmielowski b71fcfc82f Use tagged dependencies 2026-01-19 12:57:20 +01:00
Badlop 19a5edd63a mod_conversejs: Cosmetic change: sort paths alphabetically 2026-01-19 12:25:45 +01:00
Badlop 330d513fe8 Add new Conversejs Paths and ContentTypes (thanks to ieQu1)(#4511) 2026-01-19 12:25:43 +01:00
Badlop f07e16a597 mod_conversejs: Use ContentType functions from mod_http_fileserver (#4511) 2026-01-19 12:25:41 +01:00
Badlop 3c950fe65c mod_http_fileserver: Reduce system menu name, sort them alphabetically 2026-01-16 16:45:51 +01:00
Badlop a7aa52fc9f Bump Erlang/OTP 28.3.1 and Elixir 1.19.5 2026-01-16 16:45:49 +01:00
Badlop dd7f3033fc mod_http_upload: Pass ServerHost, not Host which may be "upload.HOST" 2026-01-15 20:25:46 +01:00
Badlop cc7e50782e mod_http_upload: Use content_type similarly to mod_http_fileserver (#4488) 2026-01-15 19:40:58 +01:00
Badlop 5fddf889e7 Use /websocket URL by default like mod_conversejs, it's more meaningful 2026-01-15 19:40:43 +01:00
Badlop bce68d52e7 Result of running "make format" 2026-01-15 19:40:38 +01:00
Pawel Chmielowski 2fac416520 Add replaced_connection_timeout option
This option enabled new session to wait for termination
of session that it replaces. This should mitigate
problems where old session presences unavailable sometimes
were delivered after new session sent it's presence available.
2026-01-15 17:04:03 +01:00
Pawel Chmielowski 1d2b0fc910 Fix whitespace warning 2026-01-14 13:52:13 +01:00
Pawel Chmielowski 8ac3661bcf Add db_serialize support in mnesia modules 2026-01-14 13:41:32 +01:00
Pawel Chmielowski bbcf0fa4f3 Fix whitespace warning 2026-01-13 10:26:20 +01:00
Pawel Chmielowski c531936f83 Add muc_online_rooms_count command 2026-01-13 10:07:09 +01:00
Badlop 6d74bef73b commands_tests: Better check for the disco item node instead of name 2026-01-12 18:21:02 +01:00
Badlop 96a1b16099 Fix specs reported by Dialyzer 2026-01-12 17:54:45 +01:00
Badlop 40d86edbc2 Amend recent commits: lists:append is preferable for 1-level deep lists
See
https://www.erlang.org/doc/system/listhandling.html#deep-and-flat-lists
2026-01-12 17:34:36 +01:00
Badlop be56e1305b mod_adhoc_api: Show nice command name, as WebAdmin already does 2026-01-12 17:34:18 +01:00
Badlop a76a9fa6e6 When building WebAdmin menu system, {URLPATH} in link text is substituted 2026-01-07 14:00:33 +01:00
Badlop 75e9294033 ejabberd_http: Support repeated module in request_handlers
If the same module serves several paths in request_handlers:

  -
    module: ejabberd_http
    request_handlers:
      /share: mod_http_fileserver
      /pub/test: mod_http_fileserver
      /assets: mod_http_fileserver

Until now the function find_handler_port_path only processed
the first path. Now all the paths are returned.
2026-01-07 14:00:30 +01:00
Badlop a864d89970 mod_http_fileserver: Support map of paths in docroot option 2026-01-07 14:00:27 +01:00
Badlop 7bbea9e186 Dockerfile: Use "make prod" instead of "make rel" 2026-01-07 14:00:24 +01:00
Metalhearf 5f94b5252b Update copyright year to 2026 2026-01-05 12:22:57 +01:00
Badlop 2d16c7d1f4 ejabberd_admin: Result of running "make format" after commit ff31ef7f3 2025-12-24 13:37:56 +01:00
Badlop 8fddc9665f ejabberd_http: Get back handling when BOSH or WS are disabled
This support was broken in recent commit 06a8994f2
2025-12-24 13:37:52 +01:00
Badlop 0d24869274 ejabberd_oauth: Fix typo in previous commit 2025-12-24 13:37:50 +01:00
Badlop d2fb995753 ejabberd_oauth: Log error if oauth_list_tokens executed with unsupported DB (#4506) 2025-12-23 18:48:17 +01:00
Badlop 6c751b03c9 ejabberd_commands: Show meaningul error message when problem executing command (#4506) 2025-12-23 18:48:14 +01:00
Badlop 0e8e4579a6 manage-ejabberd: If something fails, print logs 2025-12-19 01:36:45 +01:00
Badlop 937239e329 Dockerfile: Try to fix error with recent freetds Alpine package 2025-12-19 01:36:42 +01:00
Badlop 37f34924f5 ejabberdctl.cfg: Move FIREWALL_WINDOW down, as it is used only for EPMD 2025-12-19 01:36:39 +01:00
Badlop e66e495c22 ejabberd_app: Ammend c35605e log text 2025-12-19 01:36:37 +01:00
Badlop 124d3f3ab0 ejabberdctl: Ammend a22c88a text when ERL_DIST_PORT is already used 2025-12-19 01:36:35 +01:00
Badlop ff31ef7f3d When epmd isn't running show explanation in Clustering WebAdmin page 2025-12-19 01:36:33 +01:00
dependabot[bot] 141dba70e5 build(deps): bump actions/download-artifact from 6 to 7
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-19 01:36:31 +01:00
dependabot[bot] d532705d52 build(deps): bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-19 01:36:30 +01:00
dependabot[bot] d45c7e94ca build(deps): bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-19 01:36:28 +01:00
Pawel Chmielowski bea87c9f05 Remove file commited by mistake 2025-12-16 12:56:57 +01:00
Badlop 9101d7edf0 Container: Apply commit a22c88a
ejabberdctl.template: Show meaningful error when ERL_DIST_PORT is in use
2025-12-12 16:57:05 +01:00
Badlop d88da5717d Container: Apply commit fb572bf
ejabberdctl: When ping returns pang, return also status code 1 (#4327)
2025-12-12 16:57:03 +01:00
Badlop cf2962a359 Container: Apply commit 7f8519c
ejabberdctl: If ERLANG_NODE lacks host, add hostname (#4288)
2025-12-12 16:57:01 +01:00
Badlop 0f5b61b096 Container: Setup new macro STARTTLS_REQUIRED to allow easy disabling 2025-12-12 16:56:58 +01:00
dependabot[bot] 5260597717 build(deps-dev): bump ex_doc from 0.39.1 to 0.39.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.39.1 to 0.39.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.39.1...v0.39.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-version: 0.39.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-12 16:56:56 +01:00
Badlop 0a2a486c77 Bump Erlang/OTP 28.3 2025-12-12 16:56:53 +01:00
Badlop 4944f77159 mod_muc_occupantid: Keep salt per MUC service, not individual rooms 2025-12-12 16:56:51 +01:00
Badlop e77bdf6e35 Separate relive/relivectl paths so ejabberdctl script works correctly 2025-12-12 16:56:48 +01:00
Badlop 5d3b8010cd Update some forgotten documentation from default/new to singlehost/multihost 2025-12-12 16:56:46 +01:00
Badlop 6f424ecd1a Result of running "make doap" 2025-12-12 16:56:43 +01:00
Badlop 08b47e62ec Bump more XEPs versions already supported 2025-12-12 16:56:40 +01:00
Badlop 6c20273ad1 Result of running "make doap" 2025-12-11 12:27:37 +01:00
Badlop f9ed405118 Bump some XEPs versions that are already supported 2025-12-11 12:27:36 +01:00
Badlop acd077c728 mod_muc_room: Rewrite Hats code that gets xdata values 2025-12-11 12:27:35 +01:00
Badlop c589cf68c2 mod_muc_room: Handle hats without definition (#4503) 2025-12-11 12:27:34 +01:00
Badlop a824385424 mod_muc_room: When user has no hats, don't store in hats_users 2025-12-11 12:27:32 +01:00
Badlop 46737b115d mod_muc: Allow vcard queries even when IQ queries are disabled (#4489) 2025-12-11 12:27:30 +01:00
Badlop b1ab2808bb ejabberd_web_admin: Show menu system only when can view vhosts 2025-12-10 13:12:03 +01:00
Badlop 849d239a79 Ammend recent commit c35605e to work in Common Test 2025-12-10 13:11:56 +01:00
Badlop 96a8fc516d Makefile.in: Add "make relivectl" similar to relive but using ejabberdctl
"make relive" was presented in
https://www.process-one.net/blog/ejabberd-22-05/#new-make-relive

Documentation mentions it in:
https://docs.ejabberd.im/admin/install/source/#start

Comparison "make relive" <--> "make relivectl"

- Starts ejabberd using:
  Rebar3/Mix tools <--> ejabberdctl script

- Compiles ejabberd before start?
  Yes! <--> No

- Recompiles source code at runtime?
  Yes! using Sync/ExSync <--> No

- Reads ejabberdctl.cfg?
  No <--> Yes!

In summary:
- relive: preferable when developing: recompiles source code automatically
- relivectl: preferable when testing: uses ejabberdctl script and ejabberdctl.cfg

Example usage:
./autogen.sh && ./configure && make && make relivectl
2025-12-10 10:36:04 +01:00
Badlop a22c88a5c0 ejabberdctl.template: Show meaningful error when ERL_DIST_PORT is in use 2025-12-10 10:33:28 +01:00
Badlop c35605ecce ejabberd_app: Print address and port where listens for erlang node connections 2025-12-10 10:33:25 +01:00
Badlop 6a598ee3cb ejabberd_logger: Ammend commit 97aac8a4 to avoid duplicate newline 2025-12-10 10:33:20 +01:00
Pawel Chmielowski daab203ec0 Revert changes to conversion of pgsql int types 2025-12-05 20:25:42 +01:00
Pawel Chmielowski 7a5319251e Extend timestamp type handling in sql macros 2025-12-05 19:42:31 +01:00
Pawel Chmielowski 6263a93f8f Update p1_mysql to bring fix for timestamp decoding 2025-12-05 19:42:25 +01:00
Pawel Chmielowski 15fd7dc900 Apply timestamp pass in ?SQL_INSERT queries 2025-12-04 16:09:19 +01:00
Pawel Chmielowski 3758128e83 Deliver pubsub notifications to remote servers for nodes with presence based delivery
Nodes configured for presence based delivery did send notifications
only to subscribers that did match presence rules. But this only
works for local users, as we don't know presence for remote users.

This change makes subscribers from remote server get
notification without performing any presence tests.
2025-12-02 18:31:23 +01:00
Badlop cfd54fa9a2 make-binaries: Bump Erlang/OTP 28.2 and Elixir 1.19.4 2025-12-02 18:22:46 +01:00
Badlop 538766bacf Dockerfile: Bump Erlang/OTP 28.2.0.0 and Elixir 1.19.4 2025-12-02 18:22:44 +01:00
Badlop e8eab55d4f mod_muc: Set enable_hats room option true by default 2025-12-02 18:22:41 +01:00
Pawel Chmielowski 525f8bac22 Fix error handling in last commit 2025-12-02 14:08:09 +01:00
Pawel Chmielowski 220eb98f2e Add db serialization to mod_muc_sql 2025-12-02 12:38:06 +01:00
Holger Weiss 7be6580b65 mod_scram_update: Don't hard-code iteration count 2025-11-29 23:25:36 +01:00
Badlop 0d0b39c89f Use improved WebAdmin menu system in more modules 2025-11-27 17:19:29 +01:00
Badlop 091e7e27d4 ejabberd_web_admin: Add helper functions make_menu_system 2025-11-27 17:19:27 +01:00
Badlop 06a8994f24 ejabberd_http: Add helper get_auto_urls/2 that returns all URLs and TLS 2025-11-27 17:19:25 +01:00
Pawel Chmielowski 905a433950 Fix dialyzer warnings 2025-11-27 16:21:17 +01:00
Pawel Chmielowski b72b92cc46 Add commands for new dataabase export/import 2025-11-27 15:30:39 +01:00
Badlop c9e3f0bcf6 mod_http_upload: Amend the fix for #4450 to support IDNA correctly (#3519) 2025-11-27 01:17:40 +01:00
Badlop 434b0423e4 Bump Jose 1.11.12 for Erlang/OTP 26 and newer
Erlang/OTP 25 cannot compile Jose 1.11.12, supports only up to 1.11.10

Revert partially "Remove HAVE_URI_STRING" 489b3fdfb5.
2025-11-27 01:17:18 +01:00
dependabot[bot] e946d20bda build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-27 01:17:15 +01:00
Pawel Chmielowski 3de7cceadc Fix dialyzer warning 2025-11-20 13:17:16 +01:00
Pawel Chmielowski 5b83603d51 New database export/import infrastructure 2025-11-20 12:24:50 +01:00
Badlop 03e535eac0 mod_conversejs: Improve link to conversejs in WebAdmin (#4495)
Until now, the WebAdmin menu included a link to the first request handler
with mod_conversejs that the admin configured in ejabberd.yml
That link included the authentication credentials hashed as URI arguments
if using HTTPS. Then process/2 extracted those arguments and passed them
as autologin options to Converse.

From now, mod_conversejs automatically adds a request_handler nested in
webadmin subpath. The webadmin menu links to that converse URI; this allows
to access the HTTP auth credentials, no need to explicitly pass them.
process/2 extracts this HTTP auth and passes autologin options to Converse.
Now scram password storage is supported too.

This minimum configuration allows WebAdmin to access Converse:

listen:
  -
    port: 5443
    module: ejabberd_http
    tls: true
    request_handlers:
      /admin: ejabberd_web_admin
      /ws: ejabberd_http_ws
modules:
  mod_conversejs:
    conversejs_resources: "/home/conversejs/12.0.0/dist"
2025-11-18 13:37:51 +01:00
Badlop c0de565d2c ejabberd_web_admin: Pass Level in webadmin_menu_system_post and inside hooks 2025-11-18 13:37:00 +01:00
Badlop 3e847f3302 ejabberd_http: Run new http_request_handlers_init fold hook 2025-11-18 13:37:00 +01:00
Badlop 23a3180862 Runtime: Let it pick Elixir 1.19, new 1.19.3 works correctly 2025-11-18 13:37:00 +01:00
Badlop 12d85aef48 Dockerfile: Bump Elixir 1.19.3 2025-11-18 13:36:50 +01:00
Badlop 86fe0ff355 Dockerfile: Expose also port 7777 for SOCKS5
Ports unused in the default configuration, and consequently not exposed:
- 8883 MQTTS
- 5060 SIP
- 5060 SIPS
2025-11-17 20:07:23 +01:00
Badlop dced4f4dac Dockerfile: Configure TURN ports and expose 5478 50000-50099 2025-11-17 20:07:20 +01:00
dependabot[bot] bf46082c82 Bump dialyxir from 1.4.6 to 1.4.7
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.4.6 to 1.4.7.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeremyjh/dialyxir/compare/1.4.6...1.4.7)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-version: 1.4.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 18:05:26 +01:00
Badlop e9b653e6da misc: Get back functions and mark them as deprecated 2025-11-17 18:04:56 +01:00
Badlop 71dccedfc6 Move get_url functions from mod_host_meta to ejabberd_http 2025-11-14 15:18:14 +01:00
Badlop b24230fe0a ejabberd_captcha: Use mod_host_meta:get_auto_url/2 2025-11-14 15:15:32 +01:00
Badlop edb9aa053d mod_host_meta: Allow calling get_url/2 for other modules, not only websocket 2025-11-14 15:15:30 +01:00
Badlop b1bf769e59 mod_host_meta: Cosmetic rename Module to Handler 2025-11-14 15:15:28 +01:00
Badlop b315fe4770 mod_pubsub_serverinfo: Bump support for XEP-0485 1.0.0 2025-11-14 15:15:22 +01:00
Badlop 026bd24a56 Runtime: Test Elixir 1.19.1, not 1.19.2 as it has a bug building app file
Relevant commit that will fix the problem in elixir 1.19.3:
https://github.com/elixir-lang/elixir/commit/0126f1f1a330049c4b25bc916fa14a69b4b6b20d
2025-11-13 18:24:18 +01:00
Badlop ce500fa30e Remove OTP_BELOW_25 2025-11-13 18:24:16 +01:00
Badlop 51081276c2 Remove OTP_BELOW_24 2025-11-13 18:24:13 +01:00
Badlop 9b1c81829a Remove SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL 2025-11-13 18:24:12 +01:00
Badlop 7e1237bb0f Remove COMPILER_REPORTS_ONLY_LINES 2025-11-13 18:24:10 +01:00
Badlop 80fd0e4b6d Remove USE_OLD_PG2 2025-11-13 18:24:09 +01:00
Badlop 26875762b5 Remove USE_OLD_CRYPTO_HMAC 2025-11-13 18:24:07 +01:00
Badlop ebfcf3b5db Remove NO_CUSTOMIZE_HOSTNAME_CHECK 2025-11-13 18:24:05 +01:00
Badlop c472aad566 Remove LAGER 2025-11-13 18:24:04 +01:00
Badlop 59138d810c Remove USE_OLD_HTTP_URI 2025-11-13 18:24:02 +01:00
Badlop 489b3fdfb5 Remove HAVE_URI_STRING 2025-11-13 18:24:00 +01:00
Badlop 4a225c0f4b Remove HAVE_ERL_ERROR 2025-11-13 18:23:59 +01:00
Badlop 997b32b46a Remove irrelevant macro DEPRECATED_GET_STACKTRACE
Its usage was removed two months ago in commit 19b7106
2025-11-13 18:23:57 +01:00
Badlop 5c1566ddb7 CONTAINER.md: Podman already supports exposing range of ports 2025-11-13 18:23:55 +01:00
Badlop 3f10994574 Require Elixir 1.14 or higher, that's the lowest we can test automatically 2025-11-13 18:23:54 +01:00
Badlop 2dbd0795b9 Remove dependency support for Erlang older than 25 2025-11-13 18:23:52 +01:00
Badlop 55e1c5ef78 mod_muc: Fix recent commit when deleting account
The function set_nick crashes if mod_muc is not enabled in some vhosts,
for example when running the Common Tests; and that should not be
considered a failure.
2025-11-13 18:23:50 +01:00
Badlop c51d5e0416 Don't bother to ignore examples/ path in workflows, as it doesn't exist 2025-11-13 18:23:47 +01:00
Badlop 2e41f64243 mod_muc: Announce stable-id feature from XEP-0045 1.31, supported since long ago 2025-11-06 18:30:14 +01:00
Badlop 1b2a166693 Improve documentation of install_contrib_modules (#4487) 2025-11-06 18:30:12 +01:00
Badlop be30990d7f Crash in terminate/2 when stopping mod_muc_log (#4486) 2025-11-06 18:30:11 +01:00
Badlop 5219bf36a9 Container: Apply recent changes in ejabberdctl.template
Even if those changes are not used in the container,
let's try to keep both files as similar as possible.
2025-11-06 18:30:09 +01:00
badlop 3182a3100c Merge pull request #4320 from catap/openbsd
ejabberdctl: support OpenBSD su
2025-11-06 18:16:23 +01:00
Badlop 59f5621ffa mod_muc: Run new hooks: registering_nickmuc and registered_nickmuc (#4478) 2025-11-05 20:03:36 +01:00
Badlop c4d9e536b6 mod_muc: When deleting account, unregister account's nicks in all MUC hosts (#4478) 2025-11-05 20:03:34 +01:00
dependabot[bot] a97d8ab046 Bump actions/download-artifact from 5 to 6
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-05 20:03:33 +01:00
Badlop f7e8d8f1c1 Dockerfile: Bump Erlang/OTP 28.1.0.0 amd Elixir 1.19.1 (#4477) 2025-11-05 20:03:31 +01:00
Badlop 97aac8a446 ejabberd_logger: Append "color clean" only in console template, not file
This amends commit d70ac7f7c
2025-11-05 20:03:29 +01:00
Badlop 3f391be8f0 Installers: Try again to fix artifact paths 2025-11-05 20:03:27 +01:00
Pawel Chmielowski e86362bb2b Make rest module use separate httpc profile 2025-11-05 12:22:49 +01:00
Paweł Chmielowski f17c5a3350 Merge pull request #4476 from ChaosKid42/fix_preload_rooms_with_sql
fix preload_rooms in case of SQL-DB
2025-10-30 09:48:46 +01:00
Christoph Scholz b9a161bb1a fix preload_rooms in case of SQL-DB 2025-10-29 17:16:58 +01:00
Paweł Chmielowski 18110f240b Merge pull request #4475 from sstrigler/ssl_handshake_warnings
Improve logged SSL error messages
2025-10-29 13:12:16 +01:00
Stefan Strigler 92c329912c fix nasty ssl warnings 2025-10-29 08:40:31 +01:00
Badlop d97366fe74 Installers: Fix yaml syntax
Container / build (amd64, <nil>) (push) Failing after 43s
Installers / binaries (amd64, <nil>) (push) Failing after 46s
CI / compile (27) (push) Has been cancelled
Container / build (arm64, -arm) (push) Has been cancelled
Installers / binaries (arm64, -arm) (push) Has been cancelled
Runtime / rebars (25, rebar) (push) Has been cancelled
Runtime / rebars (25, rebar3) (push) Has been cancelled
Runtime / rebars (26, rebar) (push) Has been cancelled
Runtime / rebars (26, rebar3) (push) Has been cancelled
Runtime / rebars (27, rebar3) (push) Has been cancelled
Runtime / rebars (28, rebar3) (push) Has been cancelled
Runtime / rebar3-elixir (1.14) (push) Has been cancelled
Runtime / rebar3-elixir (1.18) (push) Has been cancelled
Runtime / rebar3-elixir (1.19) (push) Has been cancelled
Runtime / mix (1.14) (push) Has been cancelled
Runtime / mix (1.18) (push) Has been cancelled
Runtime / mix (1.19) (push) Has been cancelled
CI / static (27) (push) Has been cancelled
CI / dynamic (27) (push) Has been cancelled
CI / ct (agnostic, 27, multi) (push) Has been cancelled
CI / ct (extauth, 27, multi) (push) Has been cancelled
CI / ct (ldap, 27, multi) (push) Has been cancelled
CI / ct (mnesia, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, multi) (push) Has been cancelled
CI / ct (mysql, 27, single) (push) Has been cancelled
CI / ct (pgsql, 27, multi) (push) Has been cancelled
CI / ct (pgsql, 27, single) (push) Has been cancelled
CI / ct (redis, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, multi) (push) Has been cancelled
CI / ct (sqlite, 27, single) (push) Has been cancelled
CI / cover (push) Has been cancelled
CI / schema (27) (push) Has been cancelled
Container / merge (push) Has been cancelled
Installers / Release (push) Has been cancelled
2025-10-28 13:56:01 +01:00
Badlop 0258195682 Update mix.lock 2025-10-28 13:52:35 +01:00
Badlop 7805241296 Installers: Fix paths to the downloaded installers 2025-10-28 13:46:31 +01:00
Badlop 33ea1823de Set version to 25.10 2025-10-28 13:39:19 +01:00
Badlop 038444773b Container: Try to push resulting image tags properly 2025-10-28 13:39:14 +01:00
Badlop 85b614e77b CHANGELOG.md: Update to 25.10 2025-10-28 12:02:01 +01:00
Badlop 02aa256c59 Copy recent changes to the container template files 2025-10-28 12:01:57 +01:00
Badlop 21c6cc8fd1 Update man page to 25.10 2025-10-28 10:29:17 +01:00
Badlop 5728db746d Update version notes to 25.10 2025-10-28 10:29:16 +01:00
Badlop 5083217fce Update doap file 2025-10-28 10:29:15 +01:00
dependabot[bot] 527c000441 Bump ex_doc from 0.38.3 to 0.39.1
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.38.3 to 0.39.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/v0.39.1/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.38.3...v0.39.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-version: 0.39.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 10:29:13 +01:00
Badlop 48af6467ea mod_announce: Fix API commands descriptions 2025-10-28 10:29:11 +01:00
Badlop b051bcd983 Weekly: No need to test XMPP interop also on the weekly workflow 2025-10-27 12:45:38 +01:00
dependabot[bot] 11a6d3659e Bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 12:40:23 +01:00
Badlop 412489d31b Update Spanish and Catalan translations 2025-10-27 12:37:12 +01:00
Badlop b75e08edf7 Update Russian translation (thanks to Yurt Page) 2025-10-27 12:02:29 +01:00
Badlop ff83eb960a Fix text and capitalization of some translatable strings 2025-10-27 11:50:53 +01:00
Badlop 67208fad9d mod_announce: Add API commands, reusing existing ad-hoc functions 2025-10-23 20:51:03 +02:00
Badlop e02864bf6c mod_announce: Add comments for Vim folding to help module reading 2025-10-23 20:51:01 +02:00
Badlop 45abd38d09 mod_muc_admin: Use in WebAdmin the new API commands that get nick registers 2025-10-23 20:51:00 +02:00
Badlop e7cf1d0b87 mod_muc_admin: New API commands muc_get_registered_nick and nicks (#4468) 2025-10-23 20:50:58 +02:00
Badlop b7aa7dc64c mod_muc: New functions to get registered nick/nicks 2025-10-23 20:50:57 +02:00
Badlop d10d7aa8cc WebAdmin: Respect newline and whitespace characters in results 2025-10-23 20:50:55 +02:00
Badlop 6b3333c3ff Runtime: Test with new Elixir 1.19 2025-10-23 20:50:53 +02:00
Badlop 3ba6a8e039 Fix typo introduced in recent commit 5575d4e78 2025-10-23 20:50:50 +02:00
Pawel Chmielowski c27a3a02fe Tag dependences 2025-10-23 13:48:49 +02:00
Pawel Chmielowski ca05bbd652 Don't catch exit:{aborted, _} inside mnesia transactions
This is used by mnesia internally to retry deadlocked transaction,
so we should allow it to propagate.

This could be triggered by calling create_node concurrently from
multiple processes and did lead to {cyclic, ...} errors.
2025-10-22 16:12:58 +02:00
Pawel Chmielowski 357988b662 Check if room is hibernated before calling mod_muc process
This moves fetching hibernation data from mod_muc process
to caller process, and makes us call mod_muc only
if we have something to unhibernate.
2025-10-21 18:37:22 +02:00
Paweł Chmielowski c40df92263 Merge pull request #4471 from pouriya/pass-HTTP-headers-from-WS-to-C2S-connection
ref: pass HTTP headers from WS to C2S
2025-10-21 12:09:42 +02:00
Pouriya cbe30c1fcb ref: pass HTTP headers from WS to C2S connection 2025-10-21 13:13:08 +03:30
Badlop f77b55c073 mod_configure: New ad-hoc commands that were missing from XEP-0133 2025-10-20 13:04:36 +02:00
Badlop f9ab175a79 ejabberd_admin: New API command restart_kindly, improve stop_kindly 2025-10-20 13:04:28 +02:00
Badlop fb0097a6e0 mod_admin_extra: New API commands: list_banned and count_banned 2025-10-20 13:04:25 +02:00
Badlop d247003038 mod_admin_extra: Improve API command status_list: support for status to be a list
This is used by mod_configure for some ad-hoc commands
2025-10-20 13:04:24 +02:00
Badlop 0f2d64c10d mod_adhoc_api: Add support for async command calling 2025-10-20 13:04:22 +02:00
Badlop d49ccbf031 mod_adhoc_api: If argument is a list of jids, type is jid-multi 2025-10-20 13:04:20 +02:00
Badlop 6d5065ae3a mod_adhoc_api: If field has several values, type is text-multi 2025-10-20 13:04:19 +02:00
Badlop 803e6d743a Fix small typo 2025-10-20 13:04:17 +02:00
Badlop 2bf4a5970a CI: Fix updating ubuntu packages 2025-10-20 10:53:47 +02:00
Holger Weiss 9e985e3e79 mod_push: Apply cosmetic changes 2025-10-18 00:47:09 +02:00
Holger Weiss 72661acb43 Merge remote-tracking branch 'processone/pr/4383'
* processone/pr/4383:
  feat: fire new `push_send_notification` hook
2025-10-18 00:43:01 +02:00
badlop eace76b16e Merge pull request #4460 from badlop/arm_runner
Use ARM native runner and parallelization in workflows to reduce perceived run time
2025-10-17 09:30:12 +02:00
badlop ca03a97ca2 Merge pull request #4469 from guusdk/xmpp-interop-testing-v1.7.2
CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
2025-10-16 15:07:17 +02:00
Pawel Chmielowski 95d54f9568 Fix formating 2025-10-14 15:13:34 +02:00
Pawel Chmielowski 62185c8d30 Remove dialyzer warnings 2025-10-14 15:01:34 +02:00
Pawel Chmielowski ef94ee66fd Use mod_private:del_data in unban_account command 2025-10-14 14:10:23 +02:00
Pawel Chmielowski f666cd4643 Fix dialyzer warning 2025-10-14 13:53:15 +02:00
Pawel Chmielowski 12989ba5eb Add del_data/3, get_users_with_data/2, count_users_with_data/2 in mod_private 2025-10-14 11:38:21 +02:00
Guus der Kinderen 63f3b4f7af CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
Updates this GitHub Action that's used to execute XMPP-based interop tests from v1.7.1 to v1.7.2.

This bugfix release introduces some changes that improve the stability of the tests. Highlights include:

- No longer includes tests that verify client, instead of server behavior
- Add prerequisite checks for various tests, to prevent them from failing if the server under test doesn't support the feature
- Remove prerequisite checks for other tests where they needlessly prevent a test from executing
2025-10-13 22:04:06 +02:00
Pawel Chmielowski 7a4ea0eba2 Add config transformer from use_new_schema -> sql_multihost_schema 2025-10-13 11:36:52 +02:00
Badlop ad4876821b Installers: Generate ARM installers in native runner 2025-10-09 13:54:14 +02:00
Badlop cf2b2d5e85 Container: Build ARM in native runner instead of QEMU, merge and clean 2025-10-09 13:54:13 +02:00
Badlop a0c5df0c5b Weekly: New workflow that condenses CI, test all erlang without caching 2025-10-09 13:54:11 +02:00
Badlop ae36405466 CI and Runtime: Reorganize steps to run in parallel, and ARM runner 2025-10-09 13:54:10 +02:00
Badlop e7eb116d93 Add local composite actions to manage ejabberd and databases 2025-10-09 13:54:08 +02:00
Badlop 10a82afd46 Tests: Run agnostic-database tests only once, not for every backend 2025-10-09 13:54:06 +02:00
Badlop bba9563525 Tests: The odbc backend is not actually used in Commont Tests 2025-10-09 13:54:04 +02:00
Badlop 558cabd860 Tests: Fix typo when commenting CT_BACKENDS environment variable 2025-10-09 13:54:02 +02:00
Badlop 2118c3028f mod_admin_update_sql: Use same index name than when creating database 2025-10-09 13:54:00 +02:00
badlop 4a7238afea Merge pull request #4459 from badlop/maybe
Enable maybe expression for Erlang 25 and 26
2025-10-09 12:47:30 +02:00
badlop 127c909f0f Merge pull request #4456 from badlop/multihost
Rename New SQL schema to Multihost, and Default to Singlehost
2025-10-09 12:15:10 +02:00
Badlop 1a7c1c5c06 mod_mam: Mention ejabberd version of the new option 2025-10-09 11:17:36 +02:00
Badlop dd5d2aeee0 make-binaries: Bump Expat 2.7.3, OpenSSL 3.5.4, unixODBC 2.3.14 2025-10-09 11:17:34 +02:00
Badlop 1d99c5cb60 Revert "make-binaries: Bump crosstool to 1.28.0"
This reverts commit 4e909fc50d.
2025-10-09 11:17:32 +02:00
badlop b9e4bbc070 Merge pull request #4463 from guusdk/xmpp-interop-testing-disable-XEP-0421
CI: Disable XEP-0421 testing that consistently fails
2025-10-08 19:07:17 +02:00
badlop 41fab88ee5 Merge pull request #4462 from guusdk/xmpp-interop-testing-v1.7.1
CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
2025-10-08 19:06:52 +02:00
Pawel Chmielowski 0ca877f925 make misc:json_encode always call json with our filter 2025-10-07 14:42:13 +02:00
Pawel Chmielowski b480f125ee Add commands argument type binary_or_list
This allow commands accepting list of binary, that will also
accept single binary that will be converted to list
2025-10-07 13:30:05 +02:00
Pawel Chmielowski 7ee5f81923 Format sub elements for tuples from maps 2025-10-07 13:21:36 +02:00
Guus der Kinderen 3d43b98d42 CI: Disable XEP-0421 testing that consistently fails
The XMPP Interop Framework tests for XEP-0421 consistently report test failures. These tests should be disabled, until appropriate fixes are applied to ejabberd.
2025-10-02 15:41:52 +02:00
Guus der Kinderen 1636c202a7 CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
Updates this GitHub Action that's used to execute XMPP-based interop tests from v1.6.1 to v1.7.1.

This does not bring a significant amount of new tests (although some early tests for XEP-0060: 'Publish/Subscribe' was added), but does improve the stability of the existing tests (meaning: less false positives and less 'flacky' tests).

Additional configuration options have been added:

- there now are three different ways to provision test accounts on the server-under-test. That should make it easier for some to embed our tests to their pipeline
- the failOnImpossibleTest option fails the test run if any configured tests were impossible to execute, ensuring all intended tests actually ran.
2025-10-02 15:05:14 +02:00
Jérôme Sautret 060992bafa Improve roster API commands documentation 2025-09-30 16:38:23 +02:00
Pawel Chmielowski c0c69394b9 Make mod_muc_sql properly handle new hats data (#4380) 2025-09-30 10:00:11 +02:00
Badlop 2b7285e0b2 Update implementation of XEP-0317 Hats to version 0.3.1 (#4380) 2025-09-30 10:00:05 +02:00
Badlop c3a24ffdf8 Revert "mod_muc_room.hrl: Work around old Dialyzer bug"
This reverts commit c4f6c9dfe7.
2025-09-30 09:58:14 +02:00
Pawel Chmielowski 48fb446f8c Properly pass send_timeout option to listener sockets 2025-09-26 10:44:38 +02:00
Pawel Chmielowski 0283a501fa Add archive_muc_as_mucsub option in mod_mam
This option can be used to enable archiving of
incoming groupchat messages as mucsub events
if user is subscribed to a room.
2025-09-25 10:06:26 +02:00
Badlop fb572bf901 ejabberdctl: When ping returns pang, return also status code 1 (#4327) 2025-09-24 13:27:04 +02:00
Badlop 7eb09295a3 mod_block_strangers: Clarify access and catpcha documentation (#4221) 2025-09-24 13:27:02 +02:00
Badlop e0eae52eae mod_muc_room: Don't require password if user is owner of room 2025-09-24 13:27:00 +02:00
Badlop dd270f99fc container.md: Update versions used in ecs container image 2025-09-24 13:26:59 +02:00
Badlop 1472caab50 make-binaries: Bump OpenSSL 3.5.3 and Expat 2.7.2 2025-09-24 13:26:57 +02:00
Badlop ef2e62a01c Bump Erlang/OTP version to 27.3.4.3 in installers and container 2025-09-24 13:26:55 +02:00
Badlop 4e909fc50d make-binaries: Bump crosstool to 1.28.0 2025-09-24 13:26:53 +02:00
Pawel Chmielowski 19b7106124 Remove EX_RULE and EX_STACK macros
As we no longer targer R19, we no longer need to carry those.
2025-09-23 11:25:17 +02:00
Badlop ccd9fa6561 Enable feature maybe_expr also in the runtime for Erlang/OTP 25
As explained in https://erlangforums.com/t/how-to-enable-maybe-expr/2154
- Erlang/OTP 27 and newer has already the feature enabled by default
- Erlang/OTP 26 requires enabling the feature in the compiler
- Erlang/OTP 25 requires enabling also in the runtime system
2025-09-22 16:04:42 +02:00
Badlop 1ddd72ffe7 Enable feature maybe_expr in the compiler for Erlang/OTP 26
Documentation:
https://www.erlang.org/doc/system/expressions.html#maybe
https://www.erlang.org/eeps/eep-0049
https://www.erlang.org/eeps/eep-0060
2025-09-22 16:04:42 +02:00
Badlop b759acdcea Runtime: Remove Erlang 24 which won't work anymore with maybe_expr 2025-09-22 16:04:42 +02:00
Badlop 4eee6d7cec CI: Don't care to include commit details in the CT logs HTML page 2025-09-18 12:02:04 +02:00
Badlop 5575d4e78e Rename New SQL schema to Multihost, and Default to Singlehost
Right now all names are supported, the previous (obsolete)
and the renamed (preferred). The changes relevant to the usage are:

When preparing configuration, the arguments:
  ./configure --enable-new-sql-schema
  ./configure --enable-multihost-sql-schema

When configuring ejabberd, the toplevel options:
  new_sql_schema: true
  sql_schema_multihost: true

When developing source code, the functions:
  ejabberd_sql:use_new_schema()
  ejabberd_sql:use_multihost_schema()
2025-09-17 11:12:38 +02:00
Badlop 4dea2f1eb6 Fix some Elvis reports 2025-09-03 12:20:42 +02:00
Badlop 1d5b9bba15 Get yconf that fixes problem introduced in recent commit (#4444) 2025-08-29 17:18:06 +02:00
Badlop 2951281115 mod_http_upload: Encode URL before parsing, as done before bba1a1e3c (#4450) 2025-08-29 17:17:39 +02:00
Badlop fd8aba6d41 ext_mod: Print module status message after installation 2025-08-29 17:17:37 +02:00
Badlop 066e0a8101 No need to test intermediate XML, and delete after conversion 2025-08-29 17:17:35 +02:00
Badlop bf262a6051 Fix markdown link to a command 2025-08-29 17:17:33 +02:00
badlop 7840924b17 Merge pull request #4443 from guusdk/xmpp-interop-testing-v1.6.1
CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
2025-08-26 17:21:46 +02:00
Guus der Kinderen 60bdab4e52 CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
Updates this GitHub Action that's used to execute XMPP-based interop tests from v1.6.0 to v1.6.1.

This is a bugfix release that should increase the stability / predictability of test execution.

A notable change is that the file structure in which XMPP stanzas are generated (which is provided as debug output) has changed. They are still stored in the directory denoted by the logDir argument, but the file structure in that directory has changed somewhat.
2025-08-25 10:43:31 +02:00
Alexey Shchepin 3a36a722c5 Fix a bug in mod_matrix_gw_room:check_event_power_level/3
CI / Tests (25) (push) Failing after 1s
CI / Tests (26) (push) Failing after 0s
CI / Tests (27) (push) Failing after 0s
CI / Tests (28) (push) Failing after 1s
Container / Container (push) Failing after 50s
Installers / Binaries (push) Failing after 49s
Runtime / Rebars (24, rebar3) (push) Failing after 6s
Runtime / Rebars (25, rebar) (push) Failing after 5s
Runtime / Rebars (25, rebar3) (push) Failing after 4s
Runtime / Rebars (26, rebar) (push) Failing after 4s
Runtime / Rebars (26, rebar3) (push) Failing after 4s
Runtime / Rebars (27, rebar3) (push) Failing after 5s
Runtime / Rebars (28, rebar3) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.14) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.15) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.16) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.17) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.18) (push) Failing after 5s
Runtime / Mix (1.14) (push) Failing after 5s
Runtime / Mix (1.15) (push) Failing after 5s
Runtime / Mix (1.16) (push) Failing after 4s
Runtime / Mix (1.17) (push) Failing after 5s
Runtime / Mix (1.18) (push) Failing after 5s
Installers / Release (push) Has been skipped
2025-08-22 14:46:59 +03:00
Badlop 00c75c3dc9 Set version to 25.08 2025-08-22 11:15:33 +02:00
Badlop cae7850a70 CHANGELOG.md: Update to 25.08 2025-08-22 10:56:06 +02:00
Badlop ce668bef14 Container: Apply some improvements from ejabberd source code
Applied:
- ejabberd.yml.example: Use HOST_URL_ENCODE to handle case when vhost is non-latin1
- ejabberdctl: Improve explanation how to stop ejabberd in live mode
- ejabberdctl: New "mnesia_change" command, a frontend to mnesia_change_nodename
2025-08-22 10:56:03 +02:00
Badlop 3887b6d930 Update man page to 25.08 2025-08-21 17:12:55 +02:00
Badlop b7bd0e196d Update rebar.lock too 2025-08-21 17:12:09 +02:00
Badlop 6d63842ad3 Fix typo in hu.msg string 2025-08-21 16:24:58 +02:00
Badlop 2f3b9015e9 Update module and options version notes 2025-08-21 16:24:55 +02:00
Badlop 6ae48eb991 Result of running "make options" 2025-08-21 16:24:50 +02:00
dependabot[bot] c508795ad4 build(deps): bump golang in /.github/container
Bumps golang from 1.24-alpine to 1.25-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-version: 1.25-alpine
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 16:24:48 +02:00
Badlop 4a053807e0 build(deps-dev): bump dialyxir from 1.4.5 to 1.4.6
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeremyjh/dialyxir/compare/1.4.5...1.4.6)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-version: 1.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 16:24:46 +02:00
dependabot[bot] dd5bbda2dc build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 16:24:44 +02:00
Badlop 98469678a0 ejabberd_listener: Add secret in temporary unix domain socket path (#4422) 2025-08-21 16:24:42 +02:00
Badlop b8550e087e mod_conversejs: Ensure plugins URL is separated with / (#4413) 2025-08-21 16:24:39 +02:00
Holger Weiss 644d468b4f Update registration test
Adjust test case for commit 654d4b81b1.
2025-08-21 09:51:24 +02:00
Pawel Chmielowski 74c810eeaa Tag dependencies 2025-08-20 13:46:55 +02:00
Holger Weiss a46325166a mod_register: Don't duplicate welcome subject
Don't include the configured welcome message subject with the body.  If
that's desired, the admin can simply configure it that way.  But if it's
undesired, there would be no way to avoid the subject duplication.
2025-08-19 20:09:17 +02:00
Holger Weiss 654d4b81b1 mod_register: Don't duplicate welcome message
Originally, the welcome message was sent as type 'normal'.  Apparently,
some clients don't display 'normal' messages as expected (see #4246).
To address that issue, commit 9a0ff13cc2
duplicated the welcome message as type 'chat'.  However, we shouldn't
send both formats.  The 'normal' message is either ignored by the
client, in which case it serves no purpose, or displayed, in which case
the user would see the message twice.
2025-08-19 20:03:01 +02:00
Holger Weiss ff3d33dde4 Bump xmpp version
Allow for adding HTTP File Upload purposes support to ejabberd.
2025-08-18 16:23:33 +02:00
Badlop 3183e2f733 Fix dialyzer warnings in recent commit 2025-08-15 16:33:05 +02:00
Badlop e1dc686ae7 mod_conversejs: Ensure assets_path ends in / as required by Converse (#4414) 2025-08-15 15:20:35 +02:00
Badlop 38b203feb1 ejabberd_listener: Use init_fail for errors as recommended by init_ack
That is recommended since OTP 26, see
 https://www.erlang.org/doc/apps/stdlib/proc_lib.html#init_ack/2
 Warning
 Do not use this function to return an error indicating that the process
 start failed. When doing so the start function can return before the
 failing process has exited, which may block VM resources required for a
 new start attempt to succeed. Use init_fail/2,3 for that purpose.
2025-08-15 15:20:33 +02:00
Alexey Shchepin 8b61cf0742 Don't send empty direct Matrix messages (thanks to snoopcatt) (#4420) 2025-08-15 04:52:07 +03:00
Alexey Shchepin a02c75aa08 Add support for null values in is_canonical_json (thanks to snoopcatt) (#4421) 2025-08-15 04:52:07 +03:00
Alexey Shchepin 51af393baa Add leave_timeout mod_matrix_gw option (#4386) 2025-08-15 04:52:07 +03:00
Badlop 41318e45a5 mod_conversejs: Add option conversejs_plugins (#4413) 2025-08-14 19:05:12 +02:00
badlop a94f227103 Merge pull request #4425 from guusdk/xmpp-interop-testing-v1.6.0
CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
2025-08-14 11:37:51 +02:00
Badlop 517776acd4 COMPILE.md: Mention dependencies and add link to Docs (#4431) 2025-08-13 18:17:26 +02:00
dependabot[bot] 212a5ded6e build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-13 18:17:05 +02:00
Badlop fd9c929e37 Bump OpenSSL version to 3.5.2 2025-08-13 16:50:18 +02:00
Badlop ce828163af Bump Erlang/OTP version to 27.3.4.2 2025-08-13 16:50:14 +02:00
Badlop 97e1b419a0 mod_providers: New module to serve easily XMPP Providers files 2025-08-13 16:49:42 +02:00
Badlop d70ac7f7c5 ejabberd_logger: Print log lines colorized in console when using rebar3 2025-08-13 16:49:42 +02:00
Badlop 7065cb69f1 ejabberdctl: New "mnesia_change" command, a frontend to mnesia_change_nodename 2025-08-13 16:49:42 +02:00
Badlop 7815463ba0 ejabberd.yml.example: Use HOST_URL_ENCODE to handle case when vhost is non-latin1 2025-08-13 16:49:42 +02:00
Badlop 48e6631751 mod_muc_room: Fix warning about unused variable 2025-08-13 16:49:37 +02:00
Badlop 903e6b70b4 mod_matrix_gw: Document what room versions are supported since when 2025-08-13 16:48:01 +02:00
Alexey Shchepin 5edba59b24 Fix dialyzer errors 2025-08-11 20:24:59 +03:00
Alexey Shchepin 31cb4b06e4 Matrix gateway updates
- Partially rewritten state resolution
- Support for Hydra rooms
- Use double colon for separating a matrix server from a room ID in JID
  with Hydra rooms
- Partially rewritten mod_matrix_gw_s2s
- Add notary_servers option
2025-08-11 19:44:50 +03:00
Kirill A. Korinsky 5de3bacf35 ejabberdctl: support NetBSD su
Co-authored-by: Greg Troxel <gdt@lexort.com>
2025-08-08 19:18:43 +02:00
Kirill A. Korinsky 8aae7424e9 ejabberdctl: support OpenBSD su
OpenBSD has a different than Linux su:
 1. `-c` before username is treated as login class;
 2. it doesn't require `--` as arguments separator.

Without (1) it complains as:

    su: no such login class: exec "$0" "$@"

and without (2):

    -: --: not found

Here, I've added detection of OS via `uname -s` which routes to the
right `su`. I really think that other BSD may need it as well.
2025-08-08 19:18:20 +02:00
Pawel Chmielowski 10f6723f00 Prevent loops in xml_compress:decode with corrupted data 2025-08-07 13:49:10 +02:00
Pawel Chmielowski f594620c68 Only offer upgrades to methods that aren't already stored 2025-08-05 11:06:17 +02:00
Pawel Chmielowski dacfad61d8 Fix format of passwords updates triggered by mod_scram_upgrade 2025-08-05 11:02:33 +02:00
badlop 7c1da7e0cf Merge pull request #4412 from marc0s/issue-4410
fix: unsubscribe users from members-only rooms when expelled
2025-08-01 12:38:37 +02:00
marc0s e709f99b47 fix: unsubscribe users from members-only rooms when expelled
Fixes #4410
2025-07-31 08:05:32 +02:00
Guus der Kinderen f150419891 CI: bump XMPP-Interop-Testing/xmpp-interop-tests-action
Updates this GitHub Action that's used to execute XMPP-based interop tests from v1.5.0 to v1.6.0.

In this update, 524 new tests were added (more than doubling the amount of tests that previously existed).
2025-07-30 22:44:54 +02:00
Badlop 053fd26994 econf: If a host in configuration is encoded IDNA, decode it (#3519)
For example:

hosts:
  - localhost
  - locälhost3
  - xn--loclhost4-x2a

all them are converted to utf8:

ejabberd_option:hosts().
[<<"localhost">>,
 <<"locälhost3"/utf8>>,
 <<"locälhost4"/utf8>>]
2025-07-26 00:43:25 +02:00
Badlop bba1a1e3ca mod_http_upload: Encode URLs into IDNA when showing to XMPP client (#3519) 2025-07-25 19:54:28 +02:00
Badlop e5da1efea4 misc: Move uri_parse/1 to yconf and merge with yconf:parse_uri/1 2025-07-25 19:54:26 +02:00
Badlop fbfd41c16e misc: uri_decode/1 moved here from ejabberd_http and prosody2ejabberd 2025-07-25 19:54:25 +02:00
Badlop 4391921727 ejabberd_config: New predefined keyword HOST_URL_ENCODE 2025-07-25 19:54:23 +02:00
Badlop 4cd3c657e2 ejabberd_listener: Try to create provisional socket in final directory (#4422)
and if that path is too long, then try HOME directory,
if that's too long too, throw error explaining the problem.

By the way, cutting the base64 string to 107 is a bad idea,
as it encodes the final path, which would get lost and crash.
2025-07-25 11:15:37 +02:00
Badlop 7647b77225 Runtime: Raise the minimum Erlang tested to Erlang/OTP 24
The Erlang containers from versions 20-23 use Debian Buster,
and require the debian repositories to install some development libraries.
The Debian Buster repositories are no longer available,
which means that we can no longer perform any test with Erlang 20-23.
2025-07-25 11:15:34 +02:00
Pawel Chmielowski fe8710fe00 Rename auth_password_types_hidden_in_scram1 option to auth_password_types_hidden_in_sasl1
Also add migration code from old name
2025-07-25 09:39:21 +02:00
Pawel Chmielowski 1a9b147baf Report db failures in mod_muc_mnesia:restore_room 2025-07-23 20:27:19 +02:00
Pawel Chmielowski 6214e0385d Report db failures from mod_muc:restore_room 2025-07-23 19:59:32 +02:00
Badlop f7002c31f0 Fix some typos in previous commit (#4422) 2025-07-22 13:30:54 +02:00
Badlop 99b75396ad ejabberd_listener: Log error when cannot set definitive unix socket (#4422) 2025-07-22 10:48:17 +02:00
Badlop b1c3baa7bd Bump p1_acme to fix 'AttributePKCS-10' and OTP 28 (processone/p1_acme#4) 2025-07-22 10:47:38 +02:00
Badlop 355eb5dfde Improve documentation of toplevel options default_db and default_ram_db 2025-07-22 10:47:36 +02:00
Badlop d269e32c3a ejabberd_config: Improve warning message about unsupported ram_db type 2025-07-22 10:47:33 +02:00
Badlop 214b76f763 ejabberd_doc: Document commands tags for modules 2025-07-22 10:47:30 +02:00
Holger Weiss 73a8fbdfb5 make-binaries: Re-add executable bit 2025-07-21 13:42:07 +02:00
Holger Weiss 9b6f0aeb3c make-binaries: Disable Linux-PAM's logind support
Make sure Linux-PAM doesn't attempt to include logind support.  This
avoids a build failure in case the host system has systemd's
development headers installed.
2025-07-21 13:38:11 +02:00
Badlop 45a6aed57f mod_admin_extra: Run sm_kick_user event when kicking account (#4415)
This is important when running the ban_account command and mod_auth_fast
is enabled, as the client may store auth tokens that bypass
the banning stored in private storage and enforced by ejabberd_auth.
2025-07-16 18:09:14 +02:00
Badlop 9d17a160b6 mod_admin_extra: No need to change password in ban_account (#4415)
When ban details are stored in private storage,
ejabberd_auth reads them and prevents user login,
so there's no need to modify the account password.
2025-07-16 13:33:40 +02:00
Badlop 850d097660 ejabberd_auth: Handle case running check_password when account is banned 2025-07-16 13:33:36 +02:00
Badlop 8ce8f67c06 misc: Add workaround for Json library not able to handle empty list 2025-07-16 13:33:33 +02:00
Pawel Chmielowski a17c2c166d Fix issue with filtering duplicates in auth_mnesia:get_users()
Previous version was only correct when data to process
was sorted, which was not always the case.

This add common implementation of lists:uniq in misc that works
also on <R25, and switches get_users to use it.
2025-07-16 12:43:25 +02:00
Badlop a64aa9e280 Set version to 25.07
CI / Tests (25) (push) Failing after 0s
CI / Tests (26) (push) Failing after 0s
CI / Tests (27) (push) Failing after 1s
CI / Tests (28) (push) Failing after 0s
Container / Container (push) Failing after 46s
Installers / Binaries (push) Failing after 1m7s
Runtime / Rebars (20, rebar) (push) Failing after 5s
Runtime / Rebars (20, rebar3) (push) Failing after 5s
Runtime / Rebars (25, rebar) (push) Failing after 4s
Runtime / Rebars (25, rebar3) (push) Failing after 5s
Runtime / Rebars (26, rebar) (push) Failing after 5s
Runtime / Rebars (26, rebar3) (push) Failing after 5s
Runtime / Rebars (27, rebar3) (push) Failing after 4s
Runtime / Rebars (28, rebar3) (push) Failing after 13s
Runtime / Rebar3+Elixir (1.14) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.15) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.16) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.17) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.18) (push) Failing after 4s
Runtime / Mix (1.14) (push) Failing after 4s
Runtime / Mix (1.15) (push) Failing after 4s
Runtime / Mix (1.16) (push) Failing after 5s
Runtime / Mix (1.17) (push) Failing after 5s
Runtime / Mix (1.18) (push) Failing after 5s
Installers / Release (push) Has been skipped
2025-07-11 13:15:26 +02:00
Badlop 3834a47a39 CHANGELOG.md: Update to 25.07 2025-07-11 13:15:26 +02:00
Badlop 9f6ff515ff Fix documentation for commands implemented in modules with several behaviours 2025-07-11 13:10:08 +02:00
Pawel Chmielowski 64a210842e Use tagged dependencies 2025-07-11 12:55:25 +02:00
Badlop c0de52c967 Update man page to 25.07 2025-07-11 12:10:58 +02:00
Badlop 67c3df05b3 ext_mod: Add temporary workaround for zip including absolute path 2025-07-11 12:10:57 +02:00
Badlop 4a66616756 mod_antispam: Mention usage of CONFIG_PATH predefined keyword 2025-07-11 12:10:54 +02:00
Pawel Chmielowski e4d424bf56 Add auth_password_types_hidden_in_scram1 option
This option allows disabling some auth mechanisms
to be offered in SASL1 features. This makes adding
new password types easier, by ensuring that new
password use will be offered only to clients that
have new type stored (SASL2 clients that send us
user info before features need to be sent), but
not to clients where we don't know if they have
new passwords.
2025-07-10 16:52:13 +02:00
Badlop c0fc6091b1 Annotate ejabberd version of new modules, options, commands 2025-07-10 10:58:17 +02:00
Badlop ef35d19ff1 Update Ukrainian translation (thanks to Максим Горпиніч) 2025-07-10 10:58:15 +02:00
Badlop cfa787c4b6 Update Tamil translation (thanks to TamilNeram) 2025-07-10 10:58:14 +02:00
Badlop 611ebce0d2 Update Greek translation (thanks to GiannosOB) 2025-07-10 10:58:13 +02:00
Badlop 1e0b8cb547 Bump Erlang/OTP 27.3.4.1 for container image too 2025-07-10 10:58:10 +02:00
Pawel Chmielowski 99d323b1dd Update fast_tls with updated deps 2025-07-09 17:13:17 +02:00
Pawel Chmielowski 72bc9b6c7f Allow s2s connections to accept client certificates that have only server purpose
Due to Google Chrome certification requirements we can expect
that in near future there will be no certificate authority
that will issue certifcates that have both server and client auth
purposes.

This change makes s2s listeners ignore cert purposes, and should
allow servers that have those new certificate to use it, to
authenticate new s2s connections.

This fixes issue #4392
2025-07-09 14:16:02 +02:00
Pawel Chmielowski 4694a482f4 Update doap with info about xep-0486 2025-07-08 20:13:56 +02:00
Badlop 443f39bfdb Result of running "make format doap options" 2025-07-08 12:43:43 +02:00
Badlop b118dd8fc6 Update reference to XEP-0485 support 2025-07-08 12:43:43 +02:00
Badlop bf39da7b8b mod_pubsub_serverinfo: Rephrase documentation and improve markdown 2025-07-08 12:42:52 +02:00
Badlop ad3eee059e mod_antispam: Annotate ejabberd version of the new commands 2025-07-08 12:42:50 +02:00
Badlop e94ccabcf0 mod_antispam: Move commands to a new "spam" API tag 2025-07-08 12:42:48 +02:00
Badlop 427a29c74e Bump Erlang/OTP 27.3.4.1, Elixir 1.18.4, libexpat 2.7.1, OpenSSL 3.5.1
Notice:
- installers use OTP 27.3.4.1, the latest available right now
- containers use OTP 27.3.4, because container for 27.3.4.1 was not published,
  see https://hub.docker.com/_/erlang
2025-07-08 12:42:44 +02:00
badlop 1d79edbae0 Merge pull request #4408 from sstrigler/mod_pubsub_serverinfo
mod_pubsub_serverinfo
2025-07-08 10:55:14 +02:00
badlop 9e4a6d09df Merge pull request #4373 from sstrigler/mod_antispam
mod_antispam: port from ejabberd-contrib/mod_spam_filter
2025-07-08 10:19:34 +02:00
Stefan Strigler 7b08289799 Merge pull request #6 from badlop/antispam_services
Replace options rtbl_host and rtbl_domains_node with rtbl_services
2025-07-08 08:23:22 +02:00
Paweł Chmielowski bc937546ec Merge pull request #4409 from Britaliope/patch-1
missing comma in postgres schema
2025-07-07 19:03:10 +02:00
Stefan Strigler 3b972fe4a3 update p1/xmpp to latest 2025-07-07 17:58:56 +02:00
Badlop 5e93725044 Replace options rtbl_host and rtbl_domains_node with rtbl_services 2025-07-07 17:42:05 +02:00
Stefan Strigler 500af47b79 mod_pubsub_serverinfo: codec spec moved to p1/xmpp 2025-07-07 17:40:34 +02:00
Stefan Strigler d862e04186 Merge pull request #5 from badlop/antispam_options
Fix crashes, improve options, complete documentation
2025-07-07 15:29:06 +02:00
Badlop 5f293cb1e0 Document more options 2025-07-07 14:28:14 +02:00
Bruno MATEU c93ea2c22f missing comma in postgres schema 2025-07-07 08:28:23 +02:00
Stefan Strigler c567005241 mod_pubsub_serverinfo: get pubsub host from server state 2025-07-05 14:54:11 +02:00
Stefan Strigler a6823d157c mod_pubsub_serverinfo: add documentation 2025-07-05 14:38:55 +02:00
Stefan Strigler bf54cc59e1 mod_pubsub_serverinfo: apply make format 2025-07-05 14:23:03 +02:00
Stefan Strigler 740b0c7dd7 mod_pubsub_serverinfo: initial import as found on ejabberd-contrib 2025-07-05 14:19:20 +02:00
Badlop c3f5083f15 Use the new gen_mod:prep_stop/1 feature
This fixes the problem when stopping the module with multiple vhosts:
unsubscribing from a local pubsub requires mod_pubsub in that vhost running,
but ejabberd stops mod_pubsub from a vhost before stopping mod_antispam
in other vhost.
2025-06-30 18:21:19 +02:00
Badlop b65c11daf6 New predefined keyword: CONFIG_PATH 2025-06-30 18:21:19 +02:00
Badlop 263e1f59f7 Fix problem calling get_log_path when ejabberd is stopping
When ejabberd is being stopped
and some module calls ejabberd_logger:get_log_path(),
application:load/1 crashes with error:

** Reason for termination ==
** {terminating,
       [{application_controller,call,2,
            [{file,"application_controller.erl"},{line,511}]},
        {application,load1,2,[{file,"application.erl"},{line,274}]},
        {ejabberd_config,env_binary_to_list,2,
            [{file,"/home/git/ejabberd/src/ejabberd_config.erl"},
             {line,343}]},
        {ejabberd_logger,get_log_path,0,
            [{file,"/home/git/ejabberd/src/ejabberd_logger.erl"},
             {line,55}]},
2025-06-30 18:21:19 +02:00
Badlop 3d89c9199c gen_mod: Add support to prepare module stopping before actually stopping any module
Follows the reasoning of application:prep_stop, but applied to gen_mod:
  https://www.erlang.org/docs/28/apps/kernel/application.html#c:prep_stop/1
2025-06-30 18:21:19 +02:00
Stefan Strigler 4a51bf90ab Merge pull request #3 from badlop/antispam_files
Move spam file management to a submodule
2025-06-25 15:45:15 +02:00
Badlop a77c7e36b0 Move spam files parsing to a submodule 2025-06-23 09:44:33 +02:00
Badlop 88ae3fddf3 mod_antispam: Sort and document files options 2025-06-23 09:44:33 +02:00
Badlop bddcf0624e mod_antispam: Move some definitions to a header file 2025-06-23 09:44:33 +02:00
Badlop 6b47d3eb0d mod_auth_fast: Clear tokens on kick, change pass and unregister (#4397)(#4398)(#4399) 2025-06-20 16:55:59 +02:00
Badlop a0c97b33e0 CONTAINER.md: Move ejabberd-contrib content from Docs website 2025-06-20 12:45:35 +02:00
Badlop 5def9cef9f ext_mod: When upgrading module, clean also the compiled directories 2025-06-20 12:45:31 +02:00
Badlop c20d745028 New option hosts_alias and function resolve_host_alias/1 (4400) 2025-06-19 12:40:16 +02:00
Badlop e099435cd6 ejabberd_http: Remove unused default_host option and state element
The option 'default_host' for ejabberd_http was added years ago
in commit 7d623d5. However it was problematic and the usage was
removed in commit 83c291c. It's time to remove its last forgotten bits.
2025-06-19 12:40:15 +02:00
Badlop d6a00f5151 mod_conversejs: Add link in WebAdmin to local Converse if configured 2025-06-19 12:40:14 +02:00
Badlop 653413e912 Run new webadmin hooks to add items to system menu 2025-06-19 12:40:12 +02:00
Badlop 288eecc23d Use misc:encode_pid/1 in ejabberd_sm_sql 2025-06-19 12:40:10 +02:00
Stefan Strigler b55b6f3d26 Merge pull request #2 from badlop/antispam_filter
Move filtering actual implementation to a submodule
2025-06-18 14:15:39 +02:00
Badlop d00561b58c Move filtering implementation to a submodule 2025-06-18 11:52:28 +02:00
Badlop 432810db89 Fix minor typos 2025-06-18 11:52:28 +02:00
Badlop f3b1b5d419 Result of running "make format" 2025-06-18 11:52:28 +02:00
Stefan Strigler d9a7b67f0e mod_antispam: increase timeout when waiting for dump file 2025-06-17 17:21:58 +02:00
Badlop 85f05192c8 Move spam_dump_file implementation to a submodule 2025-06-17 13:20:43 +02:00
Badlop 149b715b4f New predefined keyword: LOG_PATH 2025-06-17 13:20:43 +02:00
Stefan Strigler bae345b92b mod_antispam: test dump file 2025-06-17 13:18:13 +02:00
Stefan Strigler 10ec128b94 mod_antispam: test whitelisted domain 2025-06-17 13:18:13 +02:00
Stefan Strigler 7a6e409879 mod_antispam: use message/3 in test 2025-06-17 13:18:13 +02:00
Stefan Strigler ea19e4bc7f mod_antispam: remove unnecessary check in test
this was left over from debugging issues with fixtures
2025-06-17 13:18:13 +02:00
Stefan Strigler 6122a525d2 mod_antispam: fix config types 2025-06-17 13:18:13 +02:00
Badlop b607d95a93 Refactorize each individual test case in individual functions 2025-06-17 13:18:13 +02:00
Stefan Strigler ee46333def add make target test-<group>
Eg. invoke common test for specific test group only like

$ CT_BACKEND=mnesia,redis make test-antispam_single
2025-06-17 13:18:13 +02:00
Stefan Strigler 34b40aec66 mod_antispam: add format instructions 2025-06-17 13:18:13 +02:00
Stefan Strigler 639147be41 fix pubsub retract items being a list of ids 2025-06-17 13:18:11 +02:00
Stefan Strigler c48aa38c39 mod_antispam: add test suite 2025-06-17 13:10:27 +02:00
Stefan Strigler 70bec7b714 tests: update readme and compose to work with current sw versions 2025-06-17 13:10:27 +02:00
Stefan Strigler a7c15eaccf mod_antispam: initial import from ejabberd-contrib/mod_spam_filter 2025-06-17 13:10:27 +02:00
Badlop c78e99dd54 Use auxiliary function to get HOME, use Mnesia directory when not set (#4402) 2025-06-17 13:02:01 +02:00
dependabot[bot] 3196779308 build(deps-dev): bump ex_doc from 0.37.3 to 0.38.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.37.3 to 0.38.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.37.3...v0.38.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-version: 0.38.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 13:02:01 +02:00
Badlop 064b005ec5 Define some example glossary terms 2025-06-17 13:02:01 +02:00
Badlop 2d2b98e525 Update Elvis to 4.1.1, fix some warnings and enable their tests 2025-06-16 16:59:43 +02:00
Badlop 71f623ddbf Fix previous commits 2025-06-16 13:14:07 +02:00
Badlop f03b5f4c44 Support list of IDs in pubsub-items-retract (processone/xmpp#100) 2025-06-16 13:09:52 +02:00
Badlop aff8b47b6c Add dialyzer spec to try to dix warnings 2025-06-16 12:48:34 +02:00
Badlop 6c1452435d Bump xmpp to get: Add Unified Push support (via Conversations/up) (processone/xmpp#101) 2025-06-16 12:24:06 +02:00
Badlop 38f365ffeb Move ecPrivkeyVer1 workaround for Jose from ejabberd to p1_acme
Revert "Add workaround for Jose 1.11.10 not supporting OTP 28 ecPrivkeyVer1 (#4393)"
This reverts commit 363351b18c.
2025-06-16 12:24:01 +02:00
Badlop ed846c4a88 ext_mod: Recommend to write README.md instead txt (processone/ejabberd-contrib#363) 2025-06-09 18:02:40 +02:00
Badlop 8855a304cc ext_mod: Support library path installed from Debian (processone/ejabberd-contrib#363) 2025-06-09 17:53:25 +02:00
Paweł Chmielowski 95a083a6f4 Replace csplit with perl in rebar3-format.sh
Bsd csplit doesn't offer some options that we require, so let's use perl
that should work everywhere
2025-06-06 16:52:28 +02:00
Jérôme Sautret 0bb99bb371 Fix supported version of XEP-0485 2025-06-06 11:57:27 +02:00
Badlop 38cc3ccb1e Avoid using the "else" conditional compilation macro directive
Even if "-else." is a valid directive:
  https://www.erlang.org/docs/28/system/macros.html#conditional-compilation
there is a bug in rebar3_format that annoyingly rewrites it as "- else ."
  https://github.com/AdRoll/rebar3_format/issues/337
as a quick workaround, rewrite directives to not use "-else."
2025-06-05 17:02:41 +02:00
Jérôme Sautret c51b044b3f Fix macro used in string options when defined in env var
Configuration macro defined as EJABBERD_MACRO_* environment variable
couldn't be used inside string options, like this:

captcha_cmd: "tools/@SCRIPT@"
2025-06-05 14:20:11 +02:00
Badlop 363351b18c Add workaround for Jose 1.11.10 not supporting OTP 28 ecPrivkeyVer1 (#4393) 2025-06-04 11:00:00 +02:00
Paweł Chmielowski 167bbc768a Remove unused function 2025-06-02 18:39:51 +02:00
Paweł Chmielowski 591e15f0f6 Fix mnesia to sql exporter after changes to auth tables
Conversion functions used by ej2sql module was not updated after change
that did allow storing multiple passwords per user, which made us skip
passwords that were updated to new format, this fixes this problem.

This fixes issue #4391
2025-06-02 18:19:03 +02:00
Badlop b4a917db09 Runtime: Fix step name 2025-05-30 17:17:32 +02:00
Badlop 7755fcc846 Bump fast_xml and xmpp for improved Erlang/OTP 28 support 2025-05-30 17:17:32 +02:00
Badlop 250af8f06a Fix "make options" in Erlang/OTP 28 (thanks to Alexey Shchepin)(#4352) 2025-05-30 17:17:32 +02:00
Alexey Shchepin 9569e407b5 Don't send empty messages in Matrix rooms (#4385) 2025-05-30 17:27:30 +03:00
Alexey Shchepin 573d5525ec Fix key validation in mod_matrix_gw_s2s:check_signature 2025-05-30 17:27:30 +03:00
Badlop f1de7b008b Use xmpp and p1_acme patched with Erlang/OTP 28 support 2025-05-28 17:36:39 +02:00
Badlop c10e6ded78 Runtime: Use --with-min-erlang to bypass Erlang 25 soft requirement 2025-05-28 17:36:39 +02:00
Badlop 9bc991cb7d CI and Runtime: Add Erlang/OTP 28 to the versions matrix 2025-05-28 17:36:39 +02:00
Badlop ffa7c32d80 Rebar/Rebar3: Update binaries to work with Erlang/OTP 25-28 (#4354)
They are compiled from their git repositories, main branches,
using erlang:25-slim docker image.

To compile ejabberd using rebar/rebar3 and Erlang 20.0 up to 23.3,
you can download the old binaries from ejabberd 21.12, available at:
  https://github.com/processone/ejabberd/raw/21.12/rebar
  https://github.com/processone/ejabberd/raw/21.12/rebar3

To compile ejabberd using rebar/rebar3 and Erlang 24.0 up to 24.3,
you can download the old binaries from ejabberd 24.12, available at:
  https://github.com/processone/ejabberd/raw/24.12/rebar
  https://github.com/processone/ejabberd/raw/24.12/rebar3
2025-05-28 17:36:07 +02:00
Alexey Shchepin 038491d2ec Support older Matrix rooms versions starting from version 4 2025-05-28 13:30:00 +03:00
Paweł Chmielowski 9d1d57cd82 Fix typo in last commit 2025-05-21 15:53:13 +02:00
Paweł Chmielowski c38b2bfc21 Add options that allow to configure proxy used by rest module 2025-05-21 15:37:49 +02:00
Paweł Chmielowski 18e7805ef5 Present mam full text search in xep-431 compatible way
Also offer those fields only on mysql, where full text search is available
2025-05-16 13:33:24 +02:00
Badlop 010eab6e30 When encoding JSON, handle term that is key-value list (#4379) 2025-05-13 12:37:26 +02:00
Badlop 30c8088d73 Fix crash in "rebar3 cover" with Erlang/OTP 28 (#4353) 2025-05-13 12:37:26 +02:00
Badlop 354009033a CI: Don't run "make options" with Erlang/OTP 28 yet because it crashes (#4352) 2025-05-13 12:37:26 +02:00
Badlop bf3f904fe9 Runtime: Don't test rebar2 + OTP 28 because "make rel" fails
When running "make rel":

./rebar  generate
==> rel (generate)
ERROR: generate failed while processing /__w/ejabberd/ejabberd/rel:
{'EXIT',{{badmatch,{error,"Application et is used in release \"ejabberd\" and cannot be excluded"}},
         [{rebar_reltool,generate,2,
                         [{file,"src/rebar_reltool.erl"},{line,53}]},
          {rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,493}]},
          {rebar_core,execute,6,[{file,"src/rebar_core.erl"},{line,418}]},
          {rebar_core,maybe_execute,8,
                      [{file,"src/rebar_core.erl"},{line,302}]},
          {rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,261}]},
          {rebar_core,process_each,5,[{file,"src/rebar_core.erl"},{line,351}]},
          {rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,253}]},
          {rebar_core,process_commands,2,
                      [{file,"src/rebar_core.erl"},{line,93}]}]}}
make: *** [Makefile:570: prod] Error 1
2025-05-13 12:37:14 +02:00
Paweł Chmielowski d65cafae64 Update code for switching to new schema type to users table changes 2025-05-12 18:47:18 +02:00
Marcos de Vera Piquero cda1d4ce7f feat: fire new push_send_notification hook
Do not route XEP-357 IQ notification directly but run it through
registered hooks that will ultimately decide whether or not send it
and, if needed, customize the notification contents.

Hooks can return:

  - a modified IQ packet, as per their business logic
	- the atom `drop`, to effectively cancel the push notification
2025-05-09 14:14:51 +02:00
Paweł Chmielowski 128103b7b2 Typo 2025-04-30 14:44:19 +02:00
Paweł Chmielowski cbb88638d2 Add mssql specific implementation of delete_old_mam_messages 2025-04-30 14:31:05 +02:00
Paweł Chmielowski f046aeeaa2 Fix dialyzer warning in last commit 2025-04-29 12:20:13 +02:00
Paweł Chmielowski bd5f9537c5 Normalize username when determining if user want to change pass in mod_register
Should fix issue #4377
2025-04-29 11:43:17 +02:00
Paweł Chmielowski 838bbd70ef Strip query data when returning errors in mod_register 2025-04-29 10:33:17 +02:00
Paweł Chmielowski e7997244af Allow to specify minimal erlang version using --with-min-erlang in configure 2025-04-28 13:58:40 +02:00
Paweł Chmielowski 3874e71971 Better lists:uniq substitute in ejabberd_config
Original version didn't keep original order of modules, which could break
ability to override of options by external modules.
2025-04-28 12:59:17 +02:00
Paweł Chmielowski 67cc0c5286 Handle objects that don't need conversion in mod_mam_mnesia:transform()
This should fix issue #4374
2025-04-22 12:31:08 +02:00
Badlop 826123db56 Bump Erlang/OTP version to 27.3.3 2025-04-22 12:27:10 +02:00
Badlop 05b0037462 Raise the minimum Elixir tested version to 1.14.0 (#4281)
Cannot test with Elixir 1.13.4 because its container image includes
Erlang/OTP 24.3 that ejabberd does not support anymore.
2025-04-22 12:27:10 +02:00
Badlop 54796f888e Raise Erlang/OTP minimum requirement to 25.0 (#4281) 2025-04-22 12:27:10 +02:00
Badlop 82ec0a4837 Remove unused MyNick variables 2025-04-22 12:27:09 +02:00
Badlop 7167df7979 mysql.sql: Fix typo in commit 7862c6a when creating users table 2025-04-22 12:25:04 +02:00
Paweł Chmielowski 45e7d8426d Make delete_old_mam_messages_batch work with sqlite 2025-04-17 14:21:25 +02:00
Badlop ef754939c4 Set version to 25.04
CI / Tests (25) (push) Failing after 9s
CI / Tests (26) (push) Failing after 0s
CI / Tests (27) (push) Failing after 0s
Container / Container (push) Failing after 45s
Installers / Binaries (push) Failing after 50s
Runtime / Rebars (20, rebar) (push) Failing after 6s
Runtime / Rebars (20, rebar3) (push) Failing after 5s
Runtime / Rebars (25, rebar) (push) Failing after 6s
Runtime / Rebars (25, rebar3) (push) Failing after 4s
Runtime / Rebars (26, rebar) (push) Failing after 7s
Runtime / Rebars (26, rebar3) (push) Failing after 4s
Runtime / Rebars (27, rebar3) (push) Failing after 6s
Runtime / Rebar3+Elixir (1.13) (push) Failing after 7s
Runtime / Rebar3+Elixir (1.14) (push) Failing after 6s
Runtime / Rebar3+Elixir (1.15) (push) Failing after 6s
Runtime / Rebar3+Elixir (1.16) (push) Failing after 6s
Runtime / Rebar3+Elixir (1.17) (push) Failing after 7s
Runtime / Rebar3+Elixir (1.18) (push) Failing after 7s
Runtime / Mix (1.13) (push) Failing after 5s
Runtime / Mix (1.14) (push) Failing after 5s
Runtime / Mix (1.15) (push) Failing after 5s
Runtime / Mix (1.16) (push) Failing after 4s
Runtime / Mix (1.17) (push) Failing after 4s
Runtime / Mix (1.18) (push) Failing after 4s
Installers / Release (push) Has been skipped
2025-04-16 17:58:37 +02:00
Badlop ee3a0b8b1a Bump Erlang/OTP version to 27.3.2
27.3.3 was just release, but image is not yet published in
https://hub.docker.com/_/erlang/tags?name=27.3
2025-04-16 17:20:28 +02:00
Badlop 2182cb60ae CHANGELOG: Fix typos 2025-04-16 13:44:13 +02:00
Badlop 4da8278e66 Update other translations 2025-04-16 13:44:13 +02:00
Badlop 629db496b5 Update Chinese (Simplified) translation (thanks to Sketch6580) 2025-04-16 13:44:13 +02:00
Badlop f79b8e166a Update Ukrainian translation (thanks to Максим Горпиніч) 2025-04-16 13:44:13 +02:00
Badlop fae4ab97fd Update Albanian translation (thanks to Besnik Bleta) 2025-04-16 13:44:13 +02:00
Badlop da8d04a654 Update Portuguese translation (thanks to Silvério Santos) 2025-04-16 13:44:13 +02:00
Badlop ce02fc485f Update Portuguese (Brazil) translation (thanks to Wellington Uemura) 2025-04-16 13:44:13 +02:00
Badlop 69695ffe27 Update German translation (thanks to Nautilusx) 2025-04-16 13:44:13 +02:00
Badlop 6fdb467484 Update man page to 25.04 2025-04-16 13:44:13 +02:00
Badlop d8016a6477 Result of running "make format" 2025-04-16 13:44:13 +02:00
Badlop e43d864184 CI: Bump ubuntu-24.04, and Erlang 25+ (#4281)
Update postgresql preparation:
- ubuntu-20.04 included PostgreSQL 14.13
- ubuntu-24.04 includes PostgreSQL 16.4
and in the meantime, PostgreSQL 15.0 revoked
"the CREATE permission from all users except a database owner from the public (or default) schema."
See https://www.postgresql.org/about/news/postgresql-15-released-2526/
2025-04-16 13:44:07 +02:00
Badlop 4d3681aba1 Annotate kick_users version 2025-04-16 13:43:13 +02:00
Paweł Chmielowski d791f6ceaa Update changelog 2025-04-16 12:56:04 +02:00
Paweł Chmielowski 602a42f5ce Add tests for duplicate occupant-id handling 2025-04-16 11:39:30 +02:00
Paweł Chmielowski c98739d5b5 Replace all occupand_id tags 2025-04-14 16:42:00 +02:00
Paweł Chmielowski 425504454c Allow passing multiple paths in external_beams 2025-04-08 14:21:18 +02:00
Paweł Chmielowski 780031847c Relax limits of shared groups names
We want to normalize it, but we don't need to limit it to what nodeprep
allows (like for example ':' that we see in use)
2025-04-04 11:07:51 +02:00
Paweł Chmielowski c3af613db1 Catch errors from mod_shared_roster:create_group in srg_* commands 2025-04-04 11:07:51 +02:00
Badlop babd01a87f Container: Improve explanation of CTL_ON ignore prefix 2025-04-03 13:43:15 +02:00
Badlop 17b605a32b kick_users command: Move to "Online Users" page, disable auto-execution
kick_users can be considered a "modifier" command with "informative" result
as described in include/ejabberd_commands.hrl

ejabberd_web_admin executes automatically a command if:
- it returns something different than rescode or restuple
- and all its arguments are provided
- and force_execution is set to true or undefined
2025-04-03 13:43:13 +02:00
badlop fc813acd7b Merge pull request #4364 from Quobis/ejabberdctl-kick_users-command
ejabberdctl: add new `kick_users host` command
2025-04-03 12:56:53 +02:00
Badlop d842d6772d CI: Pull Redis image from ECR instead of Docker Hub
Pull images from Amazon ECR (Elastic Container Registry) Public Gallery
instead of Docker Hub to reduce consumption of the pull limits
https://www.docker.com/blog/revisiting-docker-hub-policies-prioritizing-developer-experience/
2025-04-01 16:07:46 +02:00
Badlop 67aaf93157 Runtime: Pull images from ECR instead of Docker Hub
Pull images from Amazon ECR (Elastic Container Registry) Public Gallery
instead of Docker Hub to reduce consumption of the pull limits
https://www.docker.com/blog/revisiting-docker-hub-policies-prioritizing-developer-experience/
2025-04-01 13:42:22 +02:00
Badlop 9154275431 Revert "build(deps): bump stun from 1.2.17 to 1.2.19"
This reverts commit a8a5be7a34.

Don't upgrade to stun 1.2.19 yet, because esip still depends on stun 1.2.17:

Because "the lock" depends on "esip 1.0.57" which depends on "stun 1.2.17", "the lock" requires "stun 1.2.17".
And because "the lock" specifies "stun 1.2.19", no version of "the lock" is allowed.
So, because "your app" depends on "the lock", version solving failed.
** (Mix) Hex dependency resolution failed
2025-04-01 13:42:22 +02:00
Badlop c343ef7aad Container: Apply recent ejabberdctl backward support code 2025-04-01 13:42:22 +02:00
Badlop 78093735b7 ejabberdctl: Add backward support for mnesia path with nodename (#4366) 2025-04-01 12:35:51 +02:00
dependabot[bot] ed6a111982 build(deps): bump XMPP-Interop-Testing/xmpp-interop-tests-action
Bumps [XMPP-Interop-Testing/xmpp-interop-tests-action](https://github.com/xmpp-interop-testing/xmpp-interop-tests-action) from 1.4.0 to 1.5.0.
- [Commits](https://github.com/xmpp-interop-testing/xmpp-interop-tests-action/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: XMPP-Interop-Testing/xmpp-interop-tests-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 12:35:47 +02:00
dependabot[bot] a8a5be7a34 build(deps): bump stun from 1.2.17 to 1.2.19
Bumps [stun](https://github.com/processone/stun) from 1.2.17 to 1.2.19.
- [Changelog](https://github.com/processone/stun/blob/master/CHANGELOG.md)
- [Commits](https://github.com/processone/stun/compare/1.2.17...1.2.19)

---
updated-dependencies:
- dependency-name: stun
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 12:35:44 +02:00
Paweł Chmielowski 5008947e32 Make sqlite update_primary_key when copying data use list of columns and not *
Since * depends on order of columns, if original table have different
column layout we could get resulting columns in wrong order.

This is fix for issue #4365
2025-03-31 11:49:30 +02:00
Marcos de Vera Piquero 0827a5116f ejabberdctl: add new kick_users host command
This new command accepts a host name and will kick all user sessions
found for that given host. The result is the number of kicked
sessions.
2025-03-28 17:45:54 +01:00
Badlop 85d0e93af5 Set version to 25.03
Container / Container (push) Failing after 46s
Installers / Binaries (push) Failing after 51s
Runtime / Rebars (20, rebar) (push) Failing after 4s
Runtime / Rebars (20, rebar3) (push) Failing after 4s
Runtime / Rebars (25, rebar) (push) Failing after 5s
Runtime / Rebars (25, rebar3) (push) Failing after 5s
Runtime / Rebars (26, rebar) (push) Failing after 5s
Runtime / Rebars (26, rebar3) (push) Failing after 4s
Runtime / Rebars (27, rebar3) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.13) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.14) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.15) (push) Failing after 5s
Runtime / Rebar3+Elixir (1.16) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.17) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.18) (push) Failing after 1m34s
Runtime / Mix (1.13) (push) Failing after 5s
Runtime / Mix (1.14) (push) Failing after 5s
Runtime / Mix (1.15) (push) Failing after 5s
Runtime / Mix (1.16) (push) Failing after 4s
Runtime / Mix (1.17) (push) Failing after 5s
Runtime / Mix (1.18) (push) Failing after 5s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27) (push) Has been cancelled
2025-03-28 10:41:53 +01:00
Badlop f677436437 Update changelog to 25.03 2025-03-28 10:41:45 +01:00
Badlop 05f8992e3e Update man page to 25.03 2025-03-28 10:37:29 +01:00
Badlop 2ed7ce49a2 Update documentation about XEP-0424 support and move to proper file (#3340) 2025-03-28 10:37:26 +01:00
Badlop 9087867631 Container: Document the used Erlang and Elixir versions 2025-03-28 10:37:24 +01:00
Badlop f58a0cdbfd Add some apps to rebar2 OTP releases 2025-03-27 22:07:04 +01:00
Badlop 91fb02d62e Result of running "make doap" 2025-03-27 22:07:02 +01:00
Badlop d831fd4789 Result of runing "make translations" 2025-03-27 22:07:01 +01:00
Badlop 322e642f19 Update Chinese (Simplified) translation (thanks to Sketch6580) 2025-03-27 22:07:00 +01:00
Badlop 4967acaec9 Update Ukrainian translation (thanks to Максим Горпиніч) 2025-03-27 22:06:59 +01:00
Badlop 113e5a322e New Tamil translation (thanks to TamilNeram) 2025-03-27 22:06:57 +01:00
Badlop 9c29457ee2 mod_adhoc_api: Fix warning when running "make translations" 2025-03-27 22:06:56 +01:00
Badlop 4fe5ee034c Update version number in documentation to 25.03 2025-03-27 22:06:54 +01:00
Badlop 78650f827e Rephrase auth_stored_password_types documentation 2025-03-27 22:06:52 +01:00
Badlop a4fc448a52 Container: Bump versions to Erlang/OTP 27.3 and Elixir 1.18.3 2025-03-27 22:06:50 +01:00
Paweł Chmielowski 01a71dc189 Restore odbc in dialyzer apps 2025-03-27 18:29:54 +01:00
Paweł Chmielowski 90a200be25 Tag deps 2025-03-27 16:25:12 +01:00
Paweł Chmielowski 9c92fcc92d Fix last commit 2025-03-26 13:03:41 +01:00
Paweł Chmielowski 6f9f4b3635 Fix issues with ldap authentication 2025-03-26 12:52:03 +01:00
Paweł Chmielowski 968fbc9424 Fix compilation on <R25 2025-03-26 11:29:59 +01:00
Paweł Chmielowski 7862c6a7db Add support for storing multiple passwords formats per user
This adds option 'auth_stored_password_types' that can be used to setup
storage of multiple passwords for each user. When this is set, on each
password set, database will now store password in each format specified.
2025-03-26 11:03:39 +01:00
Alexey Shchepin ced72f4a89 Sanitize message ID coming from Matrix 2025-03-25 17:42:31 +03:00
Alexey Shchepin 85dbadee5c Merge branch 'matrix' 2025-03-24 21:09:49 +03:00
Alexey Shchepin cf13abdab6 Preserve XMPP message IDs in Matrix rooms 2025-03-24 20:00:33 +03:00
dependabot[bot] 239d4a5bfb build(deps): bump golang in /.github/container
Bumps golang from 1.23-alpine to 1.24-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 16:16:12 +01:00
Badlop 51e96433ea Add XEPs that are indirectly supported and required by XEP-0479 2025-03-24 16:16:10 +01:00
Badlop 12274a969a ejabberd_config: Recover support for keywords in atom option that will be converted to binary 2025-03-24 16:16:08 +01:00
Badlop 79a4dd4a26 econf: Recover support for setting hosts as atoms in config file 2025-03-24 16:16:06 +01:00
Badlop d9e86600dc Register hooks and iq_handler using the gen_mod support for registrations 2025-03-24 16:16:04 +01:00
Badlop b8cb1bbdcf Register commands using the new gen_mod support 2025-03-24 16:16:02 +01:00
Badlop c180349fc6 gen_mod: Support registering commands and hook_subscribe in start/2 result 2025-03-24 16:16:00 +01:00
Badlop a6fec278c3 ejabberd_commands: Fix command unregistration 2025-03-24 16:15:57 +01:00
Badlop 999ede59ce Update a pair more URLs in documentation 2025-03-24 16:15:53 +01:00
Alexey Shchepin 30a7b0ef3b Better Matrix room topic and room roles to MUC conversion, support room aliases in invites 2025-03-20 17:33:53 +03:00
Badlop 16af90648e Update moved or broken URLs in documentation 2025-03-20 12:52:52 +01:00
Badlop 7723951c05 mod_muc_room: New muc_disco_info_extras event, useful for mod_muc_webchat_url (#3041) 2025-03-20 12:52:28 +01:00
Badlop 1668cde93f Update xmpp to get support for webchat_url (#3041) 2025-03-20 12:52:26 +01:00
badlop 418ca34c85 Merge pull request #4357 from badlop/adhoc_api
New mod_adhoc_api and related improvements
2025-03-20 11:10:43 +01:00
Paweł Chmielowski 6d8e588b78 Allows test to be run using ct_run 2025-03-19 10:40:49 +01:00
Badlop 9bf2d6ce5b mod_configure: Document available alternative API commands 2025-03-19 10:40:01 +01:00
Badlop 496daf9220 mod_adhoc_api: New module to execute API Commands using Ad-Hoc Commands 2025-03-19 10:39:53 +01:00
Badlop 573e06cc0c mod_muc_admin: create_room_with_opts command recommends using ; and = separators 2025-03-19 10:38:10 +01:00
Badlop 6d77ace5c9 mod_http_api: Sort list elements in a command result 2025-03-19 10:38:10 +01:00
Badlop aa78362c7f mod_configure: Add option 'access' to let configure the access name 2025-03-19 10:38:10 +01:00
Badlop 6151674e64 ejabberd_commands: Show warning when registering command with an existing name
In ejabberd modules, only register/unregister commands
if module is not running for any other vhost.
2025-03-19 10:38:10 +01:00
Badlop 1ea0dde417 ejabberd_admin: Allow using mnesia_list_tables and mnesia_table_change_storage 2025-03-19 10:38:10 +01:00
Badlop 53dea7b6d7 Fix email addresses in modules headers 2025-03-18 19:58:47 +01:00
Badlop c87ba45a86 Result of running "make format" 2025-03-18 19:57:38 +01:00
badlop 6ea25e2272 Merge pull request #4350 from badlop/define_keyword
New define_keyword option
2025-03-18 15:48:58 +01:00
Badlop 888c335c2e Add tests for config features define_macro and define_keyword 2025-03-18 13:40:21 +01:00
Badlop 4dcf97c4c1 Now, when running tests, external may contain duplicate module 2025-03-18 13:40:21 +01:00
Badlop 352ee3a318 Docs: Document define_keyword and simplify define_macro 2025-03-18 13:40:21 +01:00
Badlop c8abff33c1 Remove some options keyword expansion, as they are now predefined 2025-03-18 13:40:21 +01:00
Badlop 998690f58c Add support to replace keywords in modules options 2025-03-18 13:40:21 +01:00
Badlop 6e68c2ec02 Add support to replace keywords in listener options 2025-03-18 13:40:21 +01:00
Badlop 896b7c7559 Add support to replace keywords in toplevel options 2025-03-18 13:40:21 +01:00
Badlop 69b190775c Implement internal functions get_predefined and replace keywords 2025-03-18 13:40:21 +01:00
Badlop b769de0690 New option define_keyword 2025-03-18 13:40:21 +01:00
Badlop 19482529ee Inform that define_macro cannot be used inside host_config 2025-03-18 13:40:21 +01:00
Badlop ad8e325139 Disable commands tests for old Erlang/OTP versions
Since recently, this test fails with Erlang/OTP 22 and lower:
  =result        failed:
    {test_case_failed,
     "Received input:
      [{error,{compilation_failed,
         \"/home/runner/.ejabberd-modules/sources/ejabberd-contrib/mod_example/src/mod_example.erl\"}}]
      don't match expected patterns:ok"},
2025-03-18 12:45:25 +01:00
Badlop b901a69f5c mix.exs: Keep debug info when building dev release (thanks to Stefan Strigler) 2025-03-17 15:09:12 +01:00
Badlop 62a165e4cf ejabberd_web_admin: Support commands with tuple arguments; fix list indent 2025-03-17 15:09:10 +01:00
badlop 29616dc163 Merge pull request #4340 from badlop/containers-frictionless
CTL_OVER_HTTP and containers frictionless
2025-03-12 19:40:56 +01:00
Badlop 60324d4b7a CONTAINER.md: Include documentation for ecs container image 2025-03-12 18:19:39 +01:00
Badlop cfa6575b4f CONTAINER.md: Update with all the recent improvements 2025-03-12 18:18:03 +01:00
Badlop 3b01e4e4e0 Container: Fix warning about relative workdir 2025-03-12 18:18:03 +01:00
Badlop fa4a93c465 Container: Place sockets/ outside database/
The socket file is useless outside the container, and also
database/ may get mounted as volume, and can't handle socket file
2025-03-12 18:18:03 +01:00
Badlop 74d6d53ac6 Container: Add ERL_FLAGS to compile elixir on qemu cross-platform
Without this, compiling Elixir on arm64 using QEMU fails with:
 <<"could not call Module.put_attribute/3 because the module ExUnit.DocTest
 is already compiled">>

Solution found in:
  https://elixirforum.com/t/elixir-docker-image-wont-build-for-linux-arm64-v8-using-github-actions/56383/13
2025-03-12 18:18:03 +01:00
Badlop 8070a656fe Container: Use again direct METHOD, qemu got fixed (3983)(4280)
Partially revert d15cf99:
  Container: Add METHOD to build container using packages (3983)
2025-03-12 18:18:03 +01:00
Badlop 105a0c2029 Container: Enable CTL_OVER_HTTP by default 2025-03-12 18:18:03 +01:00
Badlop e887546c27 Container: Copy support for CTL_OVER_HTTP 2025-03-12 18:18:03 +01:00
Badlop 9305232f8c Container: Remove runDeps file once it's used 2025-03-12 18:18:03 +01:00
Badlop 7832a6342a Container: Link path to mnesia spool dir for backwards compatibility
The ejabberdctl script in ecs image sets mnesia spool dir as:
: "${SPOOL_DIR:="$HOME_DIR/database/$ERLANG_NODE"}"
2025-03-12 18:18:03 +01:00
Badlop c924a47188 Container: Improve entrypoint script: register account, or set random
If password variable is set, register that account.
Example kubernetes yaml file in podman:

    env:
    - name: EJABBERD_MACRO_ADMIN
      value: administrator@example.org
    - name: REGISTER_ADMIN_PASSWORD
      value: somePass0rd

If admin and password are not set,
grant admin rights only to a random account name.
Notice that admin rights are granted to that variable in the default
ejabberd.yml, so if the account is not created, somebody else could do.
2025-03-12 18:18:03 +01:00
Badlop 1d42d55064 Container: Compile ejabberdapi during build
Code written originally by sando38 for ecs's Dockerfile.
2025-03-12 18:18:03 +01:00
Badlop dd7550dbad Container: Listen for webadmin in a port number lower than any other
In the docker-desktop and podman-desktop,
when user clicks their "Open Browser" buttons,
those apps open a browser with / URL and the lowest exposed port number.
2025-03-12 18:18:03 +01:00
Badlop 7df7daa050 Container: Define and use macros in the configuration file 2025-03-12 18:18:03 +01:00
Badlop 090a7e664e Container: Apply customizations directly in the configuration file 2025-03-12 18:18:03 +01:00
Badlop 3d49bed0cf Container: Copy main example configuration file, will be customized 2025-03-12 18:18:03 +01:00
Badlop 9f28098d04 Container: Copy files to stable path, add ecs backwards compatibility
Copy captcha scripts to stable path for referencing in compose files:
  /usr/local/bin/
which is included in $PATH

For backwards compatibility with ecs, link:
  /opt/ -> /home/
  /usr/local/bin/ -> /opt/ejabberd/bin/

Copy sql files to stable path for referencing:
  /opt/ejabberd/sql/
For backwards compatibility with ecs, copy also to
  /opt/ejabberd/database/
ecs image implemented this in ejabberdctl since 2019:
  edb0373fd0ae0b24807a41ba2c3bf04b5b514844
  Keep SQL init scripts in container (#42)
2025-03-12 18:18:03 +01:00
Badlop e761b22c61 ejabberd_listener: When opening ctl_over_http connection, log in DEBUG 2025-03-12 18:18:03 +01:00
Badlop 4d62f545c5 ejabberd_admin: Separate Status command result with newline
This is useful for CTL_OVER_HTTP
2025-03-12 18:18:03 +01:00
Badlop f789495c39 ejabberdctl: Improve method to pass command arguments 2025-03-12 18:18:03 +01:00
Badlop 46a64c0f68 New ejabberdctl option CTL_OVER_HTTP
This uses an HTTP connection to execute the command,
which is way faster than starting an erlang node
2025-03-12 18:18:03 +01:00
Badlop ab8a39e71f ejabberdctl: Improve explanation how to stop ejabberd in live mode 2025-03-12 18:18:03 +01:00
Badlop 630301a7ba ejabberdctl: Document the --auth option
The expected placement of --auth is not arbitrary,
it should be provided immediately before the command+args
2025-03-12 18:18:03 +01:00
Badlop d4fd987e84 ejabberd_listener: When stopping listener, delete Unix Domain Socket file 2025-03-12 17:21:46 +01:00
Badlop c5abe5d882 ejabberd_listener: Apparently the sleep 5 seconds isn't needed anymore 2025-03-12 17:09:37 +01:00
Badlop 71dbbc1b5a ejabberd_listener: Use /tmp for temporary socket, as path is restricted to 107 chars 2025-03-12 17:09:37 +01:00
Badlop c9a9585573 ejabberd_listener: Add support for socket relative path
If the 'port' option is set to "unix:some-filename" without absolute path,
then the file is created in the mnesia spool directory
2025-03-12 17:09:37 +01:00
Badlop bb2f398fa2 ejabberd_listener: Handle unix socket when logging remote client 2025-03-12 17:09:37 +01:00
Badlop afc54aeb20 ext_mod: Provide output path when mix unpacks dependency from hex
When installing a module with mix available in the system,
mix downloads and uncompresses the dependency.
By default the output dir is <app>-<version> [1], and
that breaks compilation of the prometheus library:
  .../sources/ejabberd-contrib/mod_prometheus/deps/prometheus-4.11.0/src/metrics/prometheus_quantile_summary.erl:67:14:
  can't find include lib "quantile_estimator/include/quantile_estimator.hrl"
  %   67| -include_lib("quantile_estimator/include/quantile_estimator.hrl").

[1] https://hexdocs.pm/hex/Mix.Tasks.Hex.Package.html#module-command-line-options
2025-03-12 12:42:42 +01:00
badlop 9c142e5509 Merge pull request #4361 from sstrigler/ext_mod-fix-greedy-include-path
Ext mod fix greedy include path cont'd
2025-03-12 10:59:44 +01:00
Stefan Strigler 27f98f50d3 fix typo 2025-03-12 08:11:25 +01:00
Stefan Strigler 0145594adc add $libdir/include to include path 2025-03-12 08:11:07 +01:00
badlop 67ee0de7e3 Merge pull request #4360 from sstrigler/ext_mod-fix-greedy-include-path
fix greedy include path (fixes #4359)
2025-03-11 19:28:52 +01:00
Stefan Strigler 087718c47a fix greedy include path (fixes #4359) 2025-03-11 15:05:54 +01:00
Badlop 6bf5930703 mod_announce: Improve documentation syntax 2025-03-06 22:06:04 +01:00
Badlop 90c4fa2a84 mod_admin_extra: If policy=user, ejabberd adds the user/host args 2025-03-06 22:06:03 +01:00
Badlop b75c3257bd ejabberd_oauth: Commands description should be plain text
The desc field is displayed in "ejabberdctl help", which has
no markdown processing.

If adding links is important, they can be added in the longdesc field.
2025-03-06 22:05:58 +01:00
Badlop 178b09f5bb ejabberd_admin: Fix crash in list_cluster_detailed when a node is down 2025-03-06 22:05:56 +01:00
Badlop 70980efe39 make-binaries: Bump versions to Erlang/OTP 27.3 and Elixir 1.18.3 2025-03-06 22:05:53 +01:00
dependabot[bot] c124dbdd6a build(deps-dev): bump ex_doc from 0.37.1 to 0.37.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.37.1 to 0.37.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.37.1...v0.37.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 22:05:49 +01:00
dependabot[bot] 6af2a65e53 build(deps): bump stringprep from 1.0.30 to 1.0.31
Bumps [stringprep](https://github.com/processone/stringprep) from 1.0.30 to 1.0.31.
- [Changelog](https://github.com/processone/stringprep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/processone/stringprep/compare/1.0.30...1.0.31)

---
updated-dependencies:
- dependency-name: stringprep
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 22:05:48 +01:00
Badlop 54f89e7568 Update XEP-0280 supported version to 1.0.1 2025-03-06 22:05:45 +01:00
Paweł Chmielowski 66205cf648 Merge pull request #4356 from pouriya/ref-new-hook-to-customize-resource-binding
Add c2s_handle_bind hook
2025-03-06 14:19:57 +01:00
Paweł Chmielowski b38d8618b2 Fix crashes when ouath is feed with invalid jid
This should fix issue #4355
2025-02-26 11:17:55 +01:00
p 051093f4f8 ref: c2s_handle_bind hook 2025-02-25 14:11:02 +03:30
Alexey Shchepin 2a85c0a474 Add muc#user element to presences and an initial empty subject 2025-02-24 17:39:57 +03:00
Alexey Shchepin 7018b8b164 Fix gen_iq_handler:remove_iq_handler call in mod_matrix_gw 2025-02-21 12:05:34 +03:00
Alexey Shchepin 41232ccb39 Properly handle IQ requests in mod_matrix_gw 2025-02-21 04:15:08 +03:00
Paweł Chmielowski 6bd4399aee Bubble up db errors in nodetree_tree_sql:set_node 2025-02-20 14:48:45 +01:00
Badlop 45dafbcdcc Result of running "make format" 2025-02-19 11:07:36 +01:00
Badlop a32bfd1215 Show warning also when deprecated listener option is set as disabled (#4345) 2025-02-19 11:07:36 +01:00
Badlop 78f7a9a244 CI: Fix step name, remove obsolete step reference 2025-02-19 11:07:36 +01:00
dependabot[bot] 44782001e2 mix.lock: bump ex_doc from 0.36.1 to 0.37.1
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.36.1 to 0.37.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.36.1...v0.37.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 11:07:26 +01:00
badlop c7d7d07ee4 Merge pull request #4348 from mtstickney/fix_privileged_iq_response_detection
Don't rewrite "self-addressed" privileged IQs as results.
2025-02-18 11:03:04 +01:00
badlop 27390c387d Merge pull request #4341 from mtstickney/route_unprivileged_iqs_from_privileged_component
Accept non-privileged IQs from XEP-0356 privileged components.
2025-02-18 11:02:21 +01:00
Badlop ceee3d3be1 Fix placement of vcard_xupdate documentation 2025-02-14 17:17:13 +01:00
Badlop 983c016bba Update xmpp to get XEP-0317 Hats namespaces version 0.2.0 2025-02-14 16:58:55 +01:00
Badlop 8a7e955453 Update yconf to support macro inside string 2025-02-14 16:58:50 +01:00
Badlop 376f7b261e mod_mam: Mention in documentation that MAM should use some SQL storage 2025-02-14 16:57:32 +01:00
Alexey Shchepin 80423d7e69 Support Matrix room aliases 2025-02-13 16:21:05 +03:00
Holger Weiss da61f3dfea make-binaries: Bump OpenSSL version to 3.4.1 2025-02-11 16:46:45 +01:00
Holger Weiss a49ec4d583 make-binaries: Fix building Termcap and Linux-PAM
Building GNU Termcap and Linux-PAM using the updated toolchain both
failed, since crosstool-NG now uses GCC 14.x, which turns the
"implicit-function-declaration" warning into an error.  See:

https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors

Therefore, specify "CFLAGS=-Wno-error=implicit-function-declaration" to
turn this error back into a warning.
2025-02-07 20:08:26 +01:00
Holger Weiss 5f849bdb3f make-binaries: Bump dependency versions 2025-02-07 15:49:25 +01:00
Holger Weiss d875e0280c make-binaries: Stick to Linux-PAM 1.6.1
Stick to Linux-PAM version 1.6.1 for the moment.  Newer Linux-PAM
versions are built using Meson instead of Autotools, so we need to add
that to our toolchain before being able to update Linux-PAM.
2025-02-07 15:45:59 +01:00
Holger Weiss 4188c062e7 make-binaries: Bump crosstool-NG version to 1.27.0 2025-02-07 15:27:15 +01:00
Badlop 21ae72d02e Result of running "make doap options" 2025-02-06 11:02:17 +01:00
Badlop d834a9c1c1 Delete ejabberd.cfg which apparently isn't needed anymore 2025-02-06 11:02:17 +01:00
Badlop 07b102bb80 Docs: Fix markdown of some toplevel options 2025-02-06 11:02:17 +01:00
Badlop 480e2442ee Improve define_macro option validator 2025-02-06 11:02:17 +01:00
Badlop a9c7bf97ef Add define_macro to globals() because it's useless inside host_config 2025-02-06 10:51:51 +01:00
Badlop cae40c3f72 mod_http_api: Define the option type that opt_type.sh cannot derive itself 2025-02-06 10:51:49 +01:00
Badlop 4f90d1a0d9 Document that XEP-0474 0.4.0 was recently upgraded
Thanks to https://github.com/processone/xmpp/pull/99
2025-02-06 10:51:46 +01:00
Badlop 22b3d0e49f get_auto_url: Don't build auto URL if port is unix domain socket (#4345) 2025-02-06 10:51:44 +01:00
Badlop 0732603a4e Disable opaque_union dialyzer warnings as workaround for dialyzer with Erlang/OTP 28
See
https://github.com/erlang/otp/commit/5dab31e9f991531f2e0de44b896229b686f753f9
2025-02-06 10:51:42 +01:00
Badlop e34b6f4204 Update odbc:connection_reference mention to fix dialyzer with Erlang/OTP 28 2025-02-06 10:51:39 +01:00
Matthew Stickney 64142de4fe Don't rewrite "self-addressed" privileged IQs as results.
process_privilege_iq is meant to rewrite the result of a privileged IQ into
the forwarded form required by XEP-0356 so it can be routed back to the
original privileged requester. It checks whether the impersonated JID
(`ReplacedJid`) of the original request matches the recipient of the IQ
being processed to determine if this is a response to a a privileged IQ
(assuming it has privileged-IQ metadata attached).

Unfortunately, it doesn't check the packet type, and this check will also
match a privileged-IQ _request_ that is being sent to the same user that's
being impersonated. This results in the request itself being rewritten and
forwarded back to the sending component, instead of being processed and
having the result send back.

Instead, just check for IQ results (either a regular result or an error),
and as long as it is marked as being a response to a privileged-IQ, always
rewrite it and forward it to the sending component. There's no circumstance
under which we _shouldn't_ forward a privileged-IQ response, so we don't
need to be tricky about checking whether impersonated-user and recipient
match.
2025-02-01 13:20:10 -05:00
Matthew Stickney a4062f6ac0 mod_privilege: Accept non-privileged IQs from privileged components.
mod_privilege current drops any non-privileged IQ received from a component
with an error about it not being properly wrapped. While this might
represent a mistake on the part of the component, it means that well-
behaved components can no longer send non-privileged IQs (something they
normally can do if mod_privilege isn't enabled).

Since mod_privilege is intended to grant additional permissions, and not
remove existing ones, route non-privileged IQs received from the component
normally.

This also removes the special-case for roster-query IQ stanzas, since
those are also non-privileged and will be routed along with any other
non-privileged IQ packet. This mirrors the privileged-IQ/everything-else
structure of the XEP, which defined the handling of privileged IQ
stanzas and leaves all other IQ stanzas as defined in their own specs.

To make this clearer, the predicate function now returns distinct
results indicating privileged IQs, non-privileged IQs, and error
conditions, rather than treating non-privilege IQs as an error that gets
handled by routing the packet normally.
2025-02-01 13:18:10 -05:00
Holger Weiss 76baf58d5d mod_private: Improve exception handling
Properly isolate the code that should be subject to exception handling.
2025-01-31 14:23:45 +01:00
Holger Weiss e134d7f0b4 mod_private: Don't warn on conversion errors
Clients publish invalid bookmark elements in practice (e.g., bookmarks
with an empty <nick/> element).  The server admin can't address that
issue, so don't spam the log with warnings.
2025-01-31 13:51:37 +01:00
Holger Weiss 20a0051578 mod_private: Handle invalid PEP-native bookmarks
Don't crash while attempting to convert invalid XEP-0402 conference
bookmark elements.
2025-01-31 13:49:22 +01:00
Holger Weiss eca3204e82 mod_private: Don't crash on invalid bookmarks
Catch failures while decoding the conference bookmark element.
2025-01-28 19:37:49 +01:00
Holger Weiss a19ab9f4e3 Update xmpp to bring SSDP to XEP version 0.4 2025-01-25 22:21:43 +01:00
Paweł Chmielowski 133d52d040 Stop processing other handlers in mod_s2s_bidi:s2s_in_handle_info
This should fix issue reported in #4344
2025-01-22 14:12:32 +01:00
Badlop 20a77cb9c7 acl: Fixed bug matching the acl "shared_group: NAME"
This config triggered a crash at client login:

acl:
  tech:
    shared_group: techteam
access_rules:
  announce:
    allow: tech
  configure:
    allow: tech
2025-01-21 13:45:35 +01:00
Badlop cab96d2156 mod_shared_roster: Remove unnecesary double call to split_grouphost
which was added in 5b0f0d8
2025-01-21 13:45:33 +01:00
Badlop 9be76cce9e Fix support for compiling in VSCode 2025-01-21 13:45:28 +01:00
Alexey Shchepin e7035f3235 Fix handling of 3PI events in mod_matrix_gw_room 2025-01-20 09:10:57 +03:00
Badlop 6e4ac0c501 Fix recent commit to work with Erlang/OTP 20 2025-01-16 20:38:43 +01:00
Badlop aa612463cc mod_muc: Document MUC room option vcard_xupdate 2025-01-15 20:33:42 +01:00
Badlop 9827ad43e4 mod_muc_admin: Verify room option value before setting it (#4337) 2025-01-15 20:33:40 +01:00
Badlop e0bb900651 mod_muc_admin: Add forgotten support to set enable_hats room option 2025-01-15 20:33:39 +01:00
Badlop ad1b577ca9 mix.exs: The ex_doc dependency is only relevant for the edoc Mix environment 2025-01-15 20:33:36 +01:00
Badlop f72cfa9a13 Test: Uninstall mod_example when the tests has finished 2025-01-15 20:33:33 +01:00
Paweł Chmielowski 056635119c Fix json version of json_encode_with_kv_list for nested kv lists
This should fix error reported in issue #4338
2025-01-14 10:03:31 +01:00
Badlop 2e754a5557 mod_admin_update_sql: Fix mysql support 2025-01-13 16:34:09 +01:00
Badlop 6959447c2c mod_admin_update_sql: Fix update_sql when using tables created by ejabberd internally 2025-01-13 16:34:07 +01:00
Badlop 4a363b6e76 Test: Fixes to handle re-running test after update_sql
Enable some modules so ejabberd creates their SQL tables
and later those tables can be updated without errors by mod_admin_update_sql
when ci.yml calls "make test" to check update_sql.

However, mod_shared_roster should be stopped before running the actual tests,
as it introduces undesired IQ queries

On the other hand, a few SQL tables are global RAM, and cannot be created
in SQL just for a vhost that is not the first one defined.
2025-01-13 16:34:05 +01:00
Badlop 862cacabcb ejabberdctl.template: Handle erts versions 9 o lower 2025-01-13 16:34:04 +01:00
Badlop 29e6204bde Docs: Reword explanation about ACL names and definitions 2025-01-13 16:34:03 +01:00
Badlop bc6c868c8a Docs: Don't use backtick quotes for ejabberd name
This change improves sentences legibility.
In the Introduction page, use **strong** instead.

Notice backtick quotes are for raw code in markdown, for example:
- `ejabberd` container image
- `ejabberd` script generated by OTP Release
- `ejabberd` username in system, for example for MySQL or container host
2025-01-13 16:34:01 +01:00
Badlop 9d87193d80 mix.lock: Update to recent versions 2025-01-13 16:33:59 +01:00
Badlop 85b660fb4b rebar.config: Bump provider_asn1 version to 0.4.1 2025-01-13 16:33:58 +01:00
Holger Weiss 5a6e46c32a Merge remote-tracking branch 'processone/pr/4297'
* processone/pr/4297:
  mix_pam: Remove 'Channels' roster group of mix channels
2025-01-08 21:23:23 +01:00
Badlop 457d8fc6cc Container: Bump versions to Erlang/OTP 27.2 and Elixir 1.18.1 2025-01-03 11:50:07 +01:00
Badlop 8ebbb45a19 Update copyright year to 2025 (#4139) 2025-01-03 11:49:37 +01:00
Badlop 13dae75d01 Partially revert "Workflows: Bump ubuntu from 22.04 to 24.04 when possible (#4281)"
ubuntu-24.04 includes texinfo 7.1, which has a problematic bug.
Let's revert to ubuntu-22.04 until 24.04 includes a fixed texinfo.

URL to keep an eye:
https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md

This partially reverts commit d3baacd78e.
2025-01-03 11:49:37 +01:00
Badlop 172847bc76 Update path to ejabberd-contrib section in Docs site 2025-01-03 11:49:37 +01:00
Holger Weiss 2b2551bc50 make-binaries: Bump Erlang/OTP version to 27.2 2025-01-02 18:25:24 +01:00
Holger Weiss aa8957f137 make-binaries: Bump dependency versions 2025-01-02 18:24:30 +01:00
badlop ba9a7916db Merge pull request #4333 from di72nn/fix_typos_in_docs
Fix a couple of typos in documentation
2024-12-30 19:45:49 +01:00
Dmitriy Bogdanov 5945dba412 Fix a couple of typos in documentation 2024-12-26 14:55:31 +01:00
Paweł Chmielowski 7d5413ce95 Update xmpp to bring fix for ssdp hash calculation 2024-12-21 20:03:18 +01:00
Holger Weiss 364ee0f8ed ejabberd.yml.example: Enable mod_muc_occupantid
Add mod_muc_occupantid to the list of modules enabled in the sample
configuration.  It's not necessarily obvious that it's required for
using certain modern features in group chat, and there's no downside in
activating this module.
2024-12-21 11:04:08 +01:00
Paweł Chmielowski 213a513f54 Fix name option in documentation 2024-12-20 10:32:21 +01:00
Paweł Chmielowski aa65e626f4 Fix values allowed in db_type of mod_auth_fast documentation 2024-12-20 09:38:03 +01:00
Paweł Chmielowski 5b3b29565c Remove overide on fast_xml 2024-12-19 16:27:16 +01:00
Paweł Chmielowski f38f81159d Fix issue with wrong namespace in mod_s2s_bidi 2024-12-19 14:04:56 +01:00
Badlop 7511307868 Set version to 24.12
Container / Container (push) Failing after 48s
Installers / Binaries (push) Failing after 53s
Runtime / Rebars (20, rebar) (push) Failing after 4s
Runtime / Rebars (20, rebar3) (push) Failing after 5s
Runtime / Rebars (25, rebar) (push) Failing after 4s
Runtime / Rebars (25, rebar3) (push) Failing after 4s
Runtime / Rebars (26, rebar) (push) Failing after 4s
Runtime / Rebars (26, rebar3) (push) Failing after 5s
Runtime / Rebars (27, rebar3) (push) Failing after 4s
Runtime / Rebar3+Elixir (1.13) (push) Failing after 1m21s
Runtime / Rebar3+Elixir (1.14) (push) Failing after 1m29s
Runtime / Rebar3+Elixir (1.15) (push) Failing after 9s
Runtime / Rebar3+Elixir (1.16) (push) Failing after 8s
Runtime / Rebar3+Elixir (1.17) (push) Failing after 9s
Runtime / Mix (1.13) (push) Failing after 5s
Runtime / Mix (1.14) (push) Failing after 5s
Runtime / Mix (1.15) (push) Failing after 5s
Runtime / Mix (1.16) (push) Failing after 5s
Runtime / Mix (1.17) (push) Failing after 5s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27) (push) Has been cancelled
2024-12-19 11:50:21 +01:00
Badlop 1cadc6b1dc CI: Revert old feature that published failed CT logs to website
Nowadays the CT logs can be downloaded from each action run in:
  https://github.com/processone/ejabberd/actions/workflows/ci.yml

This partially reverts commit 8ccad7f
  Publish CT logs and Cover on failure to an external GH Pages repo
2024-12-19 11:21:25 +01:00
Badlop 405437b086 mix.lock, rebar.lock: Update to recent versions 2024-12-19 10:56:30 +01:00
Badlop 51f4382b9f CHANGELOG.md: Update 2024-12-19 10:45:19 +01:00
Holger Weiss e967a409d3 stundisco_tests: Fix TURNS credentials syntax 2024-12-18 22:24:53 +01:00
Holger Weiss eaebfc795e rebar.config: Depend on current xmpp version
We now hard-depend on xmpp 1.9.1.
2024-12-18 21:31:55 +01:00
Holger Weiss 3bc66a7054 stundisco_tests: Check correct credentials syntax 2024-12-18 21:17:07 +01:00
Holger Weiss 8cfcc69100 mod_stun_disco: Fix syntax of credentials response
As per XEP-0215 (#3.3), the response to a credentials request must use
the <credentials/> element rather than <services/>.

Thanks to Thilo Molitor for spotting the issue.
2024-12-18 20:43:03 +01:00
Badlop ce3bc85d32 CHANGELOG.md: Update to 24.12, fix some newlines 2024-12-18 19:23:47 +01:00
Badlop 1fe9e3aa67 CONTAINER.md: Fix some typos 2024-12-18 19:23:45 +01:00
Badlop d93a8e341f mod_http_api: Annotate that default_version was added in new release 2024-12-18 19:23:41 +01:00
Paweł Chmielowski 1107cefdb6 Use tagged deps 2024-12-18 17:29:37 +01:00
Jérôme Sautret 92b2bb7532 Merge branch 'master' of github.com:processone/ejabberd 2024-12-18 16:24:12 +01:00
Jérôme Sautret 9a2a9187cd Revert "Experimental support for joining Matrix rooms as MUC rooms"
This reverts commit eb6f242d99.
2024-12-18 16:23:29 +01:00
Jérôme Sautret 50b57ada7c Revert "Fix dialyzer errors"
This reverts commit e589265921.
2024-12-18 16:22:21 +01:00
Paweł Chmielowski a8649767f2 Pull updated xmpp 2024-12-18 16:03:13 +01:00
Metalhearf 2eb605873c Add security policy and reporting guidelines 2024-12-18 15:51:08 +01:00
Paweł Chmielowski 26e8679359 Make rsm handling in disco items mod_muc, correctly count skipped rooms 2024-12-18 15:07:13 +01:00
Paweł Chmielowski 2aa673e780 Update xmpp dep once more 2024-12-17 15:11:33 +01:00
Paweł Chmielowski 06303ae7ab Relax checks for channels bindings for connections using external encryption
This should fix issue #4322
2024-12-17 13:49:05 +01:00
Paweł Chmielowski 2b3d588f10 Typo 2024-12-17 13:30:04 +01:00
Paweł Chmielowski 3dd7febb98 Fix expiration date calculation in mod_auth_fast 2024-12-17 13:28:54 +01:00
Badlop beb5bfea36 Update man page to 24.12 2024-12-17 12:31:59 +01:00
Badlop 628f286eb6 Update Spanish and Catalan translations 2024-12-17 12:31:57 +01:00
Badlop 9e14c7a803 Update Chinese (Simplified) translation (thanks to Sketch6580) 2024-12-17 12:31:56 +01:00
Badlop 863f2e019c Update Albanian translation (thanks to Besnik Bleta) 2024-12-17 12:31:55 +01:00
Badlop 4334ce9c29 Update Portuguese (Brazil) translation (thanks to Wellington Uemura) 2024-12-17 12:31:54 +01:00
Badlop 7008e49675 Update Italian translation (thanks to Ermete Melchiorre) 2024-12-17 12:31:53 +01:00
Badlop b84596be57 Update French translation (thanks to ButterflyOfFire) 2024-12-17 12:31:52 +01:00
Badlop 4fd26306fe Update German translation (thanks to Nautilusx) 2024-12-17 12:31:51 +01:00
Badlop 8e9ea2d98c Update Bulgarian translation (thanks to MrEddX) 2024-12-17 12:31:49 +01:00
Badlop 1024cbe5b3 Result of running "make doap" 2024-12-17 12:31:48 +01:00
Badlop a16ef68a49 Result of running "make format" 2024-12-17 12:31:47 +01:00
Badlop 7726904f79 Fix comment about file names 2024-12-17 12:31:45 +01:00
Badlop 1481734f47 Update version number to 24.12 2024-12-17 12:31:42 +01:00
Paweł Chmielowski 01955b867d Fix dialyzer warning 2024-12-17 11:13:56 +01:00
Paweł Chmielowski 549a2b0790 Remove message left from debugging 2024-12-17 11:01:11 +01:00
Paweł Chmielowski 2caaa09c99 Add support for XEP-0484: Fast Authentication Streamlining Tokens 2024-12-17 10:56:11 +01:00
Badlop da06a50072 WebAdmin: Use lowercase username and server authentication credentials 2024-12-17 10:13:00 +01:00
Badlop 2b02af13ba CONTAINER.md: Add kubernetes yaml examples to use with podman 2024-12-17 10:12:57 +01:00
Badlop ae238bc984 mod_http_api: Fix crash when module not enabled (for example, in CT tests) 2024-12-17 10:12:55 +01:00
Badlop 3d2036db61 mod_http_api: New option default_version
The server administrator can define default API version
for a vhost using the new module option:

modules:
  mod_http_api:
    default_version: 1

The server administrator can define default API version
for a port using the path:

listen:
  -
    request_handlers:
      /api/v2: mod_http_api

The client can use a specific API version,
regardless of what the admin has set,
by appending it in the URL:

http://localhost:5280/api/v2/get_loglevel/v3
2024-12-17 10:12:53 +01:00
Badlop b8360cae08 Rename argument "name" to "room" for consistency
And thanks to args_rename, both argument names can be used,
either "name" or "room". So, this doesn't involve an API
version change.
2024-12-17 10:12:51 +01:00
Badlop 790cb104cd Change arguments and result to consistent names (API v3)
Commands accept as argument: user, host, room, service
and return as result JIDs

Commands that change in API v3:
get_room_affiliations
muc_register_nick
muc_unregister_nick
set_room_affiliation
status_list
status_list_host
subscribe_room
subscribe_room_many
unsubscribe_room
2024-12-17 10:12:48 +01:00
Badlop f3c935d2e1 Fix some documentation syntax, add links to toplevel, modules and API 2024-12-09 17:25:27 +01:00
Alexey Shchepin e589265921 Fix dialyzer errors 2024-12-06 21:56:02 +03:00
Alexey Shchepin eb6f242d99 Experimental support for joining Matrix rooms as MUC rooms 2024-12-06 20:20:12 +03:00
Badlop ce6d5aa6a0 Redis: Disable some dialyzer warnings when using old Erlang 20 2024-12-05 13:03:43 +01:00
Badlop f269d5b613 Redis: Add support for unix domain socket (#4318) 2024-12-05 13:01:40 +01:00
Badlop a84c492130 Redis: Use the recommended eredis:start_link/1 function 2024-12-05 13:01:38 +01:00
Badlop 3ae636b454 Redis: Use eredis 1.7.1 from Nordix when using mix/rebar3 and Erlang 21+ 2024-12-05 13:01:37 +01:00
Badlop 06e3f9f0a4 Runtime: Disable edoc when using old problematic Elixir versions 2024-12-05 13:01:35 +01:00
dependabot[bot] 1669303a40 Bump ex_doc from 0.34.2 to 0.35.1
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.34.2 to 0.35.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.34.2...v0.35.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 13:01:33 +01:00
Badlop 39e37b6175 Add support to define macros as environment variables
Define and macro by setting as environment variable:
  EJABBERD_MACRO_ + macro name

For example, if you configure in ejabberd.yml:
  define_macro:
    LOGLEVEL: 4
  loglevel: LOGLEVEL

You can define (and overwrite) that macro definition when starting ejabberd:
  EJABBERD_MACRO_LOGLEVEL=5 make relive
2024-12-05 13:01:31 +01:00
Badlop c72ba1f188 mod_scram_upgrade: Update XEP-0480 supported version (processone/xmpp#80) 2024-12-05 13:01:30 +01:00
Badlop 4d625e5574 Erlang/OTP 27 finally exports re:mp/0 2024-12-05 13:01:28 +01:00
Badlop 803f95050f WebAdmin: Fix calculation of node's uptime days 2024-12-05 13:01:26 +01:00
Badlop c021cf34be Explain that join_cluster returns immediately (since 5a34020, 24.06) 2024-12-05 13:01:23 +01:00
Holger Weiss 7fce7d1049 Merge remote-tracking branch 'processone/pr/4323'
* processone/pr/4323:
  Enable allow_unencrypted_sasl2 on websockets
2024-12-03 18:58:25 +01:00
Mark Zealey bd36895afe Enable allow_unencrypted_sasl2 on websockets
https://github.com/processone/ejabberd/commit/47232838 added the
allow_unencrypted_sasl2 option, but this was not added to websockets.
2024-12-03 17:39:58 +00:00
Holger Weiss b90c48f837 mod_scram_upgrade: Don't abort the upgrade
Fix a matching mistake that made the SASL mechanism upgrade fail.
2024-12-01 20:23:52 +01:00
Holger Weiss 344775aa8e mod_pubsub: Send notifications on PEP item retract 2024-11-30 20:38:33 +01:00
Badlop 7d0c20e133 mod_shared_roster: The name of a new group is lowercased
Until now it was possible to create a shared roster group with name
"Group1", and it was a different group that "group1".

From now on, new group names will be stored lowercase,
just like the username in a Jabber ID.

This only affects commands srg_add and srg_create.
All the other commands are still case sensitive, to allow admins of
existing databases with case-sensitive groups manage them.
2024-11-27 16:20:53 +01:00
Badlop ab5a2e8d10 mod_shared_roster: Get back support for groupid@vhost in displayed
Feature first implemented by 262157c in ejabberd 2.1.10
Bug introduced with cache improvements by 5b0f0d8 in ejabberd 21.07
2024-11-27 13:54:02 +01:00
Badlop e34c1ebcba WebAdmin: Fix link to displayed group when it is from another vhost 2024-11-27 13:54:00 +01:00
Badlop 73dbc01c2e WebAdmin: Shared group names are case sensitive, use original case instead of lowercase 2024-11-27 13:53:58 +01:00
Badlop f0773c4ab8 mix:exs: When development tools is enabled, add debugger and wx 2024-11-25 17:23:32 +01:00
Badlop cc5c9f6008 Fix problems introduced in two recent commits 2024-11-25 17:23:28 +01:00
Badlop da9c591eed Improve create_rooms_file command to support vhosts with different config
Until now it created all the rooms in the storage of the first vhost
listed in the ejabberd configuration file. Similarly, it used only
the default room options defined for the first vhost.
2024-11-25 16:20:30 +01:00
Badlop 6790ab01e8 Improve example Elixir modules 2024-11-25 16:20:19 +01:00
Badlop f9cecca362 Rename mod_presence_demo.ex to mod_example.ex 2024-11-25 16:20:16 +01:00
badlop f4009939a6 Merge pull request #4315 from Quobis/support-loading-elixir-modules-for-auth
feat: support loading Elixir modules for auth
2024-11-25 16:08:54 +01:00
Marcos de Vera Piquero 17b5b34e3c feat: support loading Elixir modules for auth
Allow to specify an Elixir module name in `auth_method`.

If the referenced module, `M`,  cannot be loaded as `ejabberd_auth_M`,
try to load it as `Elixir.M`.
2024-11-25 15:31:27 +01:00
Badlop c291c20a3b Fix problem starting ejabberd when first host uses SQL, other one mnesia
The problem appeared when there are several vhosts,
the first vhost uses SQL for persistent data (and RAM for volatile),
and another vhost wants to use Mnesia

Example config to trigger the problem:

  hosts:
    - mysql.localhost
    - localhost
  host_config:
    mysql.localhost:
      default_db: sql

In that case, ejabberd crashed at start with an error like:
[critical] Internal error of module mod_muc has occurred during start:
...
** exception exit: {aborted,
                     {no_exists,
                         [muc_room,
                          [{{muc_room,{'_',<<"conference.localhost">>},'_'},
                            [],
                            ['$_']}]]}}
2024-11-22 19:25:52 +01:00
Badlop 22e7ce37d4 Fix typos in previous commit 2024-11-22 19:25:49 +01:00
Badlop 2137602a6a Makefile: Add support to run "make format" when compiling with mix 2024-11-22 10:53:43 +01:00
dependabot[bot] c7b29b5a9a Bump dialyxir from 1.4.4 to 1.4.5
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeremyjh/dialyxir/compare/1.4.4...1.4.5)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-22 10:53:04 +01:00
Badlop 715b5b64c6 Runtime: Test Dialyzer in Rebars jobs (#4281)
The CI workflow uses ubuntu-24.04 and setup-beam action,
so it can test only Erlang/OTP 24 and higher.

To ensure Dialyzer is also ran with older Erlang versions,
let's add Dialyzer testing to the Runtime workflow,
which uses the erlang container, and that allows
to run Erlang/OTP 20 in ubuntu-24.04.
2024-11-14 13:58:14 +01:00
Badlop c20ed8c7b3 Runtime: Try using elixir container for Rebar3+Elixir and Mix jobs (#4281) 2024-11-14 13:58:11 +01:00
Badlop d3baacd78e Workflows: Bump ubuntu from 22.04 to 24.04 when possible (#4281) 2024-11-14 13:58:07 +01:00
Badlop 07e20784cb New evacuate_kindly command: kick users and prevent login (#4309) 2024-11-14 13:57:47 +01:00
Badlop 9eb8bb6c40 mod_matrix_gw_s2s probably works correctly only in Erlang/OTP >= 25
In Erlang/OTP 25, the function inet_res:getbyname/3
returns {ok, Hostent} where the last tuple element of Hostent
may be h_addr_list = [inet:ip_address()]}
or H_addr_list :: [dns_data()]}

However, in Erlang/OTP 24.1 and older, that element was only of type
h_addr_list = [inet:ip_address()]}

https://erlang.org/documentation/doc-13.0-rc3/lib/kernel-8.4/doc/html/inet_res.html#getbyname-3
https://erlang.org/documentation/doc-12.1/lib/kernel-8.1/doc/html/inet_res.html#getbyname-3
2024-11-14 13:57:47 +01:00
Badlop e10c0f3120 Bump Expat to 2.6.4 2024-11-14 13:57:47 +01:00
Badlop 6f7efebb56 Only delete offline msgs when user has MAM enabled (#4287) 2024-11-14 13:57:43 +01:00
Badlop a657778065 Result of running "make doap" 2024-11-14 13:57:43 +01:00
Badlop 3650d94bb5 Remove XEPs that are only a client thing 2024-11-14 13:57:43 +01:00
Badlop 6a428f3d02 Add ejabberd version and implementation status for many XEPs 2024-11-14 13:57:43 +01:00
Badlop abe1d96c58 Announce support for XEP-0384 OMEMO Encryption (#4305)
The last required piece to support XEP-0384 was
supporting max_items=max, which was added for ejabberd 21.12 in commit
8f8de0403b
2024-11-14 13:57:39 +01:00
Badlop 29a59cfe48 Add "XMPP Date and Time Profiles" implemented by xmpp and used everywhere 2024-11-14 13:49:41 +01:00
Holger Weiss 18c54f4e9e ejabberd.yml.example: Use non-standard STUN port
STUN via UDP can easily be abused for reflection/amplification DDoS
attacks.  Suggest a non-standard port to make it harder for attackers to
discover the service.

Modern XMPP clients discover the port via XEP-0215, so there's no
advantage in sticking to the standard port.
2024-11-14 12:21:58 +01:00
Paweł Chmielowski c7d967a2b5 Fix dialyzer issue 2024-11-05 17:10:09 +01:00
Paweł Chmielowski b50ea7ef1f Make mod_privilge properly handle roster iq 2024-11-05 16:57:52 +01:00
Holger Weiss 4843cd432f Disable the systemd watchdog by default
Some users reported ejabberd being restarted by systemd due to missing
watchdog pings despite the actual service operating just fine.  So far,
we weren't able to track down the issue, so we'll no longer enable the
watchdog in our example service unit.

Closes #4054.
2024-11-05 15:37:21 +01:00
Paweł Chmielowski d56eae809d Catch extra case in check for s2s bidi element 2024-11-05 13:26:42 +01:00
Metalhearf af97211ecc Update URLs in docs/conf files for consistency. 2024-10-31 17:30:20 +01:00
Badlop 601fcba4cb Set version to 24.10
Container / Container (push) Failing after 55s
Installers / Binaries (push) Failing after 49s
Runtime / Rebars (20, rebar) (push) Failing after 4s
Runtime / Rebars (20, rebar3) (push) Failing after 5s
Runtime / Rebars (25, rebar) (push) Failing after 4s
Runtime / Rebars (25, rebar3) (push) Failing after 4s
Runtime / Rebars (26, rebar) (push) Failing after 4s
Runtime / Rebars (26, rebar3) (push) Failing after 4s
Runtime / Rebars (27, rebar3) (push) Failing after 4s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 23.0) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 27) (push) Has been cancelled
Runtime / Mix (1.13, 23.0) (push) Has been cancelled
Runtime / Mix (1.13, 25) (push) Has been cancelled
Runtime / Mix (1.15, 25) (push) Has been cancelled
Runtime / Mix (1.15, 26) (push) Has been cancelled
Runtime / Mix (1.16, 25) (push) Has been cancelled
Runtime / Mix (1.16, 26) (push) Has been cancelled
Runtime / Mix (1.17, 25) (push) Has been cancelled
Runtime / Mix (1.17, 26) (push) Has been cancelled
Runtime / Mix (1.17, 27) (push) Has been cancelled
2024-10-28 17:02:10 +01:00
Badlop cc3a9f7722 Update Changelog to 24.10 2024-10-28 16:34:25 +01:00
Badlop 296ef8287f Remove mod_tombstone from man, it's in ejabberd-contrib (thanks to Licaon_Kter) 2024-10-28 16:34:22 +01:00
Paweł Chmielowski b5dab24679 Update dependencies 2024-10-28 16:21:44 +01:00
Badlop 319414b985 Update man page to 24.10 2024-10-28 13:50:02 +01:00
Badlop 6b0058c89c Add two more version notes 2024-10-28 13:50:02 +01:00
Badlop 855c828d1f Update Spanish and Catalan translations 2024-10-28 13:35:49 +01:00
Badlop c72ef537ee Update Chinese (Simplified) translation (thanks to Sketch6580) 2024-10-28 13:35:47 +01:00
Badlop 11e86811a0 Update Portuguese (Brazil) translation (thanks to Wellington Uemura) 2024-10-28 13:35:46 +01:00
Badlop 2183f60917 Update Italian translation (thanks to Ermete Melchiorre) 2024-10-28 13:35:45 +01:00
Badlop 05f0fbf195 Update Bulgarian translation (thanks to MrEddX) 2024-10-28 13:35:43 +01:00
Badlop 853da159de ejabberd.yml.example: Enable mod_s2s_bidi in default configuration 2024-10-28 12:06:56 +01:00
Badlop 643ae7e5f9 Result of running "make doap options" 2024-10-28 12:06:55 +01:00
Badlop 322e25d18e CI: Get again continue-on-error for XMPP Interop Tests
See explanations following the comment
https://github.com/processone/ejabberd/pull/4285#issuecomment-2397047355

This partially reverts commit 94c2a115d5.
2024-10-28 12:06:53 +01:00
Badlop bdd8ba115e Document ejabberd version of the new modules 2024-10-28 12:06:51 +01:00
Badlop 71ad7c368d Minor improvements to support mod_tombstones
New check_register_user hook in ejabberd_auth.erl
to allow blocking account registration when a tombstone exists.

Modified room_destroyed hook in mod_muc_room.erl
Until now the hook passed as arguments: LServer, Room, Host.
Now it passes: LServer, Room, Host, Persistent
That new Persistent argument passes the room persistent option,
required by mod_tombstones because only persistent rooms should generate
a tombstone, temporary ones should not.
And the persistent option should not be completely overwritten, as we must
still known its real value even when room is being destroyed.

mod_tombstones is available in experimental mode in ejabberd-contrib git.

Initial feature request: #2546
2024-10-28 12:06:48 +01:00
Paweł Chmielowski 8be0f8a0b0 Revert some unrelated changes 2024-10-28 09:44:05 +01:00
Paweł Chmielowski e9e678a994 Add support for scram upgrade tasks 2024-10-28 09:26:04 +01:00
Paweł Chmielowski a89152a3d7 Add support for s2s bidi 2024-10-28 09:25:56 +01:00
Linus Jahn 73f5d950e5 mix_pam: Remove 'Channels' roster group of mix channels
This isn't specified and was probably only meant for debugging. In real
clients having this (forced) 'Channels' group is undesireable in most
cases.
2024-10-26 12:57:15 +02:00
Badlop 46d5ab369f Update xmpp dependency 2024-10-21 17:23:59 +02:00
Badlop 81906b74ed Support "IQ permission" from XEP-0356 0.4.1 (#3889) 2024-10-21 17:23:59 +02:00
Badlop 74b0f64645 mod_block_strangers: Add feature announcement to disco-info (#4039) 2024-10-21 17:23:59 +02:00
Badlop 50948d1619 mod_mam: Advertise XEP-0424 feature in server disco-info (#3340) 2024-10-21 17:23:49 +02:00
Holger Weiss 38f1132192 ejabberd_stun: Omit 'auth_realm' log message
These days, TURN authentication is usually performed using ephemeral
credentials handed out by mod_stun_disco.  In that case, the TURN realm
is irrelevant.  Therefore, omit the misleading log message that warned
about a missing realm configuration.

(Commit 6eb2f07274 reduced the log level
of that message already.)
2024-10-15 22:50:30 +02:00
Badlop 50ef49d190 mod_vcard: Return explicit error stanza when user attempts to modify other's vcard 2024-10-11 11:54:18 +02:00
Badlop 3669ac8aed ejabberd_app: At server start, log Erlang and Elixir versions 2024-10-11 11:54:16 +02:00
Badlop 7f8519c0af ejabberdctl: If ERLANG_NODE lacks host, add hostname (#4288) 2024-10-11 11:49:34 +02:00
dependabot[bot] 859ba3e0c2 Bump dialyxir from 1.4.3 to 1.4.4
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeremyjh/dialyxir/compare/1.4.3...1.4.4)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-11 11:49:30 +02:00
Badlop 94c2a115d5 CI: Disable XMPP Interop specifications that are known to fail 2024-10-11 11:49:28 +02:00
badlop 634b646711 Merge pull request #4285 from guusdk/xmpp-interop-testing
CI: Add XMPP Interop tests
2024-10-11 11:03:26 +02:00
Holger Weiss 2a9dc2c7b2 make-binaries: Bump Erlang/OTP version to 26.2.5.4 2024-10-09 15:37:47 +02:00
Holger Weiss ef93a5359b Bump 'xmpp' dependency tag
This fixes announcing SASL2 over non-TLS connections if
'allow_unencrypted_sasl2' is configured.
2024-10-08 17:38:11 +02:00
Badlop efb1fc9b3f mod_register: Document behavior when access is set to none (#4078) 2024-10-01 15:57:19 +02:00
Badlop aa5faf1f36 mod_privilege: Replace try...catch with a clean alternative 2024-10-01 15:57:15 +02:00
Holger Weiss 4723283896 ejabberd_c2s: Optionally allow unencrypted SASL2
XEP-0388 says: "SASL2 MUST only be used by Clients or offered by Servers
after TLS negotiation".  Therefore, we reject SASL2 negotiations over
unencrypted transports by default.  However, TLS might be terminated
outside of ejabberd.  Add the 'allow_unencrypted_sasl2' option to
support this use case.
2024-09-29 20:40:01 +02:00
Holger Weiss 36187e07d0 mod_pubsub: Fall back to default plugin options
If the plugin handling a node creation request isn't enabled, fall back
to applying the default plugin (currently node_flat) options.
2024-09-28 17:58:07 +02:00
Holger Weiss a9583b43c3 mod_pubsub: Fix choice of node config defaults
Ignore node plugin defaults if the plugin handling the request isn't
enabled, rather than ignoring 'default_node_config' options and
applying plugin defaults in that case.
2024-09-28 17:51:28 +02:00
Holger Weiss ca54f81f58 mod_pubsub: Fix merging of default node options
Use any option specified via 'default_node_config' by default, and take
the remaining defaults from the node plugin handling the request.  This
is the documented behavior.

Before this change, the code applied the plugin defaults only if no
'default_node_config' existed at all.  And even this logic didn't work
as intended, since 'default_node_config' yielded an empty list in case
it wasn't configured, which resulted in plugin defaults never being
applied.
2024-09-28 16:56:46 +02:00
Holger Weiss b4399291ef mod_pubsub: Fix default node config parsing
Don't merge 'default_node_config' settings with the default options of
the first configured node plugin.  Otherwise, the latter might later
override those of the plugin that should handle a node creation request.
For example, the following configuration would lead to the 'flat'
options being used by default for 'pep' nodes as well:

  mod_pubsub:
    plugins:
      - flat
      - pep
2024-09-28 16:45:59 +02:00
Guus der Kinderen a8df58f056 CI: Limit execution of XMPP Interop tests
Run the XMPP Interop tests on only one build of the CI-matrix. This prevents redundant testing, as well as logs overwriting each-other.
2024-09-27 09:55:18 +02:00
Guus der Kinderen 54a89b39fb CI: Add XMPP Interop tests
Modifies the CI build to integrate the GitHub Action-based test runner from the [XMPP Interop Testing project](https://xmpp-interop-testing.github.io). This executes additional integration tests that help verify ejabberd's compliance with XMPP specifications.

In this commit, none of the tests are excluded, which likely results in false positives. Therefor, the 'continue-on-error' flag is set. This should ideally be removed in a later commit.
2024-09-26 21:45:51 +02:00
Badlop 4a931b42ab hooks_deps: Hide false-positive warnings about gen_mod 2024-09-24 12:37:06 +02:00
Badlop 15d73b9d20 Support to block IPs in a vhost using append_host_config (#4038) 2024-09-24 12:20:16 +02:00
Badlop c2d4f73893 Move some modules webadmin pages to their modules 2024-09-16 17:50:47 +02:00
Badlop 31b85351f2 Add new "MAM Archive" page to webadmin 2024-09-16 17:50:46 +02:00
Badlop c900f0ad83 WebAdmin: Improve pages to handle disabled modules 2024-09-16 17:50:44 +02:00
Badlop b2e6749fd2 Fix dialyzer: captcha_cmd is a binary for sure 2024-09-16 17:50:43 +02:00
Badlop 2437dc4e06 New command get_mam_count to get number of archived messages for an account 2024-09-16 17:50:42 +02:00
Badlop 115e7d08aa Add links in user page to offline and roster pages 2024-09-16 17:50:40 +02:00
Badlop d9ddbe0212 Add mam and offline tags to the related purge commands 2024-09-16 17:50:39 +02:00
Badlop 512285e48d Result of running "make options" 2024-09-16 17:50:38 +02:00
Badlop 642e7ecc29 mod_matrix_gw: Remove useless option "persist" 2024-09-16 17:50:37 +02:00
Badlop ce5a8acaf7 Define the types of options that opt_type.sh cannot derive automatically 2024-09-16 17:50:33 +02:00
Holger Weiss 3d9a5a1635 Fix 'update' command output
So far, ejabberd_update:update/0 returned the return value of
release_handler_1:eval_script/1.  That function returns the list of
updated but unpurged modules, i.e., modules where one or more processes
are still running an old version of the code.  Since commit
5a34020d23, the ejabberd 'update' command
assumes that value to be the list of updated modules instead.  As
that seems more useful, modify ejabberd_update:update/0 accordingly.
This fixes the 'update' command output.
2024-09-14 21:54:01 +02:00
Holger Weiss 3469a51f58 mod_pubsub: Don't blindly echo PEP notification
Since commit 514c25caef, whenever a PEP
item was published, a notification was blindly sent back to the owner.
However, this should only be done subject to +notify filtering, as per
XEP-0163:

| the PEP service shall send notifications to all of the account owner's
| available resources (subject to notification filtering).

The motivation for the mentioned commit was that +notify subscriptions
initially didn't work for PEP node owners (#2108).  However, that issue
was fixed by commit 5968bc9318 (#2112).
As a result, the owner's client was actually notified twice if the
client was subscribed to the node (e.g., via +notify).

Therefore, just omit the additional, blind notification.

Thanks to W. Martin Borgert and Daniel Gultsch for reporting the issue.
2024-09-13 20:50:00 +02:00
Paweł Chmielowski d4b30957a3 Skip non-delivery errors for local pubsub generated notifications
Those are ignored by pubsub service anyway, so we can skip those, and
reduce number of messages processed by pubsub process.
2024-09-11 13:20:53 +02:00
Badlop cc377bbebf Update lock files 2024-09-11 11:39:39 +02:00
Badlop eec836239f Improve documentation of ldap_servers and ldap_backups options (#3977) 2024-09-11 11:39:34 +02:00
Badlop 941d51a6e7 Handle call by gen_event:swap_handler (#4233) 2024-09-11 11:39:30 +02:00
Holger Weiss e3243fa35b make-binaries: Update OpenSSL URLs 2024-09-06 19:18:32 +02:00
Holger Weiss 70512c7116 make-binaries: Bump dependency versions 2024-09-06 19:05:12 +02:00
Paweł Chmielowski 3c896d1c6a Better handling of malformed jids in send_direct_invitation command 2024-09-02 12:49:39 +02:00
Paweł Chmielowski b455d93c69 Fix dialyzer warnings 2024-09-02 12:42:55 +02:00
Paweł Chmielowski 017b2feac1 Make set_presence command return error when session not found
Should fix issue #4274
2024-09-02 12:01:56 +02:00
Paweł Chmielowski 5f47860ee1 Remove support for old websocket connection protocol
This removes handling of pre-rfc7395 encapsulation of xmpp in websocket
(where data send in websocket was using just raw data as send in regular
socket). This didn't work correctly for last 5 years, and as we didn't
see complains about this, we can assume it's not used anymore.
2024-09-02 11:55:46 +02:00
Badlop 795498fa45 Runtime: Cache hex.pm archive from rebar3 and mix 2024-08-26 15:50:25 +02:00
Badlop aa1717ee77 CI: Add Elvis tests 2024-08-26 15:50:25 +02:00
Badlop db6d3e63f2 Fix Elvis report: Fix dollar space syntax
https://github.com/inaka/elvis_core/blob/main/doc_rules/elvis_style/no_dollar_space.md
2024-08-26 15:50:25 +02:00
Badlop 0304428d95 Fix Elvis report: Remove spaces in weird places
https://github.com/inaka/elvis_core/blob/main/doc_rules/elvis_style/no_space.md
2024-08-26 15:50:25 +02:00
Badlop 74b80bfe08 Fix Elvis report: Don't use ignored variables
https://github.com/inaka/elvis_core/blob/main/doc_rules/elvis_style/used_ignored_variable.md
2024-08-26 15:48:32 +02:00
Badlop 90ce65e4dc Fix Elvis report: Remove trailing whitespace characters
https://github.com/inaka/elvis_core/blob/main/doc_rules/elvis_text_style/no_trailing_whitespace.md
2024-08-26 15:48:32 +02:00
Badlop d4d9771a71 Makefile: Add support for "make elvis" when using rebar3 2024-08-26 15:48:32 +02:00
Badlop 70ee294079 elvis.config: Fix file syntax, set vim mode, disable many tests
Let's disable the tests that would require major changes in existing
ejabberd source code, and fixing them would produce a curtain of changes
that would difficult using git blame and git log, but provide minimal
benefits.

Don't check erlang header files by now.

Don't check rebar.config because it has customizations that must be
parsed by rebar.config.script to have suitable syntax.
2024-08-26 15:48:32 +02:00
Badlop 5f4d17621f Fix Erlang LS warning about unused macro definitions
Macro name + commit when it was added - commit when usage was removed:

* BATCH_SIZE + f6db8428 - 71c44bff8
* INVALID_SETTING_MSG - 6b126171d - 381065397
* POLICY_ACCESS + 7c1e7e5b - 56d273477
* PROCNAME + 068db1a2 - 6876a37e6
* SALT_LENGTH + e575c87e - 633b68db1
* SERVER + 068db1a2 - but was never used!
* SERVER + f44e23b8c - but was never used!
* STORAGE_TYPES + 92db9ff1 - 9a93acc62
* TCP_SEND_TIMEOUT + f0af10e6 - 6e900d6a8
* TDTD + c3280e9 - 5a34020
* TVFIELD + dcc05ac8 - da310a517
2024-08-26 15:48:32 +02:00
Badlop 8f4179050b erlang_ls.config: Let it find paths, update to Erlang 26, enable crossref 2024-08-26 15:48:32 +02:00
Badlop fddacd51a4 .vscode/launch.json: Experimental support for debugging with Neovim 2024-08-26 15:48:32 +02:00
Badlop e726ba9a8b .vscode/relive.sh: Update to benefit from ejabberd 24.02 behaviour 2024-08-26 15:48:32 +02:00
Badlop da1673e264 mix.lock: Don't mention Relive deps, otherwise they are always downloaded 2024-08-26 15:48:32 +02:00
Badlop 7cd34d3709 CONTAINER.md: Use same general badges in both container images readme files 2024-08-26 15:48:32 +02:00
Paweł Chmielowski ec7fd05987 Update xmpp once more 2024-08-24 15:27:58 +02:00
Paweł Chmielowski 34a58863e3 Update xmpp dep 2024-08-24 13:16:03 +02:00
Paweł Chmielowski 3237a955e5 Fix dep spec for rebar2 2024-08-23 20:56:52 +02:00
Paweł Chmielowski 8e7489c2be Remove duplicate dep from mix.exs 2024-08-23 20:52:36 +02:00
Paweł Chmielowski df5202a2f0 Update deps to bring improved s2s fallback for invalid direct tls connections
This allows connections to server that have both xmpps-server and xmpp-server
srv entries, for which xmpps version doesn't work correctly. Before this
change we would stop on non-working xmpps server, now we will also attempt
to connect further servers on list.
2024-08-23 20:48:53 +02:00
Badlop db3a5d8915 Start ExSync manually to ensure it's started if (and only if) Relive 2024-08-21 10:51:59 +02:00
Badlop 6110f213de Return error stanza when storage doesn't support vcard update (#4266) 2024-08-21 10:51:56 +02:00
Badlop e99fe98db4 Remove from extra_applications the apps already defined in deps (#4265) 2024-08-21 10:51:53 +02:00
Michael Slezak b07e28be2c Fix 'mix release' error: logger being regular and included application (#4265) 2024-08-21 10:51:51 +02:00
Badlop 937d5fe495 Document which SQL servers can really use update_sql_schema 2024-08-21 10:51:49 +02:00
Badlop 01141e5f69 Relax password complexity in test database
This password is not strong enough in MSSQL 2022, relax this restriction
  https://learn.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver16
  https://learn.microsoft.com/en-us/sql/t-sql/statements/create-login-transact-sql?view=sql-server-ver16#check_policy---on--off-
2024-08-21 10:51:46 +02:00
Badlop 15569d0b13 Add links in top-level options documentation to their Docs website sections 2024-08-12 16:25:42 +02:00
Badlop 918806006c Update fast_xml to use use_maps and remove obsolete elixir files 2024-08-09 12:31:37 +02:00
Badlop d5e030a638 CI: Tell sqlcmd to trust server self-signed certificate
As explained in
https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228

Version 18.0 of the Microsoft ODBC Driver 18 for SQL Server has been released.
BREAKING CHANGE - Default Encrypt to Yes/Mandatory.
2024-08-09 12:31:35 +02:00
Badlop 47f1beca0c CI: Update path to sqlcmd command in the mssql container
As mentioned in
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker

Starting with SQL Server 2022 (16.x) CU 14 and SQL Server 2019 (15.x)
CU 28, the container images include the new mssql-tools18 package.
The previous directory /opt/mssql-tools/bin is being phased out.
The new directory for Microsoft ODBC 18 tools is /opt/mssql-tools18/bin,
aligning with the latest tools offering.
2024-08-09 12:31:34 +02:00
Badlop a565b0e4c1 ext_mod: Handle info message when contrib module transfers table ownership 2024-08-09 12:31:29 +02:00
Badlop 10d1704899 mod_muc_rtbl: Fix call to gen_server:stop (#4260) 2024-07-22 13:28:47 +02:00
Badlop bc7c8e3952 Handle case when elixir support is enabled but not available
This happens when:
./configure --with-rebar=rebar3 --enable-elixir
make
rebar3 ct
2024-07-19 18:08:02 +02:00
Paweł Chmielowski 4e35515a8c Also change mysql.new.sql in similar way 2024-07-18 17:55:37 +02:00
Paweł Chmielowski d2a3fe3ed2 Fix column type in comment with schema update 2024-07-18 17:13:45 +02:00
Badlop 9bd1b39f9f Set version to 24.07
Container / Container (push) Failing after 41s
Installers / Binaries (push) Failing after 50s
Runtime / Rebars (20, rebar) (push) Failing after 3s
Runtime / Rebars (20, rebar3) (push) Failing after 3s
Runtime / Rebars (25, rebar) (push) Failing after 3s
Runtime / Rebars (25, rebar3) (push) Failing after 3s
Runtime / Rebars (26, rebar) (push) Failing after 2s
Runtime / Rebars (26, rebar3) (push) Failing after 3s
Runtime / Rebars (27, rebar3) (push) Failing after 2s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 23.0) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 27) (push) Has been cancelled
Runtime / Mix (1.13, 23.0) (push) Has been cancelled
Runtime / Mix (1.13, 25) (push) Has been cancelled
Runtime / Mix (1.15, 25) (push) Has been cancelled
Runtime / Mix (1.15, 26) (push) Has been cancelled
Runtime / Mix (1.16, 25) (push) Has been cancelled
Runtime / Mix (1.16, 26) (push) Has been cancelled
Runtime / Mix (1.17, 25) (push) Has been cancelled
Runtime / Mix (1.17, 26) (push) Has been cancelled
Runtime / Mix (1.17, 27) (push) Has been cancelled
2024-07-18 11:55:10 +02:00
Badlop 20a01a25e4 Update changelog 2024-07-18 11:55:07 +02:00
Badlop 68e69debff Update man page to 24.07 2024-07-18 11:55:05 +02:00
Badlop 7a333eecbe Update more translations translation 2024-07-18 11:11:55 +02:00
Badlop e274bcc87d Update Portuguese (Brazil) translation (thanks to Wellington Uemura) 2024-07-18 11:11:54 +02:00
Badlop c42cb2bbac Update Italian translation (thanks to Ermete Melchiorre) 2024-07-18 11:11:52 +02:00
Badlop 9ee7054823 Update Chinese translation (thanks to Sketch6580) 2024-07-18 11:11:51 +02:00
Badlop 65e16dcac1 make format 2024-07-18 11:11:48 +02:00
Paweł Chmielowski 97c2d6a29d Merge pull request #4259 from heyanyanchina123/fix_mysql
[fix] fix mysql.sql archive origin_id
2024-07-18 09:40:25 +02:00
haha 93cdee80ed [fix] fix mysql.sql archive origin_id 2024-07-18 15:14:39 +08:00
Holger Weiss 11055f61a6 make-installers: Don't edit too much
The init script and systemd units don't refer to "/opt/ejabberd", and
ejabberdctl doesn't refer to "/opt/ejabberd-$version".

Fixes #4258.
2024-07-17 13:33:46 +02:00
Paweł Chmielowski af99799e8a Use tagged deps 2024-07-17 11:11:00 +02:00
Paweł Chmielowski 926f60b2ed Output muc#roominfo_avatarhash in room disco info as per updated xep-0486
This should fix issue #4234.
2024-07-16 18:55:02 +02:00
Badlop 0fdbb03f54 Don't add iex to included_applications
- iex is unnecessary for ejabberd in OTP release
- adding iex breaks dialyzer when --enable-elixir
2024-07-16 17:16:35 +02:00
Badlop bd0332c716 ext_mod: Fix typo in log message 2024-07-16 17:16:33 +02:00
Badlop 45007809f6 CHANGELOG.md: Only include URLs at the end of line for plaintext readability 2024-07-16 17:16:31 +02:00
Badlop 0e0fdb440c CHANGELOG.md: Fix Issues URLs 2024-07-16 17:16:29 +02:00
Paweł Chmielowski 2016cf547f Make dialyzer happy 2024-07-16 15:56:41 +02:00
Paweł Chmielowski ead87e3727 Add option update_sql_schema_timeout to allow schema update use longer timeouts
This also makes batch of schema updates to single table use transaction,
which should help in not leaving table in inconsistent state if some update
steps fails (unless you use mysql where you can't rollback changes to
table schemas).
2024-07-16 15:42:00 +02:00
Paweł Chmielowski f56739fd9f Make any uncatched exception inside transaction trigger rollback 2024-07-16 15:42:00 +02:00
Paweł Chmielowski c5f2b389c3 Allow to configure number of restart in sql_transaction() 2024-07-16 15:42:00 +02:00
dependabot[bot] 4cc95dda42 Bump ex_doc from 0.34.1 to 0.34.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.34.1 to 0.34.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.34.1...v0.34.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-16 11:31:42 +02:00
Badlop 0bfbe3e154 Add ejabberd example config files to the hex package 2024-07-16 11:31:39 +02:00
Badlop 9bd6b11007 Use proper format depending on the formatter (#4256)
This fixes recent commmit 090a8e3
2024-07-16 11:31:35 +02:00
Paweł Chmielowski c013a59d16 Restore args conversion of {"k":"v"} to tuple lists in mod_http_api
Switching to json compatible output did broke this, which caused issues in
for example create_rooms_with_opts command.
2024-07-15 21:58:41 +02:00
Paweł Chmielowski aa02c4de1e Move logger app to included_applications
We don't particularly need this to start with ejabberd, and by having
it always started we will change logger to always use elixir formating.
2024-07-15 21:26:16 +02:00
badlop fb9e2b9603 Merge pull request #4256 from slezakattack/elixir_logger
Fix template error for elixir-enabled applications.
2024-07-15 11:00:07 +02:00
Badlop a70bdc0776 WebAdmin: Fix number of accounts shown in the online-users page 2024-07-15 10:59:16 +02:00
Badlop 936460212f Fix bug in 8a3344e when Elixir enabled but no need to compile elixir files 2024-07-15 10:59:14 +02:00
Holger Weiss 8ac51e63b5 node_pep: Add missing feature
Publishers may specify item identifiers for PEP nodes as well.

(Greetings to Thilo!)
2024-07-14 17:42:40 +02:00
Michael Slezak 090a8e3c95 Fix template error for elixir-enabled applications. 2024-07-12 14:39:42 -06:00
Badlop 101cce0c1e ext_mod: Fetch dependencies from hex.pm when mix is available
This doesn't work when running an OTP release build using mix,
which means it doesn't work in binary installers or containers;
only when using relive, or compiled with rebar3.

Set the desired hex package version in the module's rebar.config
For example, to fetch hex package recon 2.5.5 when mix is available,
and otherwise download using git: in the file
  ejabberd-contrib/ejabberd_observer_cli/rebar.config
set both the hex version and git details:
{deps, [
        {recon, "2.5.5", {git, "https://github.com/ferd/recon"}}
       ]}.
2024-07-12 15:47:10 +02:00
Badlop a935302a19 ejabberd.yml.example: Add api_permissions group for webadmin (#4249) 2024-07-12 15:46:01 +02:00
Badlop 9a0ff13cc2 mod_register: Send welcome message as 'chat' too (#4246)
Apparently, some clients don't display 'normal' messages to the user.
2024-07-12 15:45:59 +02:00
Badlop ef933c07cc WebAdmin: Support groupid with spaces when making shared roster result (#4245) 2024-07-12 15:45:57 +02:00
Badlop df5291e4bd ext_mod: Improve error result when problem compiling elixir file 2024-07-11 16:35:24 +02:00
Badlop 7a8c0331c1 mix.exs: Include Elixir's Logger in the OTP release, useful for libcluster 2024-07-11 16:35:23 +02:00
Badlop 28e37bcaad ext_mod: files_to_path is deprecated, use compile_to_path
As recommended in
https://github.com/elixir-lang/elixir/blob/d9cf285d7104db5a61607afe2ae4322220681a51/lib/elixir/lib/kernel/parallel_compiler.ex#L240
2024-07-11 16:35:21 +02:00
Badlop 8a3344e78a ext_mod: Compile all Elixir files in a library with one function call
Some Elixir libraries have files with dependencies between them.
Compiler can detect and solve those internal dependency if
we call Compile with a list of all the files
https://hexdocs.pm/elixir/1.17.2/Kernel.ParallelCompiler.html#compile/2

This is useful to compile libcluster
2024-07-11 16:35:18 +02:00
Badlop ce95f1f25a WebAdmin: Fix crash when viewing SRG created using ejabberd 24.02 (#4245) 2024-07-11 16:35:16 +02:00
Badlop f1739ce34d mod_register: Add example configuration of welcome_message option 2024-07-11 16:35:12 +02:00
Holger Weiss 1add1de23b ejabberd_options: Add trailing @ to @VERSION@
Thanks to Marc Schink for reporting the issue.
2024-07-05 22:41:18 +02:00
Paweł Chmielowski e25bdba16d Use error_logger when printing startup failure message 2024-07-05 10:25:59 +02:00
Paweł Chmielowski 7c63cd1000 Print message when starting ejabberd application fails 2024-07-05 09:57:21 +02:00
Badlop 4192190a96 Fix problem parsing tuples when using OTP 27 json library (#4242) 2024-07-04 16:55:28 +02:00
Badlop a733ba311c New tests for API commands
Only mod_http_api is tested right now; support to test also
ejabberdctl, ejabberd_xmlrpc and web_admin would be great.

This uses mod_example from ejabberd-contrib

How to run only those tests:
  CT_BACKENDS=no_db rebar3 ct --suite=test/ejabberd_SUITE --group=commands_single
2024-07-04 16:55:14 +02:00
Paweł Chmielowski fe472a63a0 Improve cross version handling of muc retractions 2024-07-04 13:57:25 +02:00
Paweł Chmielowski 25b78b73d0 Add ability to specify custom timeout for sql operations 2024-07-04 11:21:26 +02:00
Paweł Chmielowski b978a47925 Fix unused variable warning 2024-07-03 15:55:48 +02:00
Paweł Chmielowski b44b1304b8 Fix typo in last commit 2024-07-03 15:55:29 +02:00
Paweł Chmielowski a4fd756eae Add misc:json_encode_With_kv_lists and use it in matrix sign function
R27 json module doesn't recognize list of tuples as object specification,
so this creates wrapper that offer this functionality.
2024-07-03 15:20:48 +02:00
Paweł Chmielowski 8d4c1e3617 One more fix for pg91 in test suite 2024-07-03 13:44:48 +02:00
Paweł Chmielowski 54f5db851d Don't use host from url in webadmin, prefer host used for authentication 2024-07-03 13:15:33 +02:00
Paweł Chmielowski 35042ebc6a Make sql query in testsuite compatible with pg9.1 2024-07-03 12:38:48 +02:00
Mickaël Rémond 6c2dfd3d31 Update CODE_OF_CONDUCT.md
Try to limit the number of ping comments in the community. This can get into the way of efficient work and be considered a bit offensive for some users or maintainers.
2024-07-02 15:42:41 +02:00
Badlop 543b874a10 ext_mod: Handle case when contrib module has no *.ex and no *.erl 2024-07-02 13:43:37 +02:00
Badlop 4258d3dc24 Update rebar.lock 2024-07-02 13:43:35 +02:00
Badlop 949649e3a9 Fix typos (thanks to Jerome Sautret) 2024-07-02 13:43:33 +02:00
Pouriya 82d95ac81d feat: Hook subscribers 2024-07-02 12:38:54 +02:00
Alexey Shchepin 3124644315 Fix matrix_id_as_jid option documentation 2024-06-28 05:31:16 +03:00
Badlop 27ba09debf Set version to 24.06
Container / Container (push) Failing after 47s
Installers / Binaries (push) Failing after 51s
Runtime / Rebars (20, rebar) (push) Failing after 3s
Runtime / Rebars (20, rebar3) (push) Failing after 2s
Runtime / Rebars (25, rebar) (push) Failing after 2s
Runtime / Rebars (25, rebar3) (push) Failing after 3s
Runtime / Rebars (26, rebar) (push) Failing after 2s
Runtime / Rebars (26, rebar3) (push) Failing after 3s
Runtime / Rebars (27, rebar3) (push) Failing after 2s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 23.0) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.17, 27) (push) Has been cancelled
Runtime / Mix (1.13, 23.0) (push) Has been cancelled
Runtime / Mix (1.13, 25) (push) Has been cancelled
Runtime / Mix (1.15, 25) (push) Has been cancelled
Runtime / Mix (1.15, 26) (push) Has been cancelled
Runtime / Mix (1.16, 25) (push) Has been cancelled
Runtime / Mix (1.16, 26) (push) Has been cancelled
Runtime / Mix (1.17, 25) (push) Has been cancelled
Runtime / Mix (1.17, 26) (push) Has been cancelled
Runtime / Mix (1.17, 27) (push) Has been cancelled
2024-06-27 15:43:26 +02:00
Badlop 686938045b Update changelog 2024-06-27 15:42:19 +02:00
dependabot[bot] 5645858262 Bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-27 15:11:46 +02:00
Badlop 410c81a51d Update man page to 24.06 2024-06-27 14:54:41 +02:00
Badlop d19bac70ce Update version number of new commands, options and protocols to 24.06 2024-06-27 14:54:40 +02:00
Badlop 9b9eb409b2 join_cluster: Handle also atom arguments, useful for mod_libcluster 2024-06-27 14:54:38 +02:00
Badlop f3ad49ebc4 Fix copy deps *.app file, and strip *.src if present 2024-06-27 14:54:36 +02:00
Badlop 394ba26d1d ext_mod: Support to compile nested *.erl, and include other deps *.hrl
This is useful to compile as a dependency
https://github.com/deadtrickster/prometheus.erl
2024-06-27 14:54:35 +02:00
Badlop cafe28fdea Update other translations 2024-06-27 14:54:32 +02:00
Badlop 22cefeb2bd Update German translation (thanks to Nautilusx) 2024-06-27 14:54:31 +02:00
Badlop 9e4cccd4db Update Polish translation (thanks to Wojciech Teichert) 2024-06-27 14:54:29 +02:00
Badlop 3ff3bdf812 Update Chinese translation (thanks to Sketch6580) 2024-06-27 14:54:27 +02:00
Paweł Chmielowski 45f0f983b1 Override jose version for <R23 in mix to fix compilation with new p1_acme 2024-06-27 14:51:14 +02:00
Paweł Chmielowski 28e94513db Update deps 2024-06-27 14:26:19 +02:00
Badlop afe32e2c05 Fix generate-doap.sh to accept x in the version number 2024-06-25 17:05:56 +02:00
Badlop 0b6d40c9df Log messages not only when node joins the cluster, also when leaves it 2024-06-25 17:05:41 +02:00
Badlop 992d84c002 Add JSON EUnit testing 2024-06-25 17:05:31 +02:00
Badlop 9b675fe775 Add support to test also EUnit suite 2024-06-25 17:05:28 +02:00
Badlop 35783d9a2c Format also files in test/ 2024-06-25 17:05:26 +02:00
Badlop f28e7b37bc Fix call to atom_to_binary/1 for Erlang/OTP older than 23 2024-06-25 17:05:21 +02:00
Badlop eceb9b729f WebAdmin: New login box in the left menu bar 2024-06-25 10:51:23 +02:00
Badlop ce348596b7 WebAdmin: Improve CSS of welcome page, docs links, anchor element 2024-06-25 10:51:22 +02:00
Badlop b85cd9a487 join_cluster_here: New command to join a remote node into our local cluster 2024-06-25 10:51:20 +02:00
Badlop d170885d8d Run "make doap" (#4237) 2024-06-25 10:51:18 +02:00
Badlop 9a6bd83aa1 Remove obsolete code for Erlang/OTP older than 20.0 2024-06-25 10:51:17 +02:00
Badlop 0d31482647 Use newer rebar3_hex with new Erlang, but Erlang 20 requires 7.0.7 2024-06-25 10:51:13 +02:00
Holger Weiss 40c27b54b0 ejabberd_ctl: Fix output of UTF-8-encoded binaries
Converting binary results to char() lists using binary_to_list/1 yields
incorrect results for characters outside the ISO Latin-1 range.
2024-06-19 19:51:50 +02:00
badlop 0380695bba Merge pull request #4228 from badlop/webadmin-commands
Use commands in WebAdmin to generate page content
2024-06-19 18:01:35 +02:00
Badlop 899b77cdf4 ejabberd_ctl: Improve parsing of commas in arguments 2024-06-19 17:59:38 +02:00
Badlop 4819baaa07 Test: Update to the new webadmin pages 2024-06-19 17:59:38 +02:00
Badlop 5a34020d23 WebAdmin: Move content to commands; new pages; hook changes; new commands
Also:
- Added support to view user subpages in the menu
- Webadmin hooks now get the full request
- New commands added to be used in webadmin pages
2024-06-19 17:59:38 +02:00
Badlop 2b1d4ff98d Commands with 'internal' tag: don't list and block execution by frontends 2024-06-19 17:59:38 +02:00
Badlop ed4843b0ed Document 'any' argument and result type, useful for internal commands
Also 'atom' may be used as argument type by some internal commands,
for example the ones that refer to erlang node names.
2024-06-19 17:59:38 +02:00
Badlop 30bd8f1570 WebAdmin: Add make_command functions to produce HTML command element
Support to sort tables using Sortable library from:
  https://github.com/tofsjonas/sortable
2024-06-19 17:59:38 +02:00
Badlop 74d6f0a68d WebAdmin: logo-fill.png is useless since the visual refresh in commit 9eeee67 2024-06-19 17:59:38 +02:00
Badlop 5872ccc992 WebAdmin: Sort alphabetically the menu items, except the most used ones 2024-06-19 17:59:38 +02:00
Badlop 9ee23d3649 WebAdmin: Improve home page
- Update ejabberd WebAdmin logo
- Add hyperlink in disclaimer text
- Add welcome paragraph
2024-06-19 17:59:38 +02:00
Badlop 724f304e48 WebAdmin: Unauthorized response: include some text to direct to the logs 2024-06-19 11:56:16 +02:00
Badlop a16e5a7055 WebAdmin: Remove webadmin_view for now, as commands allow more fine-grained permissions 2024-06-19 11:56:16 +02:00
Badlop 3bda858225 Add Makefile targets to format and indent source code 2024-06-19 11:56:16 +02:00
Badlop 701d2ce0f6 Define kick_user command version 2, useful for the WebAdmin command usage 2024-06-19 11:56:16 +02:00
Badlop be847a7e91 rebar.config.script: Require port_compiler 1.15.0 and accept any 1.15.x 2024-06-19 11:51:03 +02:00
Badlop fff0b5209c Apply previous commit to the container ejabberdctl script 2024-06-19 11:48:33 +02:00
Paweł Chmielowski 2c5a8f0860 Make native dynamic node names work when using fully qualified domain names
This should fix issue reported in 4184
2024-06-13 18:02:13 +02:00
Badlop 103a30df2c Document that XEP-0485 is available in mod_pubsub_serverinfo 2024-06-10 19:03:25 +02:00
Badlop e4c8dbc2af make-binaries: Bump OpenSSL version to 3.3.1 2024-06-10 19:03:13 +02:00
Badlop 882cd8faf5 ejabberd_access_permissions: Fix debug lines indentation that were hard to read 2024-06-10 19:03:06 +02:00
Holger Weiss 7ba9f2e4e8 mod_private: Cope with bookmark decoding errors
Handle invalid XEP-0048 bookmarks gracefully while attempting to publish
them to an XEP-0402 node.
2024-05-28 21:07:04 +02:00
Badlop 52abe8016b Update lock files 2024-05-28 15:36:39 +02:00
Badlop b840ab9907 Revert "Disable update_sql_schema by default"
The update_sql_schema feature was published half a year ago,
included in two releases, it is used by the CI tests,
and consequently it's stable enough to be enabled by default.

This reverts commit ec20691188.
2024-05-28 15:36:39 +02:00
Badlop b977eb7193 Add support for XEP-0425 version 0.3.0, keep supporting 0.2.1 (#4193) 2024-05-28 15:36:39 +02:00
Badlop a179d5e34b mix:exs: Move xmpp from included_applications to applications
because now p1_pgsql has it in applications to satisfy dialyzer OTP 26,
and we cannot have xmpp both in applications and included_applications.
2024-05-28 15:36:39 +02:00
Badlop ab274147d8 Runtime: Add final OTP 27 and preliminary Elixir 1.17 to the matrix 2024-05-28 15:36:39 +02:00
Badlop d81a844e1c make-binaries: Bump versions to Erlang/OTP 26.2.5 and Elixir 1.16.3 2024-05-28 15:21:05 +02:00
Badlop b288d5c763 make-binaries: Revert temporarily an OTP commit that breaks MSSQL (#4178) 2024-05-28 15:21:01 +02:00
Badlop 1b81af00b2 Update p1_pgsql and mysql to support Unix Domain Socket (#3716) 2024-05-28 15:20:57 +02:00
Badlop d04f92d44e mod_muc_room: Use ejabberd hooks instead of function calls to mod_muc_log (#4191) 2024-05-28 15:20:53 +02:00
Badlop 80dc95fc03 Remove unnecessary case from recent commit 599cddf 2024-05-28 15:14:08 +02:00
Badlop a8e36e7b1b CI: Don't load database schema files for mysql and pgsql 2024-05-24 13:21:21 +02:00
Badlop ec13350b24 Test: Enable update_sql_schema
- Test: Enable update_sql_schema by default
- Update test/README about new option
- enable new_schema in tests
2024-05-24 13:21:19 +02:00
Badlop 1076f8bfc2 Test: Clear tables when ending a group, instead of when starting
Because a group may be started but the tables are not yet created,
as they are created automatically when update_sql_schema is enabled.

This modifies commit e2b79ea
2024-05-24 13:21:18 +02:00
Badlop 599cddfb67 ejabberd_sql_schema: Rewrite recent commit cb49fcf
lists:search is available since OTP 21.0, and ejabberd is said to
support since OTP 20.0.
Also, that code wouldn't work if ejabberd uses different database types
(MySQL, PgSQL, ...), as this would only update the first database.
2024-05-24 13:21:16 +02:00
Badlop 034af6aefd Set process flags when Erlang/OTP 27 to help debugging
https://www.erlang.org/blog/highlights-otp-27/#process-labels
2024-05-24 13:21:15 +02:00
Badlop 5d2a111b9c Update lock files 2024-05-24 13:21:13 +02:00
Badlop ca9ca7f5af Use the new port_compiler 1.15.0 that supports Erlang/OTP 27.0
Revert "rebar.config.script: Use port_compiler branch that supports OTP 27.0-rc2"

This partially reverts commit e9b9159d23.
2024-05-24 13:21:12 +02:00
Badlop 677d66d818 Revert "mix.exs: Dirty workaround to get port_compiler with OTP 27 support"
This reverts commit c7c3cc10c5.
2024-05-24 13:21:10 +02:00
Badlop 750bf07e13 Runtime: Define Elixir major versions, and let it pick the latest minor one 2024-05-24 13:21:08 +02:00
Badlop 2cd53410bc Runtime: Avoid testing with OTP 27 + rebar2, because Jose has warnings_as_errors
and we can't disable that option in rebar2 using overrides
2024-05-24 13:21:07 +02:00
Badlop ad7008a545 CI and Runtime: Update Erlang/OTP 27.0-rc3 to 27 2024-05-24 13:21:05 +02:00
Badlop bedfc2e188 rebar.config: Add temporary workaround to compile Jose with Erlang/OTP 27.0 2024-05-24 13:21:04 +02:00
Badlop 83b1a40f8b Run "make doap" 2024-05-24 13:21:02 +02:00
Badlop a05dbcc2b2 Add some XEPs support that was forgotten 2024-05-24 13:21:00 +02:00
Badlop 01f2697faf mod_muc_admin: Update module to the new gen_mod API 2024-05-24 13:20:58 +02:00
Badlop fba915e04e gen_mod: Add support to specify a hook global, not vhost-specific 2024-05-24 13:20:56 +02:00
Badlop 0d1cbc62d4 mod_muc_rtbl: Change this module attribute name to the main one: behaviour
https://erlang.org/documentation/doc-15.0-rc3/doc/system/modules.html#behaviour-module-attribute
2024-05-24 13:20:52 +02:00
Holger Weiss f72cb1b5c8 .gitignore: Ignore ctags/etags files
Running `make TAGS` generates a `TAGS` file, and "vim-erlang-tags"
produces a `tags` file when :ErlangTags is called.
2024-05-19 18:55:38 +02:00
Alexey Shchepin cb49fcf459 Fix handling of mqtt_pub table definition from mysql.sql and fix should_update_schema/1 in ejabberd_sql_schema.erl 2024-05-18 05:18:24 +03:00
Badlop 66a08b6f18 Run "make doap" 2024-05-17 11:36:07 +02:00
Badlop 2554b51173 hook_deps: Use precise name: hooks are added and later deleted, not removed 2024-05-17 11:36:00 +02:00
Badlop d2e7b5ffa0 hook_deps: Fix to handle FileNo as tuple {FileNumber, CharacterPosition} 2024-05-17 11:35:57 +02:00
Badlop 38fd9a3ed2 Update URLs of module documentations 2024-05-10 16:04:28 +02:00
dependabot[bot] 4ec236966a Bump exsync from 0.4.0 to 0.4.1
Bumps [exsync](https://github.com/falood/exsync) from 0.4.0 to 0.4.1.
- [Changelog](https://github.com/falood/exsync/blob/main/CHANGELOG.md)
- [Commits](https://github.com/falood/exsync/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: exsync
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 11:28:19 +02:00
Badlop 696e42b5b4 Use json module when Erlang/OTP 27, jiffy with older ones 2024-05-07 11:28:17 +02:00
Badlop 0ad1d315e8 Use maps instead of tuple+list+tuple as arguments in jiffy functions 2024-05-07 11:28:16 +02:00
Badlop 4697a9295a Update p1_acme that uses Erlang's json library instead of jiffy when OTP 27 2024-05-07 11:28:14 +02:00
Badlop 9fbc7b96e4 Update pkix dependency with minor fixes for compilation warnings 2024-05-07 11:28:11 +02:00
Badlop 392d7ee30b CI and Runtime: Now ejabberd and dependencies can compile with OTP 27.0-rc3 2024-05-02 17:30:21 +02:00
Badlop 025e2a5760 CI and Runtime: Don't get explicitly dependencies (#4213) 2024-05-02 17:30:04 +02:00
Badlop f7dc4fa2ac configure.ac: When using rebar3 with old Erlang, unlock some dependencies (#4213) 2024-05-02 17:29:57 +02:00
Badlop 13ebe89fdc Remove unused format_status/2 callback that is deprecated in OTP 27 2024-04-30 18:00:32 +02:00
Badlop c7c3cc10c5 mix.exs: Dirty workaround to get port_compiler with OTP 27 support 2024-04-30 18:00:29 +02:00
Badlop e9b9159d23 rebar.config.script: Use port_compiler branch that supports OTP 27.0-rc2
If we provide this plugin in ejabberd, then dependencies will not download
the old pc 1.14.0 which doesn't support OTP 27.0-rc2, and will use this one.
2024-04-30 18:00:27 +02:00
Badlop f15d5d073e configure.ac: When using rebar3, unlock dependencies that are disabled (#4212) 2024-04-30 18:00:25 +02:00
Badlop b461657407 Bump idna from 6.0.0 to 6.1.1
Bumps [idna](https://github.com/benoitc/erlang-idna) from 6.0.0 to 6.1.1.
- [Changelog](https://github.com/benoitc/erlang-idna/blob/master/CHANGELOG)
- [Commits](https://github.com/benoitc/erlang-idna/compare/6.0.0...6.1.1)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 18:00:23 +02:00
Badlop 0da767f568 ban_account/unban: When mod_private is disabled, return meaningful error (#4201) 2024-04-30 18:00:21 +02:00
Badlop 395a73bbe0 Handle case when mod_private is not enabled (#4201) 2024-04-30 18:00:18 +02:00
Badlop 5870e2e378 Use updated xmpp library with minor improvement in auth (#4201) 2024-04-30 18:00:16 +02:00
Badlop 94a0aa6967 Add support to provide ban detail when account logins (#4201) 2024-04-30 18:00:14 +02:00
Badlop 2bfc4b0f5d Use "jabber:" namespace that clients cannot use (#4201)
As mentioned in:
  Certain namespaces are reserved in Jabber (namespaces beginning with
  'jabber:' or 'http://jabber.org/', as well as 'vcard-temp').
  If a user attempts to get or set jabber:iq:private data in a reserved
  namespace, historically some server implementations have chosen to
  return an error (commonly "Not Acceptable") to the sender.

  https://xmpp.org/extensions/xep-0049.html#example-5
2024-04-30 18:00:12 +02:00
Badlop 374f6b8e7d Improve recent commit so users cannot prevent banning, fixes 44bafa4 (#4201) 2024-04-30 18:00:11 +02:00
Badlop 33c6b3700e Ammend ejabberd_admin:update/0 from adbccbe to be used by Rebar3 Sync 2024-04-30 18:00:08 +02:00
Badlop eb975268f4 Add ExSync tool to "make relive" with Mix
How to use:
- Compile ejabberd with Mix
- Start ejabberd with "make relive"
- Edit some ejabberd source code file
- Save the file, and ExSync will compile and reload it automatically

ExSync depends on FileSystem library, which requires inotify-tools, see
https://github.com/falood/file_system#system-support

References:
https://hex.pm/packages/exsync
https://github.com/falood/exsync
2024-04-30 18:00:06 +02:00
Badlop b0afe4946d Add Sync tool to "make relive" with Rebar3
How to use:
- Compile ejabberd with Rebar3
- Start ejabberd with "make relive"
- Edit some ejabberd source code file
- Save the file, and Sync will compile and reload it automatically

I've added src_dirs option so Sync doesn't act on dependencies,
which would produce many garbage log lines.
However, now it only works if the parent directory is named "ejabberd"

Sync requires at least Erlang/OTP 21, which introduced the
new try-catch syntax to retrieve the stacktrace
https://www.erlang.org/patches/otp-21.0

References:
https://hex.pm/packages/sync
https://github.com/rustyio/sync
2024-04-30 17:59:59 +02:00
Badlop 5c6a399f5b Update links to some moved content in docs.ejabberd.im 2024-04-25 02:55:02 +02:00
Badlop e744665171 Fix links in mix.exs 2024-04-24 13:20:48 +02:00
Badlop 0b16cbddde Remove vcard example config in mod_proxy65, it breaks PDF Docs generation 2024-04-24 13:20:47 +02:00
Badlop 7ea2c6eabf Improve markdown of md files 2024-04-24 13:20:46 +02:00
Badlop 45ca11ecd0 Improve markdown of generated documentation 2024-04-24 13:20:44 +02:00
Badlop d8cdd82bf8 Rewrite vcard example configuration to not require extended format 2024-04-24 13:20:43 +02:00
Badlop 345af5a535 Remove ... in example configuration: it is assumed and reduces verbosity 2024-04-24 13:20:42 +02:00
Badlop 6e5895ce45 Update some modules doc to use the note field 2024-04-24 13:20:41 +02:00
Badlop b70a2fe4cf Support for version note in modules too 2024-04-24 13:20:40 +02:00
Badlop da01d932ea Add some text to examples, so docs Makefile can find and update its syntax 2024-04-24 13:20:39 +02:00
Badlop 7cd5808766 Mark toplevel options, commands and modules that changed in latest version 2024-04-24 13:20:37 +02:00
Badlop c98302b3c0 Now modules themselves can have version annotations in 'note'
This was already supported in module options, toplevel options
and ejabberd_commands.
2024-04-24 13:20:36 +02:00
Badlop cd7eedf589 Update API to mkdocs 2024-04-24 13:20:35 +02:00
Badlop 27bd8852a1 Update name of API section 2024-04-24 13:20:34 +02:00
Badlop effcf0b7cf Update markdown text for version notes, to work with mkdocs 2024-04-24 13:20:33 +02:00
Badlop 71b9db688a Fix markdown indentation of JSON examples 2024-04-24 13:20:32 +02:00
Badlop 8be6dc7758 Use new shorthand to provide URLs relative to ejabberd Docs 2024-04-24 13:20:30 +02:00
Badlop 569f0b303b Use same module shorthand in API documentation than in module docs 2024-04-24 13:20:29 +02:00
Badlop 15e3add909 CHANGELOG.md: Fix markdown syntax to work with MkDocs 2024-04-24 13:20:28 +02:00
Badlop 68c0c4d94f Update doc headers to MkDocs and mention ejabberd version used 2024-04-24 13:20:27 +02:00
Badlop a550a1c55c Fix documentation links to new URLs generated by MkDocs 2024-04-24 13:20:26 +02:00
Badlop 832588f861 mix.lock: Update to get p1_acme fix in ACME IPv6 2024-04-24 13:20:24 +02:00
Paweł Chmielowski 73bcabd2fa Replace muc.example.com with conference.example.com in commands docs
Second form matches what we use by default, and we seen some confusion
between those two when people try to adopt commands from docs to real
usage.
2024-04-23 14:33:34 +02:00
Badlop da8c9f3357 rebar.lock: Track it, now that rebar3 uses loose dependency versioning
This is recommended in Rebar3 documentation:
  [Lock files] should always be checked into source control.
  https://rebar3.org/docs/configuration/dependencies/#lock-files
2024-04-23 13:46:21 +02:00
Badlop 6cfef4f476 mix.lock: Update to latest versions 2024-04-22 18:28:34 +02:00
Badlop e9fbfaf536 Update Luerl to 1.2.0 when OTP>=20, simplifies commit a09f222 2024-04-22 18:28:34 +02:00
Badlop 0407c56605 rebar.config: Update deps version to rebar3's relaxed versioning 2024-04-22 18:28:34 +02:00
Badlop 1a63443e02 rebar.config.script: Support relaxed dependency version (#4192)
Instead of adding another element to the tuple, let's reuse the second
element, which was used only by rebar2, and always has ".*" as value.
2024-04-22 18:28:34 +02:00
Badlop 0345f798bd Update p1_acme to git, to support Jose 1.11.10 and Ipv6 support (#4170) 2024-04-22 18:28:34 +02:00
Badlop ee9d4d56a9 Update Jose to the new 1.11.10 for Erlang/OTP > 23 2024-04-22 18:28:34 +02:00
Badlop 44bafa478e New ban commands use private storage to keep ban information (#4201) 2024-04-22 18:28:15 +02:00
badlop ce57e02769 Merge pull request #4205 from LeszekBlazewski/fix-command-on-start-docs
fix: invalid CTL_ON_CREATE usage in docker-compose example
2024-04-19 18:24:46 +02:00
LeszekBlazewski 64cd794c02 fix: invalid CTL_ON_CREATE usage in docker-compose example 2024-04-19 16:14:05 +02:00
Badlop 9c8ae96f25 Define base64url dependency only when using rebar2 and Erlang<24
base64url is not called directly in ejabberd code since e227940,
it is only required by p1_acme and erlang-jose 1.11.1

erlang-jose 1.11.1 defines base64url dependency as an hex package,
and rebar2 is not able to download it.
For that reason, when compiling ejabberd with rebar2,
we provide a rebar2-friendly base64url dependency definition.
That way when jose is downloaded, that dependency is already available.
2024-04-19 01:50:42 +02:00
Badlop e973360aa7 Test: Fix some minor compilation warnings
- This QueryID is unnecessary since d3aeed8, due to d6e9e03
- DB variable was added in d32a0ce to detect riak and disable some tests,
  but support for Riak was removed later in 3f7d9e3.
- MyJID was added in 5b863c2 but was never actually used
- recv2 return should be checked
2024-04-19 01:50:42 +02:00
dependabot[bot] 697e5b8b6c Bump peaceiris/actions-gh-pages from 3 to 4
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peaceiris/actions-gh-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 01:50:42 +02:00
Badlop 017f609a51 make-binaries: Bump OpenSSL to 3.3.0 2024-04-19 01:50:42 +02:00
Badlop 22f0d44fed make-binaries: Bump Linux-PAM to 1.6.1 2024-04-19 01:50:42 +02:00
Paweł Chmielowski 0fdf58b1ec Add ability to use additional custom errors when parsing options 2024-04-17 14:01:21 +02:00
Badlop 051bf2968a Runtime: Test 27.0-rc1 instead of 27, as port_compiler still fails in rc2 2024-04-12 17:56:02 +02:00
Badlop 4fd83631ec Mention in what ejabberd version was added update_sql_schema option 2024-04-12 16:41:25 +02:00
Badlop a29d54c497 Comment ERTS_VSN variable in ejabberdctl when not used (#4194)
That variable is not used in "make relive" and "make install",
so let's comment the variable in ejabberdctl when preparing
that file for those targets.
2024-04-12 16:41:21 +02:00
Badlop ed6762b8ee Don't name integer and string results in API examples (#4198)
Since ejabberd 24.02, mod_http_api does not name any results,
previously integer and strings were named, but other results were not.
And ejabberdctl obviously does not name results either.
Only ejabberd_xmlrpc does.
Consequently, the documentation should not name results in the examples.
2024-04-12 12:08:03 +02:00
Badlop b6a0c7e57f mod_configure: Retract 'Get User Password' command to update XEP-0133 1.3.0
https://github.com/xsf/xeps/pull/1314
2024-04-12 12:07:50 +02:00
Badlop ba0be28d45 CONTAINER.md: live in podman doesn't strictly require EJABBERD_BYPASS_WARNINGS 2024-04-12 12:07:46 +02:00
Badlop ef5a435480 sql_server option: Mention in what version it was last updated 2024-04-12 12:07:40 +02:00
Paweł Chmielowski 61ad808d26 Fix validation of user field in get_user_subscriptions command
I made it test for valid muc room, instead of just valid username.

This should fix issue #4197
2024-04-11 12:17:02 +02:00
Badlop 426e33d3a6 Fix previous commit: shellcheck reported a warning 2024-04-04 15:58:48 +02:00
Badlop d6d8bce0e4 If INET_DIST_INTERFACE is IPv6, set required option (thanks to Stu Tomlinson)(#4189) 2024-04-04 13:42:09 +02:00
Badlop 7c76f2b764 Handle the "approved" attribute. As feature isn't implemented, discard it (#4188)
Reference:
https://xmpp.org/rfcs/rfc6121.html#roster-syntax-items-approved

Additionally, when roster contains unknown attribute, discard it and
show a warning
2024-04-04 13:42:09 +02:00
Paweł Chmielowski 735516ed37 Don't start sql connection pools for unknown hosts
It's possible to trigger that by passing wrong domain to some ctl commands,
and if you don't have default credentials for sql connections, you get
repeating errors when this pools tries to reconnect from error.
2024-04-04 11:05:34 +02:00
Badlop dbf0fb8e86 Runtime: Run Dialyzer in Mix jobs 2024-04-01 14:26:55 +02:00
Badlop f50b5e1a58 Fix typo in elixir code that breaks 537aac2 when using mix 2024-04-01 14:26:55 +02:00
Badlop 50c74ab821 Fix code:lib_dir call to work with Erlang/OTP 27.0-rc2 2024-04-01 14:26:55 +02:00
Badlop a1b76ac0a9 Container: Update to Elixir 1.16.2 2024-04-01 14:26:55 +02:00
Badlop 49ca325845 make-binaries: Bump to OTP 26.2.3, Elixir 1.16.2, Expat 2.6.2 2024-04-01 14:26:55 +02:00
dependabot[bot] 703e98ec45 Bump ex_doc from 0.31.1 to 0.31.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.31.1 to 0.31.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.31.1...v0.31.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 14:26:55 +02:00
dependabot[bot] 208f798b07 Bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 14:26:55 +02:00
Badlop 059a028c0c CONTRIBUTING.md: Fix markdown 2024-04-01 14:26:55 +02:00
Badlop 7269d171a7 README.md: Fix markdown syntax and add docs badge 2024-04-01 14:26:55 +02:00
Badlop 3ca2d99a47 COPYING: Move the markdown-formatted file to Docs git, keep plaintext file here 2024-04-01 14:26:55 +02:00
Paweł Chmielowski 9ab60935a4 Add update_primary_key command to sql schema updater 2024-03-21 10:58:06 +01:00
Paweł Chmielowski c5437235f3 Make mod_vcard_xupdate send hash after avatar get set for first time
We need to remove info about empty photo in session stored presence after
avatar get set, otherwise as we don't modify presences like that in
mod_vcard_xupdate, we will send presence with updated hash.

This fixes issue #4182
2024-03-20 10:57:12 +01:00
Paweł Chmielowski 537aac24f7 Improve detection of types in odbc
This should fix issue with dialyzer on erlang 26.2.3+
2024-03-18 14:54:32 +01:00
Paweł Chmielowski 8f20dd8425 Test retractons in mam_tests 2024-03-18 12:42:03 +01:00
Badlop 1639471250 Fix crash running export2sql when MAM enabled but MUC disabled
Problem introduced in cfc393a
2024-03-07 18:38:32 +01:00
Badlop fcc5f00e75 Copy from COPYING the sentence about OpenSSL additional permission 2024-03-07 18:38:32 +01:00
Badlop 80b06da56b Download GPL 2 in markdown format
Downloaded file https://www.gnu.org/licenses/old-licenses/gpl-2.0.md
from https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
2024-03-07 18:38:32 +01:00
Badlop 2c1b0bb77b Use shorthands provided by docs.ejabberd.im Makefile, fix markdown syntax 2024-03-07 18:38:32 +01:00
Badlop f5c8406353 Dialyzer: Add support to run Dialyzer with Mix 2024-03-06 15:25:38 +01:00
Badlop c7f76944f3 Dialyzer: Update Elixir code to satisfy dialyzer warnings 2024-03-06 15:25:38 +01:00
Badlop 6542a70c05 Dialyzer: First set alias definitions and then use them in @type 2024-03-06 15:25:38 +01:00
Badlop 5bb94f1d9e Result of running "make options" 2024-03-06 15:25:38 +01:00
Badlop 2378ea9c07 Dialyzer: Replace re:mp dirty workaround from 0bbc255 with other less dirty 2024-03-06 15:25:38 +01:00
Badlop cd30538130 Fix "ejabberdctl iexlive" after "make prod" when using Elixir
The version number in ejabberd is 24.02,
but Elixir requires semver, that is, 24.2.
Use the version() function, which does the conversion.
2024-03-06 15:25:38 +01:00
Badlop 356ee22cc5 Change method from 1bf80e8 to determine if Elixir supports default_formatter function
Dialyzer when using Elixir complains about undefined function module_info.
2024-03-06 15:25:38 +01:00
Badlop 281515cd9f mod_muc_log: Hide join/leave lines, add method to show them 2024-03-06 15:25:32 +01:00
Badlop c0055b7a7f mod_muc_log: Support allowpm introduced in 2bd61ab 2024-03-06 15:23:16 +01:00
Holger Weiss 6bdbafcd5c Merge remote-tracking branch 'processone/pr/4169'
* processone/pr/4169:
  mod_mam: Document that XEP-0441 is implemented as well
2024-03-04 11:30:53 +01:00
Melvin Keskin a29955ff96 mod_mam: Document that XEP-0441 is implemented as well 2024-03-03 21:05:57 +01:00
Badlop 91cca3cff3 mod_conversejs: Simplify support for @HOST@ in default_domain option (#4167) 2024-02-28 13:06:49 +01:00
Badlop 716f5de517 mod_matrix_gw: Fix support for @HOST@ in matrix_domain option (#4167) 2024-02-28 13:06:47 +01:00
Paweł Chmielowski aac0e782d0 Don't use ejabberd_config:get_myhosts() 2024-02-28 12:24:50 +01:00
Paweł Chmielowski c69884fa3f Config reload should update loger settings part 2 2024-02-28 12:03:42 +01:00
Paweł Chmielowski 06675e4fb2 Improve validation of arguments in mod_muc_admin commands
This adds validation to couple command where they were missing and catch
passing unknown hostnames.
2024-02-28 12:01:14 +01:00
Paweł Chmielowski ad67710f7e Make config reload update new logger settings 2024-02-28 11:46:30 +01:00
Badlop 654601ff23 Set version to 24.02
Container / Container (push) Failing after 1m44s
Installers / Binaries (push) Failing after 1m32s
Runtime / Rebars (20, rebar) (push) Failing after 4s
Runtime / Rebars (20, rebar3) (push) Failing after 3s
Runtime / Rebars (25, rebar) (push) Failing after 3s
Runtime / Rebars (25, rebar3) (push) Failing after 3s
Runtime / Rebars (26, rebar) (push) Failing after 3s
Runtime / Rebars (26, rebar3) (push) Failing after 3s
Runtime / Rebars (27, rebar) (push) Failing after 47s
Runtime / Rebars (27, rebar3) (push) Failing after 2s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
CI / Tests (26) (push) Has been cancelled
CI / Tests (27.0-rc1) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13.4, 23.0) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.13.4, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15.7, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15.7, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.15.7, 27.0-rc1) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 25) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 26) (push) Has been cancelled
Runtime / Rebar3+Elixir (1.16, 27.0-rc1) (push) Has been cancelled
Runtime / Mix (1.13.4, 23.0) (push) Has been cancelled
Runtime / Mix (1.13.4, 25) (push) Has been cancelled
Runtime / Mix (1.15.7, 25) (push) Has been cancelled
Runtime / Mix (1.15.7, 26) (push) Has been cancelled
Runtime / Mix (1.15.7, 27.0-rc1) (push) Has been cancelled
Runtime / Mix (1.16, 25) (push) Has been cancelled
Runtime / Mix (1.16, 26) (push) Has been cancelled
Runtime / Mix (1.16, 27.0-rc1) (push) Has been cancelled
2024-02-27 10:32:55 +01:00
Badlop d29ef59514 Update links to SQL files in the man page 2024-02-27 10:06:40 +01:00
Badlop e3e8b9afb4 COMPILE.md: Update text about OTP release to match current behaviour
Also keep this document direct, short and introductory, there's a
already a section in the ejabberd Docs site with all the details.
2024-02-27 10:06:39 +01:00
Badlop a8e3af3586 Update Japanese translation (thanks to Mako N) 2024-02-27 10:06:37 +01:00
Badlop 11ff7d1ff9 Update Italian translation (thanks to Ermete Melchiorre) 2024-02-27 10:06:36 +01:00
Badlop b04b16825f Revert "CI: Don't run CT with OTP 27 until "Peer certificate rejected" gets solved"
This recent fix in fast_tls solves the problem:
https://github.com/processone/fast_tls/commit/528d9759d6bec714115b5042827726d03e4de0ed

This reverts commit 95e9a63dcb.
2024-02-27 10:06:34 +01:00
Paweł Chmielowski 0f43a7f36b Update deps 2024-02-26 17:26:30 +01:00
Badlop 95e9a63dcb CI: Don't run CT with OTP 27 until "Peer certificate rejected" gets solved 2024-02-26 16:16:19 +01:00
Badlop 146d958fc0 CHANGELOG.md: Update to match the newest commits 2024-02-26 16:16:17 +01:00
Badlop bb349d6085 Update "make edoc" to use ExDoc 2024-02-26 16:16:14 +01:00
Badlop cb9053cd79 Makefile.in: Inform what build tools support some tasks 2024-02-26 16:16:13 +01:00
Badlop 4146f19814 Update man page 2024-02-26 16:16:11 +01:00
Badlop 79eca7c098 Update version number from the unreleased 24.01 to 24.02 2024-02-26 16:16:09 +01:00
Badlop 723c53e1df Revert "Container: Update make-binaries to support setup-beam v1.17.2"
We can now revert commit c81a47a692
because erlef/setup-beam v1.17.3 has recovered its original behavior in
https://github.com/erlef/setup-beam/commit/951dd857ae77719ae708c8feb0d9224247a5ac43
2024-02-26 16:16:08 +01:00
Badlop daca3b558b Use another example, because "archive" is replaced when generating EDoc 2024-02-26 16:16:06 +01:00
Badlop 2075480b14 Improve some documentation: URLs are parsed later when preparing Docs 2024-02-26 16:16:05 +01:00
Badlop e43194d59b README.md: Fix typo in link to COPYING file: its name is plain-text, not markdown 2024-02-26 16:16:03 +01:00
Badlop 8bbc27fd39 CHANGELOG.md: Fix warnings reported by "make edoc" 2024-02-26 16:16:01 +01:00
Badlop 9a9a466bd4 CHANGELOG.md: Lower markdown headers level so they get better rendered 2024-02-26 16:16:00 +01:00
Badlop 92c533f42a CONTRIBUTING.md: Remove anchor with name attribute 2024-02-26 16:15:58 +01:00
Badlop 863b7eee8b CONTAINER.md: Update documentation about sofware version numbers 2024-02-26 16:15:56 +01:00
Badlop 417294339d Matrix: Minor documentation improvements 2024-02-26 16:15:51 +01:00
Holger Weiss 6aaefc663b Fix XEP-0425: Message Moderation with SQL storage
Use the correct server name and room JID when removing moderated
messages from SQL.
2024-02-24 22:06:36 +01:00
Jérôme Sautret a6b10ac4c0 Merge branch 'master' of github.com:processone/ejabberd 2024-02-23 12:09:51 +01:00
Jérôme Sautret 2b7b92edee Add mod_matrix_gw doc 2024-02-23 12:09:10 +01:00
Paweł Chmielowski f4de0cef26 Add alternative types that should fix dialyzer on r26 2024-02-22 17:25:56 +01:00
Paweł Chmielowski 1b5a9c1a1f Fix dialyzer warnings in ejabberd_sql in R27 2024-02-22 16:12:04 +01:00
Badlop a09f222b4c Use Luerl 1.0 for Erlang 20, 1.1.1 for 21-26, and temporary fork for 27
The Luerl 1.1.0 and 1.1.1 hex packages contain garbage files that
break compilation with Erlang 20.
2024-02-21 16:46:37 +01:00
Badlop 5fb76b4918 Use http_uri only when matrix requires it, ammend commit 59ff77e 2024-02-21 16:46:37 +01:00
Badlop 27d5a1d5bb configure.ac: Update enable-tools description to its current usage 2024-02-21 16:46:37 +01:00
Badlop ba1917d23c vars.config.in: Remove comment that nowadays is obsolete 2024-02-21 16:46:37 +01:00
Badlop 0b37d50dac rebar.config.script: Don't check REBAR_PROFILE here
To get release with development tools,
don't check rebar profile here.
Instead, use "./configure --enable-tools" and it will be
checked in ejabberd.app.src.script
2024-02-21 16:46:37 +01:00
Badlop 9275bf40b2 Rebar3/Mix: If dev profile/environment, enable tools automatically 2024-02-21 16:46:37 +01:00
Badlop 4431fbbe5a Include only observer; runtime_tools is automatically added 2024-02-21 16:46:37 +01:00
Badlop 8c64ce67fc CI/Runtime: Test also with the new Erlang/OTP 27.0-rc1 2024-02-21 16:46:26 +01:00
Badlop 1ddc4a5c5d CI/Runtime: For OTP < 24 use rebar binaries from ejabberd 21.12 2024-02-21 16:45:28 +01:00
Badlop 081cab821b Rebar/Rebar3: Update binaries to work with Erlang/OTP 24-27
They are compiled from their git repositories, main branches,
using erlang:24-slim docker image.

To compile ejabberd using rebar/rebar3 and Erlang 20.0 up to 23.3,
you can download the old binaries from ejabberd 21.12, available at:
  https://github.com/processone/ejabberd/raw/21.12/rebar
  https://github.com/processone/ejabberd/raw/21.12/rebar3
2024-02-21 16:45:24 +01:00
Badlop efe5c76469 Runtime: Test compilation with the included rebar/rebar3 binaries 2024-02-19 15:33:09 +01:00
Badlop 16c9b169f2 Runtime: Properly purge nginx in Rebars job, as done in commit 853f35c 2024-02-19 15:33:09 +01:00
Badlop 73f20a8f1e Makefile: Now --with-rebar detects if it's system-installed, otherwise use local one 2024-02-19 15:33:09 +01:00
Badlop 70e430cff1 Makefile: No need to use escript to run rebar|rebar3|mix
Usage of escript to run rebar was added to Makefile.in
when support for rebar2 was added in 4d8f770 for ejabberd 13.10.
Nowadays this seems unnecessary, and configure.ac right now can
determine what binary to use: the sysmte installed or local one.
2024-02-19 15:33:09 +01:00
Badlop aa21aee14b configure: If --with-rebar=rebar3 but rebar3 not system-installed, use local one 2024-02-19 15:33:09 +01:00
Badlop 59ff77e171 Matrix: Fix commit 816900a for OTP below 25.0
uri_string:quote was added in OTP 25.0
2024-02-19 15:33:09 +01:00
Paweł Chmielowski 045170a67e Fix dialyzer warning on R26 in mod_matrix* 2024-02-19 12:08:56 +01:00
Alexey Shchepin c9deea1f6f Bugfix in mod_matrix_gw_room:get_sender_power_level 2024-02-19 14:05:25 +03:00
Alexey Shchepin c10f2a22b6 Fix dialyzer errors 2024-02-16 06:00:57 +03:00
Alexey Shchepin 45f24c63cb Update mod_matrix_gw copyright dates 2024-02-15 09:38:14 +03:00
Badlop 18cb0bca19 Fix compilation with Erlang/OTP 27: don't use the reserved word 'maybe' 2024-02-15 01:57:44 +01:00
Badlop 071dc08405 Container: Support OTP versions with "-rc" string 2024-02-15 01:57:42 +01:00
Badlop b8181974ec Replace 'if' preprocessor directive with 'ifndef', add OTP_BELOW_24
The 'if' preprocessor directive was added in Erlang/OTP 21.0,
but ejabberd currently supports Erlang 20.0 and higher...
Let's use 'ifndef' instead.

https://www.erlang.org/doc/reference_manual/macros.html#flow-control-in-macros
https://www.erlang.org/doc/apps/compiler/notes#compiler-7.2
https://www.erlang.org/patches/otp-21.0#compiler-7.2
2024-02-15 01:57:41 +01:00
Badlop 816900a6cf Use uri_string module instead of the deprecated http_uri
http_uri is marked for deprecation since OTP 23
Use uri_string which is available since OTP 21
No need to provide alternative, because it's used only by mod_matrix,
and this runs only with Erlang/OTP 24 or higher.

https://www.erlang.org/patches/otp-23.0#inets-7.2
https://www.erlang.org/docs/23/man/http_uri
2024-02-15 01:57:39 +01:00
Badlop 2438fc8b31 Add OTP_BELOW_25 to mix.exs that was added to rebar.config in 4ae06f0 2024-02-15 01:57:38 +01:00
Badlop 8b84f991e1 make-binaries: Bump many dependency versions
Unfortunately, newer versions of linux-pam throw compilation problems:

linux-pam 1.5.3:
tty_conv.c:9:10: fatal error: termio.h: No such file or directory

linux-pam 1.6.0:
pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
2024-02-15 01:57:36 +01:00
Badlop 3c98ec5b48 Update "make translations" to reduce build requirements
Previously, preparing translations required rebar3 and:
  ./configure --enable-tools
  make
  make translations

With this change it works with rebar3 and mix, just running:
  ./configure
  make translations
2024-02-15 01:57:34 +01:00
Badlop e1f863afa4 Makefile: Group all variable definitions, and later just use them 2024-02-15 01:57:32 +01:00
Badlop f40a036d97 Makefile: Express rebar3 profile using "as profile"
This allows to use REBAR_PROFILE to add another profile.
Right now it doesn't seem specially useful, but it's possible:
  REBAR_PROFILE=dev make prod
  REBAR_PROFILE=translations make dev

https://rebar3.org/docs/configuration/profiles/
2024-02-15 01:57:30 +01:00
dependabot[bot] 3f07e232aa 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] <support@github.com>
2024-02-15 01:57:28 +01:00
Alexey Shchepin f44e23b8cc Add mod_matrix_gw 2024-02-14 06:59:23 +03:00
Paweł Chmielowski 67a6776fba Add ability to ignore failures in execution of container CTL_ON_* commands
This will allow to use register in CTL_ON_CREATE and not abort if used with
existing data that have account already registered.
2024-02-13 11:55:23 +01:00
Badlop cdaf45f91c Test: Check that the message we get is the welcome message, not other 2024-02-09 14:12:22 +01:00
Badlop e1b94487ef Container: Apply commit 35b727a
ejabberdctl: Detect problem running iex and show explanation
2024-02-09 14:12:21 +01:00
Badlop 2531ebf685 Container: Apply commit abf0796
ejabberdctl: Detect problem running etop and show some help
2024-02-09 14:12:20 +01:00
Badlop 01909b07ce Container: Apply commit e1f14ac
Rebar3: Provide proper path to iex
2024-02-09 14:12:18 +01:00
Badlop 39ea08b7cb Container: Apply commit 841d5c0 and 81ceefe
Fix startup problem when having set EJABBERD_OPTS and logger options
Remove spurious line
2024-02-09 14:12:17 +01:00
Badlop 413ffd7470 Container: Apply commit 19e2e16
Let "ejabberdctl etop" work in a release (if observer is available)
2024-02-09 14:12:15 +01:00
Badlop 66645baa75 Container: Apply commit 122af79
move spool dir to make it fully configurable per ejabberdctl.cfg (#3863)
2024-02-09 14:12:13 +01:00
Badlop 021f0be119 Container: Update to Erlang/OTP 26.2, Elixir 1.16.1 and Alpine 3.19 2024-02-09 14:12:12 +01:00
Badlop 1962fc88d6 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
2024-02-09 14:12:10 +01:00
Badlop fa12301e08 ejabberdctl: Fix problem when running ejabberdctl in container 2024-02-09 14:12:08 +01:00
Badlop 9f934abd48 ejabberdctl: Fix crash running defined commands in container and installers 2024-02-09 14:12:06 +01:00
Badlop 4680954112 README.md: Add links to nightly builds 2024-02-09 14:12:03 +01:00
Paweł Chmielowski 7e6ffc34fb Update mix.lock 2024-02-07 19:32:49 +01:00
Paweł Chmielowski 95135af6b3 Rework temporary node name generation in ejabberdctl
This should limit number of possible node names generated by and with that
prevent atom space exhaustion in ejabberd process.

On R23+ we switch to using native dynamic node features and on older
versions we iterate over small number of possible names and skip those
already in use.
2024-02-07 12:17:16 +01:00
Badlop c81a47a692 Container: Update make-binaries to support setup-beam v1.17.2
With setup-beam v1.17.2, make-binaries failed in the Container action with:

* ERROR:   No usable Erlang/OTP system for the build machine found! Cannot
*          cross compile without such a system.
*
*          Either build a bootstrap system for the build machine, or provide
*          an Erlang/OTP-26 system in the $PATH, and try again. For more
*          information on cross compiling Erlang/OTP-26, see the
*          $ERL_TOP/xcomp/README file.

The problematic commit is:
  https://github.com/erlef/setup-beam/commit/cf854bf14995e965ed7a4f7ec68e426278929376
more concretely this change:
  -  core.exportVariable(installDirForVarName, cachePath)
  +  core.exportVariable(installDirForVarName, catchPathBin)

Up until setup-beam@v1.17.1, the INSTALL_DIR_FOR_OTP was something like
  /opt/hostedtoolcache/otp/ubuntu-22.04/OTP-26.1.1/x64
but starting in v1.17.2, the path contains /bin, for example:
  /opt/hostedtoolcache/otp/ubuntu-22.04/OTP-26.1.1/x64/bin
2024-02-06 17:57:27 +01:00
Badlop 3bd9fc9f43 Container: Fix typo in cache key name 1.25->1.26 2024-02-06 17:57:27 +01:00
Badlop c664d6dc32 Workflows: Update actions to use Node.js 20 as recommended by Github Actions 2024-02-06 17:57:27 +01:00
Badlop a182ec12cf Workflows: Use explicit ubuntu-22.04 instead of a varying ubuntu-latest
Also notice that ubuntu-22.04 doesn't include Erlang/OTP.
2024-02-06 17:57:27 +01:00
Badlop 70bf316f9d Explain that reopen_log and rotate_log only affect some modules (#4156) 2024-02-06 17:52:31 +01:00
Badlop 2979fb4a9b ext_mod: Support in WebAdmin when a module spec lacks some information 2024-02-06 17:52:29 +01:00
Badlop a33be2d67a ejabberdctl.bc: Improve caching of commands list
Improvements:
- Keep command cache for one hour
- Fix parsing command list with ECMA-48 SGR escape sequence for font attributes
2024-02-06 17:52:27 +01:00
Badlop c6878f9c9d ejabberdctl: Print argument description, examples and note in help 2024-02-06 17:52:25 +01:00
Badlop 1d65f4471b ejabberdctl: Document exclusive ejabberdctl commands like all the others 2024-02-06 17:52:24 +01:00
Badlop e9de3748bd ejabberdctl: Reorganize commands related to mnesia info
- ejabberdctl mnesia: already implemented in ejabberd_admin.erl
- ejabberdctl mnesia info: renamed to mnesia_info_ctl
- ejabberdctl mnesia Arg: command removed, use mnesia_info_ctl instead
2024-02-06 17:52:22 +01:00
Badlop ea40afbe03 update_sql_schema: Fix typo, add example MySQL version number 2024-02-06 17:52:19 +01:00
Holger Weiss 01c70868ef Ignore hints when checking for chat states
Ignore XEP-0334 elements when checking whether a stanza is a stand-alone
XEP-0085 chat state notification.  This allows for CSI-filtering chat
states with (e.g.) a no-store hint.

Thanks to Thilo Molitor for reporting the issue.
2024-02-03 13:20:34 +01:00
Alexey Shchepin 66d701e788 Add print_sql_schema ejabberdctl command 2024-01-24 22:52:20 +03:00
Badlop 6eff14a71d Update changelog 2024-01-23 14:41:23 +01:00
Paweł Chmielowski 506152d4e7 Use tagged version of dependencies 2024-01-23 13:39:21 +01:00
Badlop 6e9c96a0e5 Run: make doap 2024-01-22 17:29:24 +01:00
Badlop e58be4d57e Update man page 2024-01-22 17:29:23 +01:00
Badlop e94edbdb8f Update Chinese translation (thanks to Sketch6580) 2024-01-22 17:29:21 +01:00
Badlop 0c8d2ea557 Update Ukrainian translation (thanks to Олександр Кревський) 2024-01-22 17:29:20 +01:00
Badlop 07e3456631 Update Portuguese translation (thanks to Silvério Santos) 2024-01-22 17:29:19 +01:00
Badlop e65d554309 Update Dutch translation (thanks to Ranforingus) 2024-01-22 17:29:17 +01:00
Badlop f5652cf946 Update Czech translation (thanks to Jan Aschenbrenner) 2024-01-22 17:29:16 +01:00
Badlop 399d0a5bf0 Update Bulgarian translation (thanks to Mr. EddX) 2024-01-22 17:29:14 +01:00
Badlop 589521bfd8 Update copyright year to 2024 (#4139) 2024-01-22 17:29:13 +01:00
Badlop d802b6ab44 Fix version number in ejabberd_xmlrpc.erl 2024-01-22 17:29:12 +01:00
Badlop 45863b4651 Grant execution permission to install-sh
The file `src/install-sh` was added in c311ea1.
Most files from that commit were removed in 4d8f770 and install-sh was moved.
Since recent commit 7cae092, `./configure` checks for a race-free `mkdir -p`,
the `install-sh` script may be used, and it needs execution permission.
2024-01-22 17:29:10 +01:00
Badlop f34c2b1714 Document new XEPs supported thanks to its implementation in the xmpp library 2024-01-22 17:29:09 +01:00
Badlop 78750bf753 Annotate version when the commands v1 are available 2024-01-22 17:29:07 +01:00
Badlop 65d585496c Document sql_flags option introduced in 00c7600 2024-01-22 17:29:06 +01:00
badlop 194d3b9e17 Merge pull request #4143 from badlop/elixir-all-in
Improve support for Elixir, Mix and Rebar3
2024-01-22 12:44:21 +01:00
Badlop b4b85e569e Runtime: Clean Rebar tests and add Rebar2 to them 2024-01-17 14:44:09 +01:00
Badlop daabfeb0e2 Makefile: Add install-rel and uninstall-rel 2024-01-17 14:44:09 +01:00
Badlop c61b57f7ab Makefile: Uninstall also the man file 2024-01-17 14:44:09 +01:00
Badlop 7cae0920b8 Makefile: Use AWK and MKDIR_P 2024-01-17 14:44:09 +01:00
Badlop 920e4ba6b1 Makefile: Fix TAGS target 2024-01-17 14:44:09 +01:00
Badlop 16e58a1911 Makefile: Update PHONY targets 2024-01-17 14:44:09 +01:00
Badlop ec7570f93e Makefile: Add sections, headers and Vim folding 2024-01-17 14:44:09 +01:00
Badlop ae2993ecae Rebar: Use excl_archive_filters only when Erlang < 26
That option is required when Erlang < 26 to disable the archive feature.
The feature and the option were removed in Erlang 26, and the release
building process fails if the option is used.
https://www.erlang.org/patches/otp-26.0
2024-01-17 14:43:24 +01:00
Badlop ee778ca8f9 COMPILE.md: For Elixir, recommend at least 1.13.4 with Erlang/OTP 23.0 2024-01-17 10:24:34 +01:00
Badlop a2ff5fbfdb Add observer and runtime_tools in releases when --enable-tools
When --enable-tools, include observer and runtime_tools
in the OTP releases, as they are required by "ejabberdctl etop".

With this fix, "ejabberdctl etop" works correctly when:
* rebar3 + make rel
* mix + make dev
* mix + make rel
2024-01-17 10:24:34 +01:00
Badlop eeb4be6e4b Makefile: Rename "make rel" to "make prod"
Rebar2 could create a release, so it made sense to call it "make rel".

Nowadays, Rebar3 and Mix support creating different types of releases:
production, development, ...
In this sense, our "make rel" target is more properly named "make prod"

For backwards compatibility, "make rel" redirects to "make prod"
2024-01-17 10:24:34 +01:00
Badlop aad3306bdf Makefile: Support using --with-rebar=/path/to/mix 2024-01-17 10:24:34 +01:00
Badlop 35b727ac39 ejabberdctl: Detect problem running iex and show explanation 2024-01-17 10:24:34 +01:00
Badlop abf07966be ejabberdctl: Detect problem running etop and show some help 2024-01-17 10:24:34 +01:00
Badlop a1c81955d3 ejabberdctl: Document to stop live shell with control+g, following cd421f9 2024-01-17 10:24:34 +01:00
Badlop ad7538f394 Runtime: Rebar3+Elixir: Add new job to test Rebar3 compiling Elixir 2024-01-17 10:24:34 +01:00
Badlop c0a909296e Runtime: Mix: Enable ModPresenceDemo and Elixir dep 2024-01-17 10:24:34 +01:00
Badlop 7186cd09bf Runtime: Test also "make install" 2024-01-17 10:24:34 +01:00
Badlop db8583b1c6 Runtime: Mix: Add step to view logs 2024-01-17 10:24:34 +01:00
Badlop 07be61585c Runtime: Mix: No need to specify --disable-elixir 2024-01-17 10:24:34 +01:00
Badlop 8bdd811a16 Runtime: Mix: Update Erlang and Elixir versions to test 2024-01-17 10:24:34 +01:00
Badlop c69d88c45a Runtime: Rebars: Add log tests similar to the Mix job 2024-01-17 10:24:34 +01:00
Badlop b18fa2ebc2 Runtime: Rebars: Use the rebar binaries included in the repository 2024-01-17 10:24:34 +01:00
Badlop f838319455 Runtime: Rebars: Get old rebar binaries when testing old erlang versions 2024-01-17 10:24:34 +01:00
Badlop 0d852474be Use Mix or Rebar3 by default instead of Rebar2 to compile ejabberd
Use the program specified in option: --with-rebar=/path/to/bin
When none is specified, use the system mix
When Elixir not found, use the system rebar3
When Rebar3 not found, use the rebar3 binary included with ejabberd
2024-01-17 10:24:34 +01:00
Badlop dd5a198222 Rebar3: Include Elixir files when making a release 2024-01-17 10:24:34 +01:00
Badlop 2d067f7498 Rebar3: Workaround to fix protocol consolidation 2024-01-17 10:24:34 +01:00
Badlop a6c1e42c0a Rebar3: Add support to compile Elixir dependencies
As described in
https://rebar3.org/docs/configuration/plugins/#elixir-dependencies
2024-01-17 10:24:34 +01:00
Badlop ff783d15e8 Rebar3: Compile explicitly our Elixir files when --enable-elixir 2024-01-17 10:24:34 +01:00
Badlop e1f14aca9b Rebar3: Provide proper path to iex
We can't use iex variable, because rebar3/relx_overlay.erl already uses
all existing app names as variables.
2024-01-17 10:24:34 +01:00
Badlop 65ff45e202 Rebar/Rebar3: Remove elixir as a gitonly_deps, and add ejabberd_po
Adding ejabberd_po to gitonly_deps isn't strictly needed,
because we request a branch in the ejabberd-po git repository,
and rebar.config.script understands that this means ejabberd_po
should be downloaded from git, not hex.pm.
2024-01-17 10:24:34 +01:00
Badlop f330267361 Rebar/Rebar3: Remove Elixir as a rebar dependency
Elixir is standalone since years ago. When Elixir support is required,
better simply install Elixir and use Mix as build tool.
Or install Elixir and use the experimental Rebar3 support to compile
Elixir files and dependencies.
2024-01-17 10:24:34 +01:00
Badlop 1de28fa566 Rebar/Rebar3: Update binaries to work with Erlang/OTP 23-26
They are compiled from their git repositories, main branches,
using erlang:23-slim docker image.

To compile ejabberd using rebar/rebar3 and Erlang 22.3 or older,
you can download the old binaries from ejabberd 21.12, available at:
  https://github.com/processone/ejabberd/raw/21.12/rebar
  https://github.com/processone/ejabberd/raw/21.12/rebar3
2024-01-17 10:24:34 +01:00
Badlop b08001183e ext_mod: Support Elixir modules with several defimpl, like Decimal 2024-01-17 10:24:34 +01:00
Badlop 0121adec03 ext_mod: Compile *.ex files also in source subfolders 2024-01-17 10:24:34 +01:00
Badlop 4daeb41f0e Elixir: Fix compiling ejabberd as a dependency (4128) 2024-01-17 10:24:34 +01:00
Badlop b2df22469b Elixir: Fix ejabberdctl start/live when installed
The problem appeared when:
  ./configure --with-rebar=mix
  make install
  ejabberdctl live

=INFO REPORT==== 19-Dec-2023::21:28:36.006306 ===
    application: ssl
    exited: stopped
    type: temporary
...
2024-01-17 10:24:34 +01:00
Badlop 1bf80e861d Elixir: Fix: FORMATTER ERROR: bad return value (4087)
This is required since Elixir 1.15 when starting ejabberd with:
  ./configure --with-rebar=mix
  make relive
  make relive && ejabberdctl iexlive
  make install && ejabberdctl iexlive

Reference:
  https://elixir-lang.org/blog/2023/06/19/elixir-v1-15-0-released/
  https://hexdocs.pm/logger/Logger.Formatter.html#module-formatting
2024-01-17 10:24:34 +01:00
Badlop 5bb2beb179 Elixir: Fix: Couldn't find file Elixir.Hex.API
Fix for error when starting ejabberd with Elixir 1.15:
  [critical] Couldn't find file Elixir.Hex.API needed for Erlang application 'hex'.
2024-01-17 10:24:34 +01:00
Badlop 852a540cb0 Elixir: Fix Elixir 1.17-dev warnings about single-quoted charlists 2024-01-17 10:24:34 +01:00
Badlop 8b38aebbc7 Mix: Enable stun by default when vars.config not found
configure.ac by default enables stun and zlib, in fact ejabberd.yml
has ejabberd_stun enabled by default, so for coherence mix.exs should
enable stun too when vars.config is not found.
2024-01-17 10:24:34 +01:00
Badlop fa3c25ab66 Mix: New option vars_config_path to set path to vars.config (4128)
Useful when setting ejabberd as dependency in another Elixir project,
and you want to enable or disable some ejabberd dependencies, see
https://www.process-one.net/blog/how-to-use-ejabberd-as-an-elixir-application-dependency/
2024-01-17 10:24:34 +01:00
Badlop 30df1dbe3f Mix: Set the nodename when using the ejabberd script generated by Elixir
Also use start instead of console in Elixir script
2024-01-17 10:24:34 +01:00
Badlop 6d61e3590d Mix: Print shell commands output to the console when "make dev" 2024-01-17 10:24:34 +01:00
Badlop e71650e6ab Mix: Fix ejabberdctl iexlive problem locating iex in an OTP release
The problem appeared when:
  ./configure --with-rebar=mix
  make dev
  _build/dev/rel/ejabberd/bin/ejabberdctl iexlive
2024-01-17 10:24:34 +01:00
Badlop d81b3805e3 Mix: Elixir 1.14 requires mix, and Elixir 1.16 warns about duplicate 2024-01-17 10:24:34 +01:00
Badlop 416253496d Mix: Add yecc compiler as suggested by Elixir 1.16 warning over p1_pgsql 2024-01-17 10:24:34 +01:00
Paweł Chmielowski 29ec5bff60 Add option to disable XEP-0474: SASL SCRAM Downgrade Protection support
Looks like clients using strophejs aren't able to authenticate when we
add data required by that spec to scram packets, so at least give a way
to disable this until clients will be fixed.
2024-01-16 12:03:35 +01:00
Holger Weiss 6c691a73bd Support XEP-0198 pings
If stream management is enabled, let mod_ping trigger XEP-0198
<r/>equests rather than sending XEP-0199 pings.  This avoids the
overhead of the ping IQ stanzas, which, if stream management is enabled,
are accompanied by XEP-0198 elements anyway.

Thanks to MoyaApp (<https://moya.app>) for sponsoring this work.
2024-01-15 21:38:54 +01:00
Badlop 74cb2e054f Rephrase sentences to avoid using "allow to + verb" 2024-01-11 13:42:06 +01:00
Badlop 5b6329a12e Fix a few spelling errors 2024-01-11 13:41:40 +01:00
Badlop 973ba58744 mod_avatar implements XEP-0398 0.2.0 since ddc29d4 2024-01-08 18:21:15 +01:00
Badlop 1f60bcb2d0 Fix syntax of enable-user and enable-group options help 2024-01-08 18:21:13 +01:00
Badlop 8e8354caec Fix explanation of --enable-group option (#4135) 2024-01-08 18:21:10 +01:00
badlop e26c547afc Merge pull request #4118 from badlop/api-version-1
Commands API version 1
2024-01-05 13:10:06 +01:00
Badlop fc13fdceca Docs: Separate tags with commas in markdown docs 2024-01-04 22:01:21 +01:00
Badlop d585b1fcb6 Docs: When definer is unknown, don't show Module section 2024-01-04 22:01:21 +01:00
Badlop 57bd0ef4f5 Docs: Optional support to get commands from runtime instead of BEAM files, based in bdeb4a7 2024-01-04 22:01:21 +01:00
Badlop d140f99b68 ejabberd_xmlrpc: Fix support for restuple error response 2024-01-04 22:01:21 +01:00
Badlop 90766685ae ejabberd_ctl: When API version>0, update syntax of list results 2024-01-04 21:53:14 +01:00
Badlop d65638efe1 ejabberd_ctl: Pass API version to format_result 2024-01-04 21:53:14 +01:00
Badlop b34572e7ce ejabberd_ctl: Show proper command help when version is explicitly set 2024-01-04 21:53:14 +01:00
Badlop c4c0cd1b77 ejabberd_ctl: Add support for list and tuple arguments
Tuple elements are separated with :
List elements are separated with ,

For example:
  ejabberdctl add_rosteritem user1 localhost testuser7 localhost NickUser77l gr1,gr2,gr3 both
  ejabberdctl create_room_with_opts room1 conference.localhost localhost public:false,persistent:true
  ejabberdctl subscribe_room_many user1@localhost:User1,admin@localhost:Admin room1@conference.localhost urn:xmpp:mucsub:nodes:messages,urn:xmpp:mucsub:nodes:affiliations

Affected commands:
- add_rosteritem
- create_room_with_opts
- oauth_issue_token
- send_direct_invitation
- set_vcard2_multi
- srg_create
- subscribe_room
- subscribe_room_many
2024-01-04 21:53:14 +01:00
Badlop 9f42f17088 mod_http_api: Fix to allow the client override the API version
When configured like:
listen:
  -
    request_handlers:
      /api: mod_http_api
      /apizero/v0: mod_http_api

What API version will be used depending on the URL:
- api/commandname use the latest available version
- api/commandname/v0 use version 0
- apizero/v0/commandname use version 0
- apizero/v0/commandname/v2 use version 2
2024-01-04 21:53:14 +01:00
Badlop d570870be5 mod_http_api: When using API version>0, avoid result names for integers and strings 2024-01-04 21:53:14 +01:00
Badlop 8671bf70ab mod_http_api: When no specific API version is requested, use the latest 2024-01-04 21:53:14 +01:00
Badlop e26729b483 Commands: Use list arguments in many commands that used separators
Commands that has some argument change:
- add_rosteritem
- oauth_issue_token
- send_direct_invitation
- srg_create
- subscribe_room
- subscribe_room_many
2024-01-04 21:53:14 +01:00
Badlop d4113d9569 Commands: set_presence: switch priority argument from string to integer 2024-01-04 21:53:14 +01:00
Badlop c5a5dd859e Commands: Improve syntax of many commands documentation 2024-01-04 21:53:14 +01:00
Badlop 0961fa1830 Commands: When result is rescode, result_desc is automatically added 2024-01-04 21:53:14 +01:00
Badlop f18b8d464d Commands: Add a new muc_sub tag to all the relevant commands 2024-01-04 21:53:14 +01:00
Badlop 98d7519274 ejabberd_commands: Add the command version as a tag "vX" 2024-01-04 21:53:14 +01:00
Badlop 1326a7764a ejabberd_commands: Update -type and remove obsolete @type 2024-01-04 21:53:14 +01:00
Alexey Shchepin 97568195d6 Update SQL schema files 2023-12-27 17:01:57 +03:00
Alexey Shchepin 8d2d3a6540 Support XEP-0424 in mod_mam_mnesia 2023-12-27 09:42:22 +03:00
Alexey Shchepin 4f6730621a Add default value to #archive_msg.origin_id 2023-12-27 09:28:02 +03:00
Alexey Shchepin a4bb695fc3 Support for XEP-0424 "Message Retraction" 2023-12-27 08:59:20 +03:00
Badlop a57bdfffb7 Document recent change from 7d4330b57 2023-12-22 13:19:53 +01:00
Paweł Chmielowski bdb513a660 Update xmpp 2023-12-19 10:43:37 +01:00
Paweł Chmielowski b5ce53c907 Update xmpp to fix issue with scram with missing channel bindings
This makes scram downgrade protection hash calculation work properly when
using non -plus sasl mechanism or when stream is not encrypted

This should fix issue #4123.
2023-12-18 12:10:28 +01:00
Paweł Chmielowski b556fae08f Update xmpp to bring support for XEP-0474: SASL SCRAM Downgrade Protection 2023-12-13 10:08:31 +01:00
Paweł Chmielowski f87ab9a99f Update xmpp 2023-12-12 14:37:01 +01:00
Paweł Chmielowski a5c973f86b Mention in docs for sql_prepared_statements that it works with MySQL 2023-12-12 11:29:12 +01:00
Holger Weiss 6b2b89da78 mod_push: Fix disabling of notifications
Remove the correct field from the c2s state when the client explicitly
disables push notifications.  This fixes a regression introduced by
commit c148ab4430.
2023-12-08 18:52:53 +01:00
Paweł Chmielowski 7d4330b57a Increase default value of negotiation_timeout from 30s to 2m
This timeout also covers in-band registration, and if user don't fill
registration form in that time leads to disconnect and aborting
registration. This will allow for more time to finish that.
2023-12-04 13:24:32 +01:00
Badlop 225d14cbbe Minor improvements in auth_password_format documentation 2023-12-01 00:07:21 +01:00
Paweł Chmielowski d2a84c96a4 Update xmpp to fix incompatibility with < R21 2023-11-22 18:40:10 +01:00
Paweł Chmielowski 48f0d9c15e Update xmpp to make us present both sasl1 and sasl2 with from in initial stanza 2023-11-22 18:34:18 +01:00
Paweł Chmielowski 9c7e91a1e9 Update xmpp and make opening bind2 session close other sessions with same tag 2023-11-21 13:55:40 +01:00
Paweł Chmielowski 91e74204b2 Teach mod_carboncopy how to interact with bind2 inline requests 2023-11-20 18:55:07 +01:00
Paweł Chmielowski fdee4efe98 Fix presenting features and returning results of inline bind2 elements 2023-11-20 18:54:23 +01:00
Paweł Chmielowski 59bb6dae14 Make apps passed to check in dialyzer consult configure optons 2023-11-20 18:47:42 +01:00
Paweł Chmielowski 3300f8bafb Update fast_tls in mix 2023-11-20 15:39:07 +01:00
Paweł Chmielowski c61e56d8a6 Fix for one more dialyzer warning 2023-11-16 20:49:28 +01:00
Paweł Chmielowski ad15659fb2 Fix warnings 2023-11-16 18:45:33 +01:00
Paweł Chmielowski efffc3142a Add implementation for SASL2 and Bind2 2023-11-16 16:52:55 +01:00
Alexey Shchepin b0a9b58958 Use the first unique index as a primary key in ejabberd_sql_schema 2023-11-16 16:00:35 +03:00
Paweł Chmielowski 4ea46c5765 Set EJABBERD_OPTS back to "", and use previous flags as example
Also try to clarify distinction between EJABBERD_OPTS and ERLANG_OPTS
2023-11-15 14:16:53 +01:00
Paweł Chmielowski 7de0ba95d0 Update mysql to bring sha256_password auth plugin support 2023-11-09 15:43:47 +01:00
Paweł Chmielowski 3ad30c3ff5 Use correct commit hash for xmpp 2023-10-31 10:15:35 +01:00
Paweł Chmielowski 3ed2b41a5a Update xmpp to bring tls-server-end-point channel binding and sasl2 codec 2023-10-31 09:41:25 +01:00
Paweł Chmielowski 3bf4cf5c3f Fix reversed logic in node fixup function 2023-10-26 15:44:45 +02:00
Paweł Chmielowski 52e7c166fc Normalize pubsub max_items node options on read
Older version used infinity value, for what never version use max, let's
always return max in that case.
2023-10-26 14:31:40 +02:00
Paweł Chmielowski 08a78a1654 Change logic for eldap tls_verify=soft and false
Looks like originally both soft and hard worked the same way, so lets make
them do that, and we also need to add {verify, verify_none} for false case
otherwise it fails on R26.
2023-10-26 11:17:17 +02:00
Paweł Chmielowski 81ceefe2f1 Remove spurious line 2023-10-25 20:35:25 +02:00
Paweł Chmielowski c2d04bc478 Don't set fail_if_no_peer_cert for eldap ssl client connections
Looks like R26 generates error when this option is used for client
connection, let's just use verify_peer/verify_none for
ldap_tls_verify hard/soft options.

This should fix issue #4110.
2023-10-25 20:31:50 +02:00
Paweł Chmielowski 36fffa5b23 Revert dialyzer changes commited by mistake 2023-10-25 20:07:02 +02:00
Paweł Chmielowski 841d5c0299 Fix startup problem when having set EJABBERD_OPTS and logger options
Make sure that logger options that we extract from config file are put in
correct places when starting erl, directly after -ejabberd, custom
EJABBERD_OPTS should be places after them.

This fixes issue #4109
2023-10-25 20:05:27 +02:00
Paweł Chmielowski 0bdca8fd9e Updated deps to bring support for tls-exporter channel binding 2023-10-25 16:46:03 +02:00
Paweł Chmielowski f48275bc11 Only care about pep bookmarks options when creating node from scratch 2023-10-19 19:26:25 +02:00
Paweł Chmielowski aa369de280 Fix xmpp dep in mix 2023-10-18 16:17:11 +02:00
Badlop 543404bcb8 Fixing minor typos in CHANGELOG
Container / Container (push) Failing after 2m8s
Installers / Binaries (push) Failing after 53s
Runtime / Rebars (20.3, rebar) (push) Failing after 2s
Runtime / Rebars (20.3, rebar3) (push) Failing after 3s
Runtime / Rebars (25.3, rebar) (push) Failing after 2s
Runtime / Rebars (25.3, rebar3) (push) Failing after 2s
Runtime / Rebars (26, rebar3) (push) Failing after 3s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25.3) (push) Has been cancelled
CI / Tests (26.1) (push) Has been cancelled
Runtime / Mix (1.10.3, 21.3) (push) Has been cancelled
Runtime / Mix (1.11.4, 21.3) (push) Has been cancelled
Runtime / Mix (1.13.4, 25.0) (push) Has been cancelled
Runtime / Mix (1.14.5, 25.0) (push) Has been cancelled
Runtime / Mix (1.14.5, 26) (push) Has been cancelled
Runtime / Mix (1.15, 25.0) (push) Has been cancelled
Runtime / Mix (1.15, 26) (push) Has been cancelled
2023-10-17 15:57:50 +02:00
Badlop b7166d7da0 Set version to 23.10 2023-10-17 15:31:32 +02:00
Badlop cf54608c71 Update changelog 2023-10-17 15:29:20 +02:00
Alexey Shchepin ec20691188 Disable update_sql_schema by default 2023-10-16 19:31:32 +03:00
Alexey Shchepin c1af36ac20 Automatically create and update SQL schema 2023-10-16 18:21:08 +03:00
Alexey Shchepin f6e8eb52f0 Fix ejabberd_sql:sql_query* types 2023-10-16 18:21:08 +03:00
Paweł Chmielowski ad7db90c80 Use tagged deps 2023-10-16 15:14:31 +02:00
Holger Weiss cbfb8eb805 Example configuration: Specify s2s shaper
Specify a shaper for incoming s2s connections (got lost in commit
91a74e3e27).

Thanks to Paul Menzel for noting that it was missing.
2023-10-16 14:44:01 +02:00
Holger Weiss df60818883 Example configuration: Clarify direct TLS listener
The ejabberd_c2s listener for port 5223 is meant to support direct TLS
access rather than STARTTLS.  Therefore, remove the 'starttls_required'
option, which had no effect.
2023-10-16 14:32:38 +02:00
Badlop d5de93b8fa Update other translations 2023-10-16 11:28:51 +02:00
Badlop ab6da9530d Update Ukrainian translation (thanks to Олександр Кревський) 2023-10-16 11:28:29 +02:00
Badlop ca82376657 Update man page 2023-10-16 11:18:59 +02:00
Badlop 87f18aa8d7 Result of running: make doap options 2023-10-16 11:09:13 +02:00
Badlop 6340d61397 Dcoument ejabberd version number in the new options 2023-10-16 10:58:59 +02:00
Badlop 80d1e36542 mod_private: Document that it supports XEP-0402 now 2023-10-16 10:56:15 +02:00
Paweł Chmielowski f75909db4c Allow pubsub node owner to overwrite items published by other persons
Owner is already permitted to delete those items, so it could do that by
deleting old item, and publishing it again, so i don't see reason to not
allow that overwrite.
2023-10-12 13:16:32 +02:00
Paweł Chmielowski 12d47455ba Add auth_external_user_exists_check option
This makes `user_check` hook work better with authentication methods
that don't have a way to determine if user exists (like is the case for
jwt and cert based authentication), and as result will improve mod_offline
and mod_mam handling of offline messages to those users. This reuses
information stored by `mod_last` for this purpose.

Should fix issue #3377.
2023-10-11 14:17:18 +02:00
Badlop 9acf591242 Run 'make translations' 2023-10-11 01:17:27 +02:00
Badlop bab8673055 Update Portuguese (Brazil) translation (thanks to Wellington Uemura) 2023-10-11 01:17:24 +02:00
Badlop 3851a77134 Update German translation (thanks to nautilusx) 2023-10-11 01:17:21 +02:00
Badlop 8e324e67a4 New Bulgarian translation (thanks to Mr. EddX) 2023-10-11 01:13:49 +02:00
Badlop 10245b40ee Add support to register nick in a room (#3455)
Registering a nick in the MUC service or in a room is mutually exclusive:
- A nick that is registered in the service cannot be registered in any
  room, not even the original owner can register it.
- Similarly, a nick registered in any room cannot be registered in the
  service.
2023-10-10 13:08:56 +02:00
Badlop 9534ca2da1 ext_mod: Support when git repository name is not identical to the module name
For example, ejabberd-contrib has an extra module, mod_prometheus,
that is hosted in a git repository named ejabberd-prometheus-exporter
2023-10-04 20:57:02 +02:00
Badlop f9d11265d0 ext_mod: Don't crash when github page response is 403 2023-10-04 20:55:01 +02:00
Badlop d85c125bef ext_mod: Use the same URL that ejabberd-contrib spec files 2023-10-04 20:54:49 +02:00
Paweł Chmielowski 62d3d7a32d Relay pubsub iq queries to muc members without using bare jid
We do something similar for vcard queries, this allows target server
to respond to those queries by target server, which is what we want to
do in both of those cases.
2023-10-04 17:20:20 +02:00
Holger Weiss a3f4a05b0c make-binaries: Don't use non-prefixed cross tools
Omit the directory that contains cross compilation tools without
"$target-" prefix from the PATH.  Having it in the path might lead to
problems when native tools are needed during cross compilation.  For
actual cross compilation, the prefixed tools should always be used
anyway.
2023-10-03 17:56:27 +02:00
Paweł Chmielowski 86465c418d Try to fill xep-0402 bookmarks from private storage on first access 2023-10-02 14:39:30 +02:00
Paweł Chmielowski a63d3bf0d6 Fix crash in mod_private bookmarks converter
This should fix issue reported in #4092
2023-10-02 08:32:24 +02:00
Holger Weiss 762e4951f2 make-binaries: Bump Erlang/OTP version to 26.1.1 2023-09-29 19:01:50 +02:00
Holger Weiss d4fc54be18 make-binaries: Let curl fail on HTTP errors 2023-09-29 17:33:09 +02:00
Holger Weiss f327f4cc67 make-binaries: Suppress curl's info messages 2023-09-29 17:32:17 +02:00
Paweł Chmielowski 9ba645503b Fix dialyzer warning 2023-09-27 23:02:32 +02:00
badlop 5406693a1e Merge pull request #4079 from sando38/fix/Dockerfile-odbc
Dockerfile: add missing dependency for mssql databases
2023-09-27 21:10:16 +02:00
Paweł Chmielowski d55955f7d8 Clean also urn:xmpp:bookmarks:1 after mod_private tests 2023-09-27 19:38:14 +02:00
Paweł Chmielowski 765770aaa5 Add support for xep-0402 - PEP Native Bookmarks 2023-09-27 18:36:30 +02:00
Paweł Chmielowski c3e0b746d7 Add pubsub_delete_item hook 2023-09-27 18:30:17 +02:00
Paweł Chmielowski accb0bc35a Report support of config-node-max in pep 2023-09-27 18:29:56 +02:00
Holger Weiss b16530bb6a make-binaries: Bump dependency versions 2023-09-27 00:28:46 +02:00
Holger Weiss ad00553bf8 make-binaries: Bump Erlang/OTP version to 26.1 2023-09-27 00:17:30 +02:00
Holger Weiss b70bef77cb make-binaries: Bump crosstool-NG version to 1.26.0 2023-09-26 23:55:01 +02:00
Holger Weiss ac47b7b8cb ejabberd_web_admin: Make text translatable
This also fixes a type issue.
2023-09-26 23:21:45 +02:00
Badlop abe0817553 Mention what software versions are used to build the container image 2023-09-26 18:51:57 +02:00
Badlop ab431b378a WebAdmin: Show a warning when visiting webadmin with non-privileged account (4089) 2023-09-26 18:51:56 +02:00
Badlop a534196315 Fix unused variable, forgotten in the recent commit 739a231 2023-09-26 18:51:51 +02:00
Badlop cd421f98d7 ejabberdctl: Document how to stop a debug shell: control+g
control+g is the correct way to enter shell break mode, as documented in
https://www.erlang.org/doc/apps/erts/tty

The ejabberdctl script included in installers use the included VT100,
and that may break when hitting control+c.
In that scenario let's explicitly recommend to not use control+c.

Thanks to Holger Weiß for the report.
2023-09-26 18:51:47 +02:00
badlop b33d660f88 Merge pull request #4088 from badlop/get-roster-command
Improve get_roster command result: show groups as a list
2023-09-25 13:15:26 +02:00
Badlop 245c9ae446 ejabberd_ctl: Support policy=user in the help and return proper arguments 2023-09-21 13:47:07 +02:00
Badlop 8d39431d68 ejabberd_ctl: Improve printing lists in results
When formatting the results of a command:
- If the top of the result is a list, split elements with newline as usual
- If it's a list in one of the resulting lines, split elements with ;
2023-09-21 13:47:05 +02:00
Badlop 739a231259 Improve get_roster command to return groups in a list instead of newlines 2023-09-21 13:47:00 +02:00
Paweł Chmielowski 426fd14b11 Make sure that policy=user commands have host instead of server arg in docs
We renamed them in ejabberd_command, but forgot to update doc geenerator.
2023-09-20 14:06:23 +02:00
dependabot[bot] 4735372682 Bump docker/build-push-action from 4 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:15 +02:00
dependabot[bot] 4b3fa13163 Bump docker/setup-buildx-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:15 +02:00
dependabot[bot] d40250c3d6 Bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:15 +02:00
dependabot[bot] 7d2cfd2aaa Bump docker/metadata-action from 4 to 5
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:14 +02:00
dependabot[bot] 11fdd417dd Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:14 +02:00
dependabot[bot] 1b7b23fab6 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:14 +02:00
dependabot[bot] 10882af7c8 Bump ex_doc from 0.30.5 to 0.30.6
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.30.5 to 0.30.6.
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.30.5...v0.30.6)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:05:14 +02:00
Holger Weiss 6c573cc9fd mod_push: Set 'last-message-sender' to bare JID
If the mod_push option 'include_sender' is set to 'true', use the bare
JID rather than the full JID for the 'last-message-sender' field.
2023-09-09 17:33:16 +02:00
Holger Weiss 2782430887 mod_push: Add 'notify_on' option
If the new 'notify_on' option is set to 'messages', notifications are
only triggered by actual chat messages with a body (or encrypted
payload).  The default behavior remains to generate a notification on
any kind of stanzas.

Thanks to EISST International Ltd for sponsoring this work.
2023-09-08 19:49:17 +02:00
Badlop 7522c29f25 Update xmpp version to send roomconfig_changesubject in disco info (#4085) 2023-09-08 18:37:38 +02:00
Badlop 706424f0d2 Fix crash when loading room from DB older than ffa07c6, 23.04
Before commit ffa07c6, the subject_author was just the author nick,
since that commit, subject_author contains {author nick, JID}.
2023-09-04 11:32:28 +02:00
Badlop 57d404a99b Remove mailing list link, it had no activity and was removed long ago 2023-09-04 11:32:07 +02:00
Badlop 19e2e169b1 Let "ejabberdctl etop" work in a release (if observer is available) 2023-08-28 18:27:30 +02:00
Badlop 2a6ea79260 When building OTP release with mix, keep ERLANG_NODE=ejabberd@localhost
This updates the mix.exs code from commit 8ca12d4 (ejabberd 21.07)
Consequently, no need in make-binaries to update ERLANG_NODE.
The ecs docker image 23.04 got a similar change in
  https://github.com/processone/docker-ejabberd/pull/73/commits/f81905d5e315d2eb813a715b51d4a8351a7d4e6b
2023-08-28 18:27:23 +02:00
Badlop 40333066d6 Update syntax of function calls as recommended by Elixir compiler 2023-08-28 18:26:55 +02:00
Badlop 6d596063de Elixir 1.15 removed support for --app
Removing that argument does not affect iexlive at all

For reference:
https://github.com/elixir-lang/elixir/commit/e1eecb8ca698712f5cff76f52ff49b381ce64aa9
2023-08-28 18:26:55 +02:00
Badlop a7c3c9b77d Pass ERLANG_OPTS when calling erl to parse the INET_DIST_INTERFACE (#4066)
This is required when running ejabberdctl in binary installers
and INET_DIST_INTERFACE was configured, because some boot files were removed
2023-08-28 18:26:48 +02:00
Badlop a01de8d944 Fix small bug introduced in 5d549dc
When providing a client-id as explained in
  https://www.process-one.net/blog/understanding-ejabberd-oauth-support-roadmap/
ejabberd crashed with an error
  exception error: no function clause matching
  ejabberd_oauth:get_client_identity(
as reported in
  https://stackoverflow.com/questions/76922951/ejabberd-oauth-api-http-1-1-502-bad-gateway
2023-08-28 18:26:03 +02:00
Paweł Chmielowski c0e7774937 Don't always store messages passed through muc_filter_message
Recently we added new places where we call muc_filter_message to add
occupandid info to messages, but this also made them be stored in archive
as mod_mam uses that hook for getting sent messages - in case of those
messages we shouldn't be doing this.

This should fix issue #4083
2023-08-25 14:20:51 +02:00
Paweł Chmielowski 00c76003cb Add ability to force alternative upsert implementation in mysql 2023-08-18 11:46:37 +02:00
Badlop b29f87a978 Result of running: make doap options 2023-08-16 13:14:02 +02:00
Holger Weiss 2dc843cddd mod_privilege: Don't fail to edit roster (#3942) 2023-08-16 13:08:21 +02:00
dependabot[bot] 9f08b4aa15 Bump ex_doc from 0.30.1 to 0.30.5
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.30.1 to 0.30.5.
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.30.1...v0.30.5)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-16 12:27:23 +02:00
Badlop a84fbd6a74 Improve syntax of many command descriptions for the Docs site 2023-08-16 12:27:23 +02:00
Badlop f8af3a0005 create_room_with_opts: fix typo and move examples to args_example (#4080) 2023-08-16 12:27:23 +02:00
Badlop 83e51c815d Pass also MUC room retract messages over the muc_filter_message (#3397) 2023-08-16 12:27:23 +02:00
Badlop ff24700156 Fix support to retract a MUC room message
Now this works as expected
https://xmpp.org/extensions/xep-0425.html#example-4
2023-08-16 12:27:22 +02:00
Badlop 7683691f5a mod_muc_occupantid: New mnesia table to store rooms salts (#3397) 2023-08-16 12:27:22 +02:00
Badlop 3479f88dab Pass MUC room private messages over the muc_filter_message too (#3397) 2023-08-16 12:27:22 +02:00
Badlop 86fc2f157e Always add the occupant id, even in non-anonymous rooms (#3397) 2023-08-16 12:27:22 +02:00
Badlop ffa07c649b Store the subject author JID, and run muc_filter_message when sending subject (#3397)
When changing the room subject, store the original author JID,
so later it can be provided in the hook and mod_room_occupantid
can use it to calculate and provide the occupant id

This is noticeable when a new occupant joins an existing room,
and receives the room subject.
2023-08-16 12:27:22 +02:00
Badlop 2bd61abd71 Convert allow_private_message MUC room option to allowpm (#3736) 2023-08-16 12:25:46 +02:00
Badlop 66df953da1 Fix usage of plugins option, which produced default_node_config ignore (#4070) 2023-08-16 12:25:42 +02:00
Badlop 550a586d2a New listener option unix_socket, useful when setting unix socket files (#4059)
listen:
  -
    port: "unix://tmp/asd/socket"
    unix_socket:
      mode: '0775'
      owner: 117
      group: 135
2023-08-16 12:25:36 +02:00
Badlop 16473ab691 When sending message on behalf of user, trigger user_send_packet (#3990)
This way, MAM and CarbonCopy get triggered.
This is useful for transports like Slidge.
2023-08-16 12:25:29 +02:00
Paweł Chmielowski c5afd0322e Properly parse mysql version even if it doesn't have type tag 2023-08-14 17:12:16 +02:00
sando38 c4563c429c Dockerfile: add missing dependency for mssql databases 2023-08-12 14:46:30 +02:00
Alexey Shchepin eeacace02a Update some modules to the new gen_mod API 2023-08-09 17:08:45 +03:00
Holger Weiss caf3807bcc ejabberd_systemd: Add a few debug messages 2023-08-09 01:58:48 +02:00
Holger Weiss 6c7e85d3d8 ejabberd_systemd: Avoid using gen_server timeout
Don't (ab)use the gen_server timeout mechanism for pinging the systemd
watchdog.  Under certain conditions (e.g., the process receiving sys
messages), the gen_server timeout might not be triggered as expected.

Fixes #4054, fixes #4058,
2023-08-09 01:54:12 +02:00
Holger Weiss f0db7623d1 mod_push_keepalive: Don't let hook crash
Check whether mod_push_keepalive is loaded for a given host before
querying the module configuration for that host.  This avoids a hook
crash in the case where the module is enabled for some but not all
hosts.
2023-08-09 00:11:43 +02:00
Holger Weiss 26ed6539ba mod_push_keepalive: Delay 'wake_on_start'
Delay the 'wake_on_start' notifications until ejabberd is fully
initialized.  This makes sure no s2s connections are initiated before
certificates are loaded.

Many thanks to Friedrich Altheide for reporting the issue.
2023-08-08 20:17:10 +02:00
Alexey Shchepin a9347cd248 Fix unused variable warnings in mod_stats 2023-08-04 20:54:02 +03:00
Alexey Shchepin 60002fc145 Update some modules to the new gen_mod API 2023-08-04 18:53:50 +03:00
Paweł Chmielowski 20a8654be2 Reset scram fields when setting plain password in ejabberd_auth_sql
Setting scram password, then disabling scram and setting plain password
again, will make us think we are still using scramed password and crash
when trying to process it as such. This makes sure that when set plain
password we don't leave parts from old scram password.
2023-08-03 13:07:13 +02:00
Badlop 25411333da Add support for XEP-0421 Occupant Id in anonymous MUC rooms (#3397) 2023-08-02 17:54:54 +02:00
Badlop 07d4282603 Update XMPP library which supports XEP-0421 (3397) 2023-08-02 17:54:07 +02:00
Alexey Shchepin 4bd77797fc Add shorter forms for gen_mod hook/iq_handler API 2023-08-01 18:14:08 +03:00
Alexey Shchepin 03ffbe00c1 Update mod_disco to the new gen_mod API 2023-07-31 16:52:00 +03:00
Alexey Shchepin 5a9099f49c Extend gen_mod API to simplify hooks and IQ handlers registration 2023-07-31 16:52:00 +03:00
Badlop b501ee2b8d Remove obsolete example files, and add link in Docs to the archived copies 2023-07-27 14:03:40 +02:00
Badlop a7c3368635 Move example Perl extauth script from ejabberd git to Docs site 2023-07-27 14:03:37 +02:00
Paweł Chmielowski 84ee724aa3 Fix dialyzer warning 2023-07-25 18:49:45 +02:00
Paweł Chmielowski da7fe59834 Commit changes to ejabberd_sql.hrl as well 2023-07-25 18:24:24 +02:00
Paweł Chmielowski 3710dc1e3b Use prepared statement with mysql 2023-07-25 18:11:24 +02:00
Badlop db03c7428c Web Admin roster page: move the AddJID textbox to top (#4067) 2023-07-24 20:27:01 +02:00
Badlop 9c6fe98f76 Partially revert "Improve ejabberdctl script: Copy recent commit 6272c0e90 to the container"
This reverts commit e66ba2e424
following the revert in commit 8288774787
2023-07-24 20:26:37 +02:00
Holger Weiss c03af0afb3 make-binaries: Remove outdated workaround
Remove a workaround for an issue that has been fixed in Erlang/OTP 25:

https://github.com/erlang/otp/pull/5558
2023-07-24 00:11:32 +02:00
Holger Weiss d109d7f0c5 make-binaries: Revert to Linux-PAM 1.5.2
Linux-PAM's --disable-examples flag doesn't seem to have the expected
effect.
2023-07-23 16:34:21 +02:00
Holger Weiss bf9b257eab make-binaries: Don't build Linux-PAM examples
Building the examples shipped with Linux-PAM 1.5.3 fails with musl libc:

https://github.com/linux-pam/linux-pam/commit/5374f677e4cae669eb9accf2449178b602e8a40a
2023-07-23 16:08:25 +02:00
Holger Weiss 11dc0c1774 make-binaries: Bump dependency versions 2023-07-23 15:52:32 +02:00
Holger Weiss 0a5eda0777 make-binaries: Fix check for current Expat version 2023-07-23 15:51:27 +02:00
Holger Weiss a657a6d2f6 make-binaries: Apply another minor simplification 2023-07-23 15:35:09 +02:00
Holger Weiss 121acd1da7 make-binaries: Apply minor simplifications 2023-07-23 15:06:40 +02:00
Holger Weiss ec86079747 make-binaries: Don't duplicate config entries 2023-07-23 14:56:01 +02:00
Holger Weiss f1b0a9cb32 make-binaries: Don't hard-code musl version
The default is to link against the most-recent musl version available
within the crosstool-ng toolchain, which is currently 1.2.2.  Unlike
with glibc, there's no point in sticking to some older version.
2023-07-23 14:54:04 +02:00
Holger Weiss 0b6cb77b3c make-binaries: Omit unnecessary glibc setting
The CT_GLIBC_KERNEL_VERSION_NONE option is about the minimum kernel
version supported by the toolchain's glibc.  The default is to stick to
the version of the kernel headers, which should be just fine.
2023-07-23 14:52:18 +02:00
Holger Weiss 8a740d5087 make-binaries: Set kernel version for all builds
Specify the same min. supported kernel version for builds against musl
libc and glibc.
2023-07-23 14:49:07 +02:00
Jérôme Sautret 8288774787 Add EJABBERD_OPTS in ejabberdctl.cfg & revert "Improve ejabberdctl script"
EJABBERD_OPTS is used to pass options to erl only when starting
ejabberd, to enable -heart for example.

This partially reverts commit 6272c0e901.
2023-07-18 15:31:10 +02:00
Paweł Chmielowski d349e3a88e Revert "Add stun app to cond_apps in mix.exs"
Looks like this is required only when using older mix versions.

This reverts commit 2ef9fbc111.
2023-07-18 11:14:57 +02:00
Paweł Chmielowski 2ef9fbc111 Add stun app to cond_apps in mix.exs 2023-07-17 18:40:39 +02:00
Badlop 78f81de252 Improve support to stop external modules written in Elixir 2023-07-13 13:41:18 +02:00
dependabot[bot] 8d9ee8e35b Bump ex_doc from 0.29.4 to 0.30.1
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.4 to 0.30.1.
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.29.4...v0.30.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-13 13:41:14 +02:00
Badlop e66ba2e424 Improve ejabberdctl script: Copy recent commit 6272c0e90 to the container 2023-07-13 13:41:06 +02:00
Paweł Chmielowski fafb48e88f Merge pull request #4025 from jpds/increase-default-backlog
ejabberd_listener.erl: Increase default listen queue backlog value
2023-07-11 12:19:33 +02:00
Jérôme Sautret 6272c0e901 Improve ejabberdctl script
Improved handling of ERLANG_OPTS and fixed hanging process when running some ejabberdctl commands as root, such as debug or foreground.
2023-07-10 16:18:06 +02:00
Paweł Chmielowski 54314e5bb9 Better error handling in mod_muc_rtbl
Should fix issue #4050
2023-07-04 18:18:49 +02:00
Badlop ffbcf19156 Halt ejabberd if a command in CTL_ON_ fails during ejabberd startup
See processone/ejabberd-contrib#97
2023-06-20 17:54:10 +02:00
Badlop dcc8149f58 New command to halt ejabberd abruptly with an error status code
Used for processone/ejabberd-contrib#97
2023-06-20 17:54:10 +02:00
Badlop d2c54fd5fe Fix calling ejabberdctl command with wrong number of arguments with Erlang 26
In Erlang up to 25.3, the lists:zip arguments were [A1, A2]
Since Erlang 26.0, the arguments are: [A1, A2, fail]

https://github.com/erlang/otp/commit/93748a8d841efc8f8246074ca721607efecebe2d
2023-06-13 12:25:27 +02:00
Badlop f40a7b1c77 OAuth: Handle badpass error message 2023-06-13 12:25:22 +02:00
Badlop 16f758e13f Support to provide only the dependency name
This is used in ejabberd-contrib repository's ci.yml,
and useful for a custom development that doesn't require rebar2 support.
2023-06-12 20:48:47 +02:00
Badlop c333cc0776 New option install_contrib_modules
This option is read during ejabberd start or config reload.
It installs the listed modules which aren't yet installed,
as long as allow_contrib_modules is not disabled.
Edit ejabberd.yml and configure the desired ejabberd-contrib modules,
add them in the install_contrib_modules option,
finally start ejabberd (or reload config).
2023-06-09 10:27:13 +02:00
Badlop 3263e81972 Move Xref and Dialyzer options from workflows to rebar.config
And also include some more applications in Dialyzer plt_extra_apps,
which apparently is required since Erlang 26.
2023-06-09 00:02:20 +02:00
Badlop 397a08afca Move configure options from the Test to the Compile section 2023-06-09 00:02:18 +02:00
Badlop 19070e4b04 Add sections to rebar.config to organize its content 2023-06-09 00:02:17 +02:00
Badlop 0bbc255814 Dialyzer dirty workarounds because re:mp() is not an exported type
Since Erlang/OTP 26, Dialyzer by default reports unknown types.
ejabberd's type specs refer to the re:mp() type,
but that isn't exported in the OTP source code,
and cannot be used in any other modules.
This commit provides very dirty workarounds, and any cleaner
alternative is very welcomed.
2023-06-09 00:02:15 +02:00
Badlop 1b06f4ca4f The warnings_as_errors compiler option is already disabled by default 2023-06-09 00:02:13 +02:00
Badlop b3eeac637f Update tests to Erlang/OTP 26 and recent Elixir 2023-06-09 00:02:10 +02:00
Badlop 480b42b36d Run Dialyzer again with Erlang/OTP 26, and let's solve its problems 2023-06-09 00:02:06 +02:00
Badlop 436074c67a When installing module already configured, keep config as example
When installing a module using ext_mod, if it has already configuration
in the modules section, copy its specific config file as an example
(copy file and rename it).
This may happen when using the new install_contrib_modules option.
2023-06-09 00:02:02 +02:00
Badlop c9a2117570 Ignore .tool-versions in git, this file is used by asdf 2023-06-09 00:01:56 +02:00
sando38 6155b001b4 Dockerfile: Reorder stages and steps for consistency
Also avoid duplicated lines.
2023-06-09 00:01:54 +02:00
sando38 8f05af7810 Dockerfile: Use Alpine as base for METHOD=package
No need to use the "large" docker.io/erlang image as we do not need any erlang/otp for the binary installers.
2023-06-09 00:01:51 +02:00
sando38 33ac7916d3 Dockerfile: Cosmetic changes
Ommit the path to ejabberdctl as it is already located at the $PATH

Also, do not copy Dockerfile into the container as this may unnecessarily trigger re-compiling of ejabberd.
2023-06-09 00:01:49 +02:00
sando38 461c1ddf3d Dockerfile: Rename packages to improve compatibility
Rename libcap packages to improve compatibility between Alpine versions. This may be beneficial if one specifies an OTP_VSN which was built using an older Alpine base version.

The alpine package libcap has been splitted into libcap2 and libcap-utils in Alpine 3.17. 'libcap' is now an alias for libcap2 and libcap-utils. We define 'so:libcap.so.2' for the runtime stage, as we only need the libraries, not the binaries.
2023-06-09 00:01:46 +02:00
sando38 2428f74fbd Dockerfile: Provide specific OTP and elixir vsn for direct compilation
Ejabberd images can now be built with specific erlang/OTP and elixir vsn with the new build arguments OTP_VSN and ELIXIR_VSN.
2023-06-09 00:01:36 +02:00
Paweł Chmielowski bb8e892323 Add alternate version of mysql upsert
This one works by issuing select and then insert or update or skip depending
on what select returns. We use this on mysql 5.7.26 and 8.0.20 where
previous implementation using 'replace' or 'on conflict update' can cause
excessive deadlocks.
2023-06-07 16:38:07 +02:00
Paweł Chmielowski 3eecf4ae8a Remove existing role information for users that are kicked from room
This should fix issue reported in #4035
2023-05-24 12:15:20 +02:00
Paweł Chmielowski 4a53d4cb56 Expand rule "mucsub subscribers are members in members only rooms" to more places 2023-05-24 11:26:48 +02:00
Paweł Chmielowski 1818a29c29 Don't crash in mod_shared_roster_ldap:get_member_jid on empty output
This based on crash from issue #3614
2023-05-22 12:48:29 +02:00
Paweł Chmielowski dd2efc360b Fix return values from calculate_diff inside mod_privacy_sql 2023-05-02 15:59:40 +02:00
Paweł Chmielowski 8e64992f47 Use more efficient way to calculate changes in set_privacy_list 2023-05-02 11:43:29 +02:00
Jonathan Davies 040c72f1c8 ejabberd_listener.erl: Increase default listen queue backlog value to 128, which
is the default value on both Linux and FreeBSD.
2023-04-25 20:11:04 +01:00
Badlop d95a1bac3e Use container names to differentiate them; don't force logo height 2023-04-25 09:50:19 +02:00
Badlop c6b295b5a0 Fix typo in the previous commit 2023-04-25 09:48:02 +02:00
Badlop 2a4a6bec18 Add trailing backslash to URLs shown in mod_muc_log disco#info 2023-04-24 13:43:09 +02:00
Badlop 0d3f8c7b9f Make mod_register_web redirect to page that end with / (#3177)
Code copied from ejabberd_web_admin.erl, commit 5ec21438
2023-04-24 13:43:07 +02:00
Badlop d299b97261 Raise Erlang/OTP requirement to 20.0 2023-04-24 13:43:00 +02:00
Paweł Chmielowski 5b8ebed81b Optimize mod_privacy_sql:set_list
Previously we always did delete everything and set all entries back, now
we check if we need to delete anything and if not insert only missing data.
2023-04-20 10:55:30 +02:00
Badlop bb28265261 Set version to 23.04
Container / Container (push) Failing after 1m47s
Installers / Binaries (push) Failing after 56s
Runtime / Rebars (20.3, rebar) (push) Failing after 3s
Runtime / Rebars (20.3, rebar3) (push) Failing after 3s
Runtime / Rebars (25.3, rebar) (push) Failing after 3s
Runtime / Rebars (25.3, rebar3) (push) Failing after 2s
Runtime / Rebars (26, rebar3) (push) Failing after 1m24s
Installers / Release (push) Has been skipped
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (25.3) (push) Has been cancelled
CI / Tests (26.0-rc3) (push) Has been cancelled
Runtime / Mix (1.10.3, 21.3) (push) Has been cancelled
Runtime / Mix (1.10.3, 22.0) (push) Has been cancelled
Runtime / Mix (1.11.4, 21.3) (push) Has been cancelled
Runtime / Mix (1.11.4, 22.0) (push) Has been cancelled
Runtime / Mix (1.12.3, 22.0) (push) Has been cancelled
Runtime / Mix (1.13.0, 22.0) (push) Has been cancelled
Runtime / Mix (1.13.0, 25.0) (push) Has been cancelled
Runtime / Mix (1.14.0, 25.0) (push) Has been cancelled
2023-04-18 11:39:33 +02:00
Paweł Chmielowski 46f33e5051 Update dependencies 2023-04-18 11:22:33 +02:00
Badlop 06669b12e8 Update changelog 2023-04-18 11:12:18 +02:00
Badlop 1ca126381b Update man 2023-04-18 10:37:22 +02:00
dependabot[bot] bf5de81b24 Bump ex_doc from 0.29.3 to 0.29.4
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.3 to 0.29.4.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.29.3...v0.29.4)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 10:37:16 +02:00
Badlop d717ffd1a0 Update version notes of options and commands 2023-04-18 10:37:14 +02:00
Badlop c271d73dbd CI: Update Erlang/OTP to 26.0-rc3 2023-04-18 10:37:11 +02:00
Badlop e1a8980d6c Container: no need to specify captcha_url, auto may be enough in most cases 2023-04-18 10:37:08 +02:00
Badlop ec7ff88dda Update Portuguese translation (thanks to Silvério Santos) 2023-04-18 10:37:06 +02:00
Badlop 5b695766ae Mention what ejabberd version first supports rtbl 2023-04-18 10:37:04 +02:00
Paweł Chmielowski f5b6909cca Unregister hooks on stop in mod_muc_rbtl 2023-04-17 18:03:21 +02:00
Paweł Chmielowski 98d348893b Make mod_muc_rtbl notify only local node rooms 2023-04-17 17:07:59 +02:00
Paweł Chmielowski c942c31e38 Add mod_muc_rtbl
This implements Real-time blocklists for XMPP (xmppbl.org).

Closes #4017
2023-04-17 16:59:42 +02:00
Paweł Chmielowski 70cbdd1117 Allow to update state from muc_process_iq hook 2023-04-17 16:57:54 +02:00
Paweł Chmielowski 1114a35e0a Recognize message retractions in mod_muc 2023-04-14 12:32:35 +02:00
Paweł Chmielowski d12e5a44b8 Add by attribute to generated muc moderation messages 2023-04-14 12:31:34 +02:00
Badlop 34420444db Container: Revert change in entrypoint that was added in d15cf994a 2023-04-11 15:29:28 +02:00
Badlop 38eb50bf5c Container: Reorganize how to build container image 2023-04-11 15:29:26 +02:00
Badlop 6705679cf3 Container: Update instructions to build image following d15cf994a (#3983) 2023-04-11 15:29:24 +02:00
Badlop 10635bccc9 Container: Reword sentences about docker.io and ghcr.io 2023-04-11 15:29:23 +02:00
Badlop dee0ec50b9 Remove ci-19.3, as Github Actions no longer supports ubuntu-18.04 2023-04-11 15:29:21 +02:00
sando38 401bdedae8 Dockerfile: Detect runtime dependencies automatically
Only libcap2 and tini can't be auto-detected. libcap2 has been renamed in Alpine version 3.17, hence the Dockerfile is not compatible with Alpine versions <3.17
2023-04-11 15:27:49 +02:00
Badlop 99e51a2123 Mention in mod_mam.erl its support for XEP-0425: Message Moderation
Then run "make doap" to regenerate ejabberd.doap
2023-03-30 17:02:54 +02:00
Badlop d43ce53f9a Update xmpp version in mix following commit 6da1bb5b2 2023-03-30 16:54:35 +02:00
Paweł Chmielowski f6385fae50 Fix dialyzer warning 2023-03-30 14:53:51 +02:00
Paweł Chmielowski 6da1bb5b22 Add support for "xep-0424 Message Moderation"
This fixes issue #3730
2023-03-30 14:38:08 +02:00
Badlop 64e1cfcbba Test only with oldest OTP supported, newest stable and bleeding edge 2023-03-28 11:41:57 +02:00
Badlop fbfcebf417 Container: Remove Elixir Matchers to prevent useless warnings in github actions page 2023-03-28 11:41:56 +02:00
Saarko d15cf994a2 Container: Add METHOD to build container using packages (#3983)
make-*: include musl build in make-binaries

Ctr actions: use github runners to provide bootstrap erlang

- adjust make-binaries script to use github runners' installed erlang
  for bootstrapping
- this reduces the need to build an unnecessary toolchain for glibc
  based binaries
2023-03-28 11:41:54 +02:00
Saarko c71887db43 Container: Add tini as runtime init 2023-03-28 11:41:52 +02:00
Badlop 7c634f3615 Container: No need of openssl package at runtime 2023-03-28 11:41:51 +02:00
Badlop 874b961680 Container: Remove unused Mix stuff: ejabberd script and static COOKIE
Instead of including this file in the container with static content:
  /opt/ejabberd-master/releases/COOKIE
the cookie file will be generated by erlang in
  /opt/ejabberd/.erlang.cookie
or by ejabberdctl if ERLANG_COOKIE environment variable was provided.
2023-03-28 11:41:49 +02:00
Badlop 2c1ee698cc Container: Copy captcha scripts to /opt/ejabberd-*/lib like the installers
Instead of a path like
  /opt/ejabberd-master/lib/ejabberd-23.1.0/priv/bin
they are now in
  /opt/ejabberd-master/lib
2023-03-28 11:41:47 +02:00
Badlop b0f0dd3227 Container: Expose only HOME volume, it contains all the required subdirs 2023-03-28 11:41:46 +02:00
Badlop de477f7b6c Container: Update Alpine to 3.17 to get Erlang/OTP 25 and Elixir 1.14 2023-03-28 11:41:44 +02:00
Saarko 440ede313b make-binaries: fix building with erlang/otp v25.x
Signed-off-by: sando38 <sandomir@tutanota.com>
2023-03-28 11:41:43 +02:00
Saarko 976c6c5e41 make-binaries: bump versions, e.g. erlang/otp to 25.3 2023-03-28 11:41:41 +02:00
Badlop 7e6d25314d make-packages: Fix for installers workflow, which didn't find lynx... 2023-03-28 11:41:39 +02:00
Badlop cc5c3f7b2c ejabberdctl: Don't use .../releases/COOKIE, it's no longer included
And slightly clean the .erlang.cookie line
This partially reverts 9c23a7dc3f
2023-03-28 11:41:33 +02:00
Badlop 1d62dc4621 Set roster name from XEP-0172, or the stored one (#1611) 2023-03-28 11:41:27 +02:00
Badlop e2496562f9 Preliminary support to store extra elements in subscription request (#840) 2023-03-28 11:41:24 +02:00
Badlop c4a2f8d64f captcha_url option now accepts 'auto' value, and it's the default 2023-03-22 16:23:41 +01:00
Badlop 6c620f6f43 Remove wrong get_room_history command fields specification 2023-03-22 16:23:37 +01:00
dependabot[bot] af29adb558 Bump ex_doc from 0.29.2 to 0.29.3
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.2 to 0.29.3.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/v0.29.3/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.29.2...v0.29.3)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 16:23:33 +01:00
Paweł Chmielowski 3c97775573 Pubsub xdata fields max_item/item_expira/children_max use 'max' not 'infinity'
Codec in xmpp crashes when we use infinity (see issue #4011), so lets
convert those values before passing them to xmpp:encode(0
2023-03-21 15:30:44 +01:00
Blake Miller f953dc3f5e Persist none role for outcasts
`none` roles *should* be persisted for banned users. I totally forgot about this, my bad. I'm shocked nobody else noticed it.
2023-03-20 17:07:10 +01:00
dependabot[bot] 04b431f191 Bump ex_doc from 0.29.1 to 0.29.2
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.1 to 0.29.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.29.1...v0.29.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 13:11:26 +01:00
Badlop 5cd6c524ea Allow XML to be visible in web browser in Common Test page 2023-03-07 13:11:24 +01:00
Badlop 37676757e3 CI: Add OTP 26.0-rc1 to the test matrix
But disable dialyzer in 26, as it complains verbosely without reason
2023-03-07 13:11:22 +01:00
Badlop 1c82daacb2 CI: Upload Common Test logs as artifact in case of failure 2023-03-07 13:11:21 +01:00
Badlop 9f0a5c5ef0 CI: Produce less verbose logs for tests
This gets a line first introduced in 5b5548b8c that was lost later
2023-03-07 13:11:19 +01:00
Badlop 9bb86132c6 CI: Use default verbosity to let log files contain XMPP stanzas
This partially reverts 2a7780507
2023-03-07 13:11:17 +01:00
Badlop 2137a4f663 Fix Shellcheck warnings in shell scripts 2023-02-21 18:17:26 +01:00
Badlop c9143dd3d8 Fix TSQLlint warnings in MSSQL test script 2023-02-21 18:17:25 +01:00
Badlop 66d58504d0 Fix TSQLlint warning about typo in mssql.new.sql 2023-02-21 18:16:59 +01:00
Badlop 0def333550 Fix Remark-lint warnings 2023-02-21 18:14:02 +01:00
Badlop dea452bdfd Fix Prospector and Pylint warnings in test extauth.py 2023-02-21 18:14:02 +01:00
dependabot[bot] d504ed8a9b Container: Bump docker/build-push-action from 3 to 4
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-21 18:13:15 +01:00
Paweł Chmielowski 9503beca6c Make mod_muc_room:set_opts process persistent flag first
As processing some other options depends on this setting flag in room
state.
2023-02-20 13:42:52 +01:00
Paweł Chmielowski dfe4884d16 Allow passing affiliations and subscribers to create_room_with_opts command 2023-02-20 13:03:46 +01:00
Paweł Chmielowski f10f6d176f Store state in db in mod_muc:create_room() 2023-02-20 12:56:41 +01:00
Paweł Chmielowski 4e7aa41e3f Make subscribers members by default 2023-02-20 12:55:31 +01:00
Paweł Chmielowski d91812730b Stop ejabberd_system_monitor before stopping node
Sometimes monitor module is performing checks when node is stopping and
this causes crash in monitoring process.
2023-02-08 19:53:19 +01:00
Paweł Chmielowski 54cf37e917 Invalidate vcard_xupdate cache on all nodes when vcard is updated 2023-02-08 19:06:44 +01:00
Paweł Chmielowski 3de803be2f Add get_room_history command in mod_muc_admin 2023-02-08 11:04:26 +01:00
Paweł Chmielowski 5ca59807d9 Fix problem with results of mam queries using rsm with max and before
Plus add test case for it.
2023-02-03 11:37:54 +01:00
Paweł Chmielowski 5c3b43cd63 Update spec 2023-02-01 17:32:22 +01:00
Paweł Chmielowski 1a6baf223c Re-allow anonymous connection for connection without client certificates
This fixes issue #3985. Initial issue was introduced in
5506b838c8 adding tls client cert
authentication.
2023-02-01 16:58:25 +01:00
Paweł Chmielowski 74c9aa8ac0 Merge pull request #3982 from nosnilmot/sql-update-tests
SQL schema migration fixes and testing
2023-02-01 12:03:48 +01:00
Badlop fb16727180 Ammend previous commit with another fix 2023-01-27 15:40:34 +01:00
Badlop 9842b035e3 Fix compilation problem with Erlang/OTP older than 21 introduced recently
Those macros were first introduced in c88a2d0
2023-01-27 15:29:41 +01:00
Alexey Shchepin f6b5a52104 Add s2s_out_bounce_packet hook 2023-01-27 03:54:31 +03:00
Alexey Shchepin f650b1e83c Log HTTP handler exceptions 2023-01-27 03:54:31 +03:00
Badlop 03cbc9b004 Revert previous commit, stick with Alpine 3.16 and Erlang/OTP 24 (#3983)
Alpine 3.17 includes Erlang/OTP 25, and it segfaults when
used in QEMU for arm64.

Revert "Update Alpine to 3.17 to get Elixir 1.14 required by recent libraries"
This reverts commit 43cae922f3.
2023-01-26 14:53:14 +01:00
Badlop 43cae922f3 Update Alpine to 3.17 to get Elixir 1.14 required by recent libraries 2023-01-25 17:58:27 +01:00
Badlop c5c7e7fc4d ext_mod: Improve support for loading *.so files from ext_mod dependencies
Copying files from deps/*/priv/*.so to the ejabberd priv/
is not possible when running ejabberd as OTP release or in a container.
Instead, let's copy the deps/*/priv/*.so maintaining the file structure,
and then using code:add_pathz for those dirs.

This partially reverts 5c1b72853f
2023-01-25 17:58:12 +01:00
Stu Tomlinson 0c1cf43519 Fix a long standing bug in new schema migration
... and make the test that uncovered it explicitly fail (there was already a
TODO) instead of passing but with errors logged
2023-01-21 15:42:43 +00:00
Stu Tomlinson cbbf85c555 Add support for running tests on MS SQL 2023-01-21 15:42:43 +00:00
Stu Tomlinson 56e974ab80 Add ability to run tests on upgraded DB
To test update_sql operation and functionality of resulting DB:

1. Load original schema to DB
2. Set {update_sql, true} in suite.erl
3. Run tests
2023-01-21 15:42:43 +00:00
Stu Tomlinson 9398052b65 New schema migration 'update_sql' improvements
- check that server_host column does not already exist before addding it
  and making other changes to table (update_sql becomes idempotent,
  yay!)
- check that indexes exist before dropping them (some are historical and
  are not created in more recent deployments), elminating spurious
  errors from logs
- update new_sql_schema config after migration, to allow near
  zero-downtime migrations (and help with automated testing)
2023-01-21 14:54:36 +00:00
Stu Tomlinson 6a8899677d Un-deprecate ejabberd_config:set_option/2
There does not appear to be an alternative way to set individual config
options, and this is already used by test/ejabberd_SUITE.erl
2023-01-21 14:54:36 +00:00
Paweł Chmielowski 3b34538038 Remove debug line from last commit 2023-01-20 17:12:50 +01:00
Paweł Chmielowski 6cf1e05993 Try to populate room history from mam when unhibernating 2023-01-20 16:27:08 +01:00
Paweł Chmielowski baf1336761 Merge pull request #3980 from nosnilmot/sql-maintenance
SQL related fixes and updates
2023-01-20 14:18:55 +01:00
Stu Tomlinson 4f0e426a12 Change PostgreSQL SERIAL to BIGSERIAL columns
This is consistent with other schemas, internally consistent with
foreign keys, and allows for > 2B records in these tables.
2023-01-19 23:36:42 +00:00
Stu Tomlinson d5bf051e79 Fix minor SQL schema inconsistencies 2023-01-19 23:36:42 +00:00
Stu Tomlinson c7c982b67b Add MS SQL support for new schema migration 2023-01-19 23:36:42 +00:00
Stu Tomlinson f7f0d3b1fb Enable MySQL support for new schema migration 2023-01-19 23:36:42 +00:00
Stu Tomlinson d4ab4d16e8 Use python3 to run extauth.py for tests 2023-01-19 23:36:42 +00:00
Stu Tomlinson aeed1679d8 Add 'new' schema for MS SQL 2023-01-19 23:36:42 +00:00
Stu Tomlinson 6fc67d83f4 Minor MS SQL improvements
Support 'sql_ssl' option for MS SQL - set Encryption=required and
Encrypt=yes in ODBC connection string to require SSL using default
FreeTDS driver and Microsoft ODBC Driver for SQL Server repectively.

Allow setting full ODBC connection string in 'sql_server' for MS SQL,
allowing custom connection configuration beyond what is possible with
just 'sql_odbc_driver' option.
2023-01-19 23:36:42 +00:00
Stu Tomlinson 06ffe995e1 Remove unnecessary indexes
For columns are already included in a compound index there is no
benefit to having a separate index with a subset of the same columns in
the same order, it just wastes space.
2023-01-19 23:36:42 +00:00
Stu Tomlinson 93bf4d5411 New SQL schema migrate fix
'server_host' column on 'route' table already exists in old schema and
does not need adding for new schema migration.
2023-01-19 23:36:42 +00:00
Stu Tomlinson 19f2f1fa86 Fix MS SQL error caused by ORDER BY in subquery
'The ORDER BY clause is invalid in views, inline functions, derived
tables, subqueries, and common table expressions, unless TOP, OFFSET
or FOR XML is also specified.'

Omit the ORDER BY clause from subquery if the SELECT is not constrained
by TOP.
2023-01-19 23:36:42 +00:00
Stu Tomlinson 5e94fdcfd5 MS SQL schema fixes
* Add missing 'mix' tables and indexes

* Fix text vs varchar issues

Various tests triggered this error:
The data types text and varchar are incompatible in the equal to operator.

Caused by incompatible 'text' columns in muc_online_room,
muc_online_users, pubsub_node_option, and pubsub_node tables.

* Fix definition of mqtt_pub table

This table incorrectly included 'server_host' column in old schema, and
had other inconsistencies.
2023-01-19 23:35:05 +00:00
Stu Tomlinson ec6f5c17c8 Correct README for creating test docker MS SQL DB 2023-01-19 14:06:11 +00:00
Paweł Chmielowski 758c87f564 Revert notes placement when generating markdown api commands documentation 2023-01-19 13:24:51 +01:00
Paweł Chmielowski b6dde41000 Improve output in gen_html_doc_for_commands command 2023-01-19 11:45:33 +01:00
Stu Tomlinson 648c83ea03 Fix ejabberdctl output formatting (#3979)
ECMA-48 SGR sequence ESC [21m is actually 'set double underline' but was
incorrectly implemented as 'set normal intensity' in Linux prior to
4.17.

The correct sequence for 'set normal intensity' is ESC [22m, which fixes
output formatting of 'ejabberdctl' and 'ejabberdctl help' on macos.
2023-01-19 11:18:59 +01:00
Paweł Chmielowski cc4cacdb5e Set version to 23.01
Container / Container (push) Failing after 4m4s
Installers / Binaries (push) Failing after 50s
Runtime / Rebars (19.3, rebar) (push) Failing after 2s
Runtime / Rebars (19.3, rebar3) (push) Failing after 2s
Runtime / Rebars (20.3, rebar) (push) Failing after 3s
Runtime / Rebars (20.3, rebar3) (push) Failing after 2s
Runtime / Rebars (24.3, rebar) (push) Failing after 2s
Runtime / Rebars (24.3, rebar3) (push) Failing after 3s
Runtime / Rebars (25, rebar) (push) Failing after 2s
Runtime / Rebars (25, rebar3) (push) Failing after 2s
Installers / Release (push) Has been skipped
CI (19.3) / Tests (19.3) (push) Has been cancelled
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (21.3) (push) Has been cancelled
CI / Tests (24.3) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
Runtime / Mix (1.10.3, 21.3) (push) Has been cancelled
Runtime / Mix (1.10.3, 22.0) (push) Has been cancelled
Runtime / Mix (1.11.4, 21.3) (push) Has been cancelled
Runtime / Mix (1.11.4, 22.0) (push) Has been cancelled
Runtime / Mix (1.12.3, 22.0) (push) Has been cancelled
Runtime / Mix (1.13.0, 22.0) (push) Has been cancelled
Runtime / Mix (1.13.0, 25.0) (push) Has been cancelled
Runtime / Mix (1.14.0, 25.0) (push) Has been cancelled
2023-01-17 11:35:52 +01:00
Paweł Chmielowski c84cdb6bfb Update mix dependences 2023-01-17 11:24:28 +01:00
Paweł Chmielowski a7ea8ecc29 Use tagged versions of dependences 2023-01-17 11:24:28 +01:00
Badlop 24839ad4be Fix typos in documentation and changelog 2023-01-16 18:34:09 +01:00
Badlop e11b89efd2 Get back mod_sip documentation and version number in the man page 2023-01-16 16:30:50 +01:00
Paweł Chmielowski 4566c82a85 Update man file 2023-01-16 16:24:44 +01:00
Paweł Chmielowski 024f3be13a Update mod_mqtt_bridge documentation 2023-01-16 15:33:37 +01:00
Badlop af2dae2ff3 Update changelog 2023-01-16 15:20:16 +01:00
Badlop d92372af70 Update man page 2023-01-16 15:10:31 +01:00
Badlop a70381e7c1 Annotate options that change in ejabberd 23.01 2023-01-16 15:10:29 +01:00
Badlop 21c0aaf417 Container: Replace set-output command with environment file
Announced in:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-01-16 15:10:28 +01:00
Badlop ce10bed5d8 Container: Update Alpine to 3.16, the latest one cached in Github Actions 2023-01-16 15:10:27 +01:00
Badlop eb12c1db1b Update check_xep_versions.sh to support extended -protocol attribute (#3915) 2023-01-16 15:10:25 +01:00
Badlop 276c11b04a Fix doc of log_modules_fully allowed value 2023-01-16 15:10:24 +01:00
Badlop 0255562d93 Fix doc of outgoing_s2s_families default value, it changed in 25ddd7b 2023-01-16 15:10:22 +01:00
Paweł Chmielowski 26a7107cd5 Fix dialyzer warning 2023-01-16 12:14:21 +01:00
Paweł Chmielowski 89918865b0 Implement reload in mqtt_bridge 2023-01-16 11:22:17 +01:00
Paweł Chmielowski f2cbe7f3c2 Recognize ws5/wss5 urls in mqtt_bridge 2023-01-16 11:01:24 +01:00
Paweł Chmielowski 83418c3195 Fix warning in mqtt_bridge 2023-01-16 11:01:04 +01:00
Paweł Chmielowski 5592f8df1a Make dialyzer happy 2023-01-13 20:34:49 +01:00
Paweł Chmielowski 4311a5646f Add support for websockets to mqtt bridge 2023-01-13 20:09:10 +01:00
Badlop c103182bc7 Update German translation (thanks to Johannes Keyser) 2023-01-10 13:52:06 +01:00
Badlop 243697e25a Update copyright year to 2023 (#3967) 2023-01-10 13:52:04 +01:00
dependabot[bot] dfc6e7833c Bump ex_doc from 0.28.4 to 0.29.1
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.4 to 0.29.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.28.4...v0.29.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 13:52:02 +01:00
Badlop e0b4ea6652 Update jose to 1.11.5 when Erlang/OTP is 21 or higher
But use old jose 1.11.1 on Erlang/OTP older than 21
Erlang older than 21 does not support
  try catch _Class:_Reason:_Stacktrace ->
that is used in jose_server.erl
2023-01-10 13:51:56 +01:00
Badlop 503ad8e905 Fix bash completion when using Relive or other install methods 2023-01-10 13:51:53 +01:00
Frédéric Fauberteau d26a9d583f Fix portability issue with some shells (#3970) 2023-01-09 16:26:36 +01:00
Jérôme Sautret 0b1800fc10 Add hooks for mqtt subscribe & unsubscribe events 2023-01-05 14:58:18 +01:00
Badlop 92d7be4338 Use alternative split/2 function that works with Erlang/OTP as old as 19.3 2023-01-03 20:32:52 +01:00
Badlop ce89ff07e7 Fix "make hooks" 2023-01-03 19:13:43 +01:00
Badlop 5c1b72853f External modules: compile C files and install them in ejabberd's priv 2023-01-03 18:48:44 +01:00
Badlop 5d38143c3f Initialize captcha system after loading modules and external modules
Since recently, ejabberd_captcha instead of a script may use a module,
for example the external module mod_ecaptcha, which must be loaded first.
2023-01-03 18:48:42 +01:00
Badlop 353c68cfa6 Add support to define module instead of path to script 2023-01-03 18:48:40 +01:00
Badlop 9087e72f0e Update image key, some scripts generate their own random key 2023-01-03 18:48:38 +01:00
Badlop 4ad4a3bf24 Support to get module status from Elixir modules 2022-12-22 14:00:38 +01:00
Badlop 17160e9379 Container: Update Actions versions as requested by GitHub Actions 2022-12-22 14:00:36 +01:00
Jonathan Davies ed84fee2bf ejabberd_options_doc.erl: Added outgoing_s2s_families deprecation
notice.

Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2022-12-22 14:00:22 +01:00
Jonathan Davies 25ddd7b152 Changed default outgoing_s2s_families to IPv6 as servers are within datacenters
where IPv6 is more commonly enabled (contrary to clients), and if it's not
present - it'll just fall back to IPv4.
2022-12-22 14:00:22 +01:00
Paweł Chmielowski 5ad709a2e2 Fix typo in last commit 2022-12-21 11:13:49 +01:00
Paweł Chmielowski 32ace140df Don't store mucsub presence events in offline storage
This is expanded version of pull request #3959
2022-12-21 11:12:08 +01:00
Paweł Chmielowski bc063b8f97 Fix crash when api_permisions don't have who: section
Default value of that field was wrong, so lets correct this.

This fixes issue #3957
2022-12-15 11:27:20 +01:00
Badlop 03681cd68d Expose the pubsub#type field in disco#info query to the node (#3914) 2022-12-13 23:57:34 +01:00
Badlop fe8b98a1f3 When using erlef, Erlang/OTP 21 is only available in ubuntu 20.04
See
https://github.com/erlef/setup-beam#compatibility-between-operating-system-and-erlangotp
2022-12-13 23:57:31 +01:00
Badlop a193128543 Fix path where gem is installed and fpm can be found 2022-12-13 23:24:01 +01:00
Badlop 6a10048339 Document the new log_modules_fully option 2022-12-13 23:24:01 +01:00
Badlop 9087dd9210 Improve .devcontainer to use use devcontainer image and .vscode 2022-12-13 23:24:01 +01:00
Badlop a08c038c9c Add .vscode files to instruct VSCode how to run ejabberd 2022-12-13 23:24:01 +01:00
Badlop e191bc253d Add Erlang LS default configuration 2022-12-13 23:24:01 +01:00
Badlop c8d866d01a Add Elvis default configuration 2022-12-13 23:24:01 +01:00
Badlop 01d25c5c37 Let setup-relive.sh normally end with no error status 2022-12-13 23:24:01 +01:00
Paweł Chmielowski 25d6b3d1c8 Fix dialyzer warnings 2022-12-07 14:08:23 +01:00
Paweł Chmielowski 639183a783 Add support for certificate authentication in mqtt bridge 2022-12-07 13:38:05 +01:00
Paweł Chmielowski 80477f71b3 Add misc:uri_parse/2 to allow declaring default ports for protocols 2022-12-07 13:34:29 +01:00
Paweł Chmielowski d49b50a055 Add log_modules_fully option to make some modules log everything independed from global loglevel 2022-12-01 13:24:46 +01:00
Paweł Chmielowski 54592202ef Allow admin command to subscribe new users to members_only rooms 2022-12-01 11:52:39 +01:00
Paweł Chmielowski be60263d47 Fix dialyzer warnings in mod_mqtt_bridge 2022-11-24 16:23:37 +01:00
Badlop 441eca75b2 hibernation_time is not an option worth storing in room state (#3946) 2022-11-23 18:40:28 +01:00
Badlop 266dd98521 OAuth: Accept jid as a HTTP URL query argument 2022-11-23 18:40:26 +01:00
Badlop b0e74464b1 OAuth: Handle when client is not identified 2022-11-23 18:40:23 +01:00
Badlop daaaf221cb Don't set i18n option because Converse enforces it instead of browser lang (#3951) 2022-11-23 18:39:49 +01:00
Paweł Chmielowski e2779e1155 Try to redirect access to files mod_conversejs to cdn when there is no local copies 2022-11-23 16:28:42 +01:00
Paweł Chmielowski 514bab47a2 Add hook for mqtt publish event 2022-11-23 15:16:43 +01:00
Paweł Chmielowski fbea49dbab Add mqtt bridge module 2022-11-23 14:50:18 +01:00
chengshq 5cf9b052dd Jid format when multicastc was cached (#3950)
The error log:

```2022-11-22 04:10:25.436648+00:00 [error] <0.515.0>@ejabberd_router:route/1:95 Failed to route packet:
#message{
    id = <<>>,type = normal,lang = <<>>,
    from =
        #jid{
            user = <<"a123">>,server = <<"conference.example.com">>,
            resource = <<>>,luser = <<"a123">>,
            lserver = <<"conference.example.com">>,lresource = <<>>},
    to = <<"multicast.app.example.com">>,subject = [],body = [],
    thread = undefined,
    sub_els =
        [#ps_event{
             items =
                 #ps_items{
                     xmlns = <<>>,
                     node = <<"urn:xmpp:mucsub:nodes:subscribers">>,
                     items =
                         [#ps_item{
                              xmlns = <<>>,id = <<"5803948964051348597">>,
                              sub_els =
                                  [#muc_subscribe{
                                       nick = <<"bb">>,password = <<>>,
                                       jid = undefined,events = []}],
                              node = <<>>,publisher = <<>>}],
                     max_items = undefined,subid = <<>>,retract = undefined},
             purge = undefined,subscription = undefined,delete = undefined,
             create = undefined,configuration = undefined},
         #addresses{
             list =
                 [#address{
                      type = bcc,
                      jid =
                          #jid{
                              user = <<"aaa">>,server = <<"app.example.com">>,
                              resource = <<>>,luser = <<"aaa">>,
                              lserver = <<"app.example.com">>,lresource = <<>>},
                      desc = <<>>,node = <<>>,delivered = undefined,
                      sub_els = []},
                  #address{
                      type = bcc,
                      jid =
                          #jid{
                              user = <<"bb">>,server = <<"app.example.com">>,
                              resource = <<>>,luser = <<"bb">>,
                              lserver = <<"app.example.com">>,lresource = <<>>},
                      desc = <<>>,node = <<>>,delivered = undefined,
                      sub_els = []}]}],
    meta = #{}}
** exception error: {badrecord,jid}
   in function  ejabberd_router:do_route/1 (src/ejabberd_router.erl, line 394)
   in call from ejabberd_router:route/1 (src/ejabberd_router.erl, line 92)
   in call from maps:fold_1/3 (maps.erl, line 232)
   in call from mod_multicast:handle_info/2 (src/mod_multicast.erl, line 206)
   in call from gen_server:try_dispatch/4 (gen_server.erl, line 637)
   in call from gen_server:handle_msg/6 (gen_server.erl, line 711)
   in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 249)```


Then command debug select the multicastc:
```
(ejabberd@localhost)2> mnesia:dirty_read(multicastc, <<"app.example.com">>).
[{multicastc,<<"app.example.com">>,
             {{multicast_supported,<<"multicast.app.example.com">>,
                                   {limits,{default,20},{default,20}}},
              cached},
             63836303692}]```

The type of `Service` was binary.
2022-11-22 12:11:31 +01:00
Holger Weiss 3b50cd36ba Merge remote-tracking branch 'processone/pr/3945'
* processone/pr/3945:
  make-binaries: reduce log output
  make-binaries: Bump zlib version to 1.2.13
2022-11-16 16:20:10 +01:00
Stu Tomlinson ed678f58d3 make-binaries: reduce log output
Reduce log output from make-binaries:
 - quieter curl downloads
 - quiet build of crosstool-ng
 - disable crosstool-ng progress bar
2022-11-16 13:41:57 +00:00
Stu Tomlinson aa8d800577 make-binaries: Bump zlib version to 1.2.13
Update zlib to 1.2.13 to address CVE-2022-37434

Also change zlib download to use archive URL so builds do not fail
when specified version is no longer the current version
2022-11-16 13:41:42 +00:00
Stu Tomlinson a1cfae8c98 pgsql: do not set standard_conforming_strings to 'off' (#3944)
Since f9120f75b0 string literals use escape string syntax (E'...') on
pgsql, so it is no longer necessary to set standard_conforming_strings
to 'off'

Fixes #3932
2022-11-16 13:58:30 +01:00
Badlop c6513fcfc6 Handle mnesia_system_event mnesia_up when other node joins this (#3842) 2022-11-14 18:45:20 +01:00
Badlop d3d50b456e Fix compilation warnings with Elixir 1.14
warning: missing parentheses for expression following "do:" keyword.
Parentheses are required to solve ambiguity inside keywords.
2022-11-14 18:45:20 +01:00
Badlop 196eca2dc4 Runtime: Add Elixir 1.14 to the test matrix 2022-11-14 18:45:17 +01:00
Paweł Chmielowski 6fcfe80a65 Pass ssl options to mysql driver 2022-11-14 11:19:51 +01:00
Paweł Chmielowski 992d998695 Silent warning in OTP24 about not specified cacerts in sql connections 2022-11-14 11:18:26 +01:00
Badlop e58920b2c6 Container: Update link to the local example of CTL_ON_CREATE usage 2022-11-07 22:38:55 +01:00
Badlop 0804f46095 Container: Add Composer Examples section 2022-11-07 22:19:40 +01:00
Badlop 662d9a0ed0 Container: Raise sections levels to improve legibility in GitHub web TOC 2022-11-07 22:19:22 +01:00
Badlop d957404adc Add link in README to the ProcessOne Downloads page 2022-11-07 18:56:53 +01:00
Badlop 779c98e314 Add link to ejabberd page at xmpp.org, which displays protocols from DOAP 2022-11-07 18:56:51 +01:00
Badlop 8de270cdaf Run "make doap" 2022-11-07 18:56:46 +01:00
Badlop b71a481e63 Add details about XEP implementations to some protocol attributes 2022-11-07 18:56:46 +01:00
Badlop 5a5e5bbdc6 Support extended protocol attribute (#3915) 2022-11-07 18:56:46 +01:00
Badlop 3b3d3eaa04 Run "make doap" to update ejabberd's DOAP file 2022-11-07 11:13:31 +01:00
Daniel Brötzmann 811fea14d8 Fix DOAP file logo namespace 2022-11-07 11:12:10 +01:00
Badlop 9794b4f778 Commit the generated DOAP file 2022-11-04 16:17:40 +01:00
Badlop b73a9234d9 Add some missing RFCs and remove problematic leading 0 in xep versions 2022-11-04 16:17:39 +01:00
Badlop c9b3d32031 Add DOAP script to Makefile 2022-11-04 16:17:37 +01:00
Badlop 4542bcb57f New script to generate DOAP file 2022-11-04 16:17:35 +01:00
Badlop 1072f593f1 Ignore /doc, generated by tools/check_xep_versions.sh 2022-11-04 16:17:33 +01:00
duritong 122af79207 move spool dir to make it fully configurable per ejabberdctl.cfg (#3863)
Container / Container (push) Failing after 3m35s
Installers / Binaries (push) Failing after 1m4s
Runtime / Rebars (19.3, rebar) (push) Failing after 1m10s
Runtime / Rebars (19.3, rebar3) (push) Failing after 2s
Runtime / Rebars (20.3, rebar) (push) Failing after 1m13s
Runtime / Rebars (20.3, rebar3) (push) Failing after 2s
Runtime / Rebars (24.3, rebar) (push) Failing after 1m19s
Runtime / Rebars (24.3, rebar3) (push) Failing after 2s
Runtime / Rebars (25, rebar) (push) Failing after 46s
Runtime / Rebars (25, rebar3) (push) Failing after 3s
Runtime / Mix (1.10.3, 21.3) (push) Failing after 41s
Runtime / Mix (1.10.3, 22.0) (push) Failing after 40s
Runtime / Mix (1.11.4, 21.3) (push) Failing after 41s
Runtime / Mix (1.11.4, 22.0) (push) Failing after 30s
Runtime / Mix (1.12.3, 22.0) (push) Failing after 34s
Runtime / Mix (1.13.0, 22.0) (push) Failing after 25s
Runtime / Mix (1.13.0, 25.0) (push) Failing after 33s
Installers / Release (push) Has been skipped
CI (19.3) / Tests (19.3) (push) Has been cancelled
CI / Tests (20.0) (push) Has been cancelled
CI / Tests (21.3) (push) Has been cancelled
CI / Tests (24.3) (push) Has been cancelled
CI / Tests (25) (push) Has been cancelled
In the packaged rpm the spool dir is set to:
```
: "${SPOOL_DIR:="/opt/ejabberd/database/$ERLANG_NODE"}"
```

However, `$ERLANG_NODE` is effectively set later (now in line 67), which effectively makes spool dir always in `...../ejabberd@localhost`
2022-10-26 14:02:42 +02:00
Badlop 2ef71a6684 Annotate captcha_cmd option, run make options, update man 2022-10-25 12:11:24 +02:00
Paweł Chmielowski bb22f574fe Bump version 2022-10-25 10:35:00 +02:00
Badlop 2e623a7f20 Update German translation (thanks to nautilusx)" 2022-10-24 13:09:23 +02:00
Badlop 8ea7690fc5 Support @VERSION@ and @SEMVER@ in captcha_cmd option 2022-10-24 12:35:30 +02:00
Paweł Chmielowski a80717ed0e Update changelog 2022-10-18 18:59:28 +02:00
Holger Weiß 13d4787ea9 Bump default 's2s_timeout' value (#3653)
Wait for an hour before closing an idle s2s connection.

It's not uncommon for a connection to be idle for longer than ten
minutes but less than an hour.  For example, XEP-0410 suggests a ping
interval of fifteen minutes.  A longer idle timeout avoids the latency
and log entries associated with constantly re-establishing such
connections.

Co-authored-by: Paweł Chmielowski <pawel@process-one.net>
2022-10-18 16:08:16 +02:00
Frank 28b3134098 fix table creation on a running cluster (#3913) 2022-10-18 15:38:55 +02:00
Badlop d2f79e268e Update Portuguese (Brazil) translation (thanks to Wellington Terumi Uemura) 2022-10-12 17:09:49 +02:00
Badlop b529f72d8f Update Chinese (Simplified) translation (thanks to Eric) 2022-10-12 14:11:39 +02:00
Paweł Chmielowski c4d834b879 Update deps 2022-10-12 12:44:36 +02:00
Badlop 67094ca065 Update Catalan and Spanish translations 2022-10-12 12:06:30 +02:00
Badlop d29fdc4d2e Remove unnecessary text string 2022-10-12 12:06:28 +02:00
Badlop 7be52065dd Update Chinese (Simplified) translation (thanks to Eric) 2022-10-12 12:06:26 +02:00
Badlop 582a245cc7 Update Ukrainian translation (thanks to Artem) 2022-10-12 12:06:24 +02:00
Badlop 4e4c696730 Update Russian translation (thanks to AHOHNMYC) 2022-10-12 12:06:22 +02:00
Badlop 1942f1b370 Update Portuguese (Brazil) translation (thanks to Wellington Terumi Uemura) 2022-10-12 12:06:21 +02:00
Badlop b14b84744a Update French translation (thanks to Maxime Leroy) 2022-10-12 12:06:20 +02:00
Badlop d34274549c Update Spanish translation (thanks to Eduardo Malaspina) 2022-10-12 12:06:18 +02:00
Badlop 28fb992947 Update German translation (thanks to nautilusx) 2022-10-12 12:06:16 +02:00
Badlop 83150e0b76 Update Catalan translation (thanks to Maite Guix) 2022-10-12 12:06:15 +02:00
Badlop 1e24ad817c Update man page 2022-10-12 12:06:13 +02:00
Badlop 77f9254f45 Handle case that module exports mod_doc, but nothing in it 2022-10-12 12:06:11 +02:00
Badlop 77dacf92d2 Annotate new options 2022-10-12 12:06:09 +02:00
Paweł Chmielowski c99ff6059f Fix cache invalidation in shared roster
Doing srg_get_info for not existing group, then srg_create, will make
srg_add_user fail because it will get info that group doesn't exist from
cache.
2022-09-28 18:28:24 +02:00
Holger Weiss e4c20aa674 make-binaries: Bump Expat and libpng versions 2022-09-23 13:46:19 +02:00
Holger Weiss 403dc41b5f make-binaries: Fix GitHub release version checks
Adapt to changes to GitHub release pages.
2022-09-23 13:45:09 +02:00
Paweł Chmielowski 4a22604701 Export mod_muc_admin:get_room_pid/2 2022-09-22 11:11:02 +02:00
Paweł Chmielowski 09b33e17a6 Update mysql 2022-09-22 11:09:12 +02:00
Badlop 796f567db1 The archive_msg export fun requires MUC Service for room archives 2022-09-16 16:35:00 +02:00
Badlop 2229e4c6db Allow MUC service admins to bypass max_user_conferences limitation 2022-09-16 16:34:58 +02:00
Badlop fac74f623e Remove unused macro definitions detected by rebar3_hank
?OFFLINE_TABLE_LOCK_THRESHOLD is unused:
  definition and usage added in 4103f30812
  definition copied, and usage moved to mod_offline_mnesia, in 901d2e0aed
  definition and usage removed in mod_offline_mnesia in d88e4d495f
  this definition looks useless
?VERSION_MULTICAST is unused:
  added in 0cf8d1fa6e
  it was never used
?DISCO_QUERY_TIMEOUT is unused:
  added in 0cf8d1fa6e
  it was never used
?FEATURE/1 is unused:
  added in 0cf8d1fa6e
  usage removed in bc33a3873d
?DEFAULT_MAX_USERS_PRESENCE is unused:
  added in f817762cc4
  usage removed in ba2b650464
?CT_XML is unused:
  added in 46568fb959
  removed in 3dc55c6d47
2022-09-16 16:34:56 +02:00
Badlop cde8c8ce7d Remove unused header files which content is already in xmpp library 2022-09-16 16:34:53 +02:00
Holger Weiss 9e9904c79d Merge remote-tracking branch 'processone/pr/3905'
* processone/pr/3905:
  Adapt to change of mix_annotate type to boolean in roster_query
  Adapt to renaming of 'participant-id' from mix_roster_channel record
  Update xmpp module
2022-09-16 12:39:13 +02:00
Linus Jahn 14882342be Adapt to change of mix_annotate type to boolean in roster_query 2022-09-16 12:29:51 +02:00
Linus Jahn eeed1ca87f Adapt to renaming of 'participant-id' from mix_roster_channel record 2022-09-16 12:29:50 +02:00
Linus Jahn e22d496610 Update xmpp module 2022-09-16 12:29:29 +02:00
Badlop 5ee1dc9e8d Container: Support ERL_DIST_PORT 2022-09-13 17:55:17 +02:00
Badlop 30f1e28468 Support ERL_DIST_PORT option to work without epmd
Please note:
- Erlang/OTP 23.1 or higher is required to use ERL_DIST_PORT
- "make relive" doesn't support ERL_DIST_PORT, neither rebar3 nor elixir
- "make install" doesn't work with Elixir since at least ejabberd 21.07

Reference:
https://www.erlang.org/blog/otp-23-highlights/
https://blog.erlware.org/epmdlessless/
2022-09-13 17:55:15 +02:00
Badlop 4664358176 Ignore .ejabberd-modules/ , may be used when building container 2022-09-13 17:55:14 +02:00
Badlop a564707da4 Container: Get ejabberd-contrib sources to include them 2022-09-13 17:55:12 +02:00
Badlop d0bc83147a Container: Copy .ejabberd-modules directory if available 2022-09-13 17:55:11 +02:00
Badlop a8121cd7e5 Don't persist 'none' role (thanks to Blake Miller)(#3330) 2022-09-13 17:55:09 +02:00
Badlop 4d3875f4ff Store role, and use it when joining a moderated room (#3330) 2022-09-13 17:55:03 +02:00
Holger Weiss add55e1947 make-binaries: Bump Erlang/OTP version to 24.3.4.5 2022-09-13 14:25:13 +02:00
Holger Weiss 95ce3888f6 Merge remote-tracking branch 'processone/pr/3904'
* processone/pr/3904:
  make-binaries: Bump dependency versions
2022-09-13 11:53:04 +02:00
Stu Tomlinson 5bb4731bc1 make-binaries: Bump dependency versions 2022-09-13 08:37:46 +01:00
Holger Weiss b017207ac1 mod_admin_extra: Handle empty roster group names
Don't let 'add_rosteritem' create a roster group with an empty name.

Thanks to Licaon_Kter for reporting the issue.
2022-09-09 18:27:49 +02:00
Badlop 3312eaa51d Add more examples of podman usage 2022-09-07 14:00:42 +02:00
Badlop fe2fd776ef Update CONTAINER example calls to recent changes 2022-09-07 13:59:31 +02:00
Badlop c496baaf87 Container: Don't complain if the bin/ directory already exists 2022-09-07 13:59:20 +02:00
Badlop 14cced0bad Container: No need to search for the ejabberdctl binary 2022-09-07 13:58:56 +02:00
Badlop 17a5835143 Simplify recent commit (thanks to Simon Lipp)(#3894) 2022-09-07 13:57:12 +02:00
Roman Hargrave f542a82309 feat: do not clone repo inside container build 2022-09-07 10:57:55 +02:00
Badlop 42e384beb7 Fix unix socket support for ejabberd_http (thanks to Simon Lipp)(#3894) 2022-09-06 13:34:01 +02:00
Badlop 9a3ba9d76f Update Github Action workflows: Ubuntu 18 is deprecated and 22 is added
CI:
- Update Ubuntu to 20.04, the lowest available starting in April 2023 [1]
- Don't test 19.3, as it isn't available in Ubuntu 20.04
- Use OTP 25 for Shellcheck, Coveralls, ECIL page
- Use erlef instead of ErlGang, supports better old erlangs in new ubuntus
- Remove support for rebar2 testing, as that's done in Runtime

CI-19.3:
- Add a temporary workflow for testing ejabberd with OTP 19.3

Container and Runtime:
- Update Ubuntu to latest (22.04)

[1] https://github.com/actions/runner-images/issues/6002
https://github.com/ErlGang/setup-erlang
https://github.com/erlef/setup-beam
2022-09-06 13:33:58 +02:00
Paweł Chmielowski f624b14636 Add function for getting room diagnostics 2022-09-01 13:37:48 +02:00
Badlop aaf391b284 Catch all errors from jose_jwt:verify and log debugging details (#3890) 2022-09-01 13:02:56 +02:00
Badlop 808def7d32 The #roster_item.ask allowed values are subscribe|undefined 2022-09-01 13:02:54 +02:00
Badlop 4ae06f039d Add definition to detect OTP older than 25, used by ejabberd_auth_http 2022-09-01 13:02:52 +02:00
Badlop 7a1ca4b203 mod_host_meta: Complain at start if listener is not encrypted 2022-09-01 13:02:49 +02:00
Holger Weiss 63caa369be mod_pubsub: Don't crash on command failures
Handle 'delete_old_items' and 'delete_expired_items' errors gracefully.
2022-08-31 18:10:22 +02:00
Paweł Chmielowski fba651822d Handle invalid values in X-Forwarded-For header more gracefuly 2022-08-29 11:26:31 +02:00
Paweł Chmielowski cfc8746d29 Update roster_get hook in mod_shared_roster_ldap to use #roster_item{} 2022-08-24 11:14:32 +02:00
Paweł Chmielowski a9e85674b8 Fix mucsub unsubscribe notification payload to have muc_unsubcribe in it
...instead of muc_subscribe
2022-08-24 10:30:02 +02:00
Holger Weiss bce429dc44 make-packages: Fix permissions on RPM systems
RPM resets ownership/permissions of /opt/ejabberd and its subdirectories
on installation.  Therefore, fix those in the "after-install" script.
2022-08-21 15:48:28 +02:00
Jonah Brüchert 9a8a843724 Fix filter_nodes
The previous implementation always returned an empty list while testing
it. However I don't really understand why that happened. The list
comprehension based one works, although it looks equivalent to me.
2022-08-17 16:37:20 +02:00
Jonah Brüchert 0faf34b26d Parse sub elements of the mix join remote result 2022-08-17 16:37:20 +02:00
Jonah Brüchert b1e6e408f8 mod_mix: Return user jid on join 2022-08-17 16:37:20 +02:00
Linus Jahn 4a52b73a17 mod_shared_roster: Fix wrong hook type #roster{} (now #roster_item{})
The hook type was changed from #roster{} to #roster_item{} by me in the
recent MIX changes. Unfortunately I've overseen this one (and unit tests
+ dialyzer passed).
2022-08-12 17:07:28 +02:00
Linus Jahn b0526cd903 mod_mix, mod_mix_pam: Add new MIX namespaces to disco features 2022-08-12 10:53:53 +02:00
Jonah Brüchert 648245e974 mod_mix, mod_mix_pam: Add handling of IQs with newer MIX namespaces
Supported are mix:core:{0,1} and mix:pam:{0,2}
2022-08-12 10:53:53 +02:00
Linus Jahn d6b72f1c5d mod_roster: Change hook type from #roster{} to #roster_item{}
The problem with #roster{} is that every new record entry is also stored
in the mnesia roster table.  Adding the mix_participant_id there makes
no sense because the normal roster items are no MIX channels.  Using
\#roster_item{} for the hook and #roster{} for storing the normal items
seems to be a better idea.
2022-08-11 12:45:20 +02:00
Linus Jahn d450d40178 mod_roster: Respect MIX <annotate/> setting
MIX extensions are not sent to clients if they haven't been enabled by
the client with <annotate/> in the roster get request.
2022-08-11 12:45:20 +02:00
Linus Jahn 3bf0892c74 mod_mix_pam: Do roster pushes on join/leave
Before the channels were added/removed from the database but the
clients were not notified of it.
2022-08-11 12:45:20 +02:00
Linus Jahn 7564a4e953 mod_mix_pam: Provide MIX channels as roster entries via hook 2022-08-11 12:45:20 +02:00
Holger Weiss e858738736 ejabberd_listener: Let module take over socket
For some use cases, it may be necessary to allow a module to take over
socket ownership during initialization.
2022-08-10 18:28:35 +02:00
Badlop c2cd592eff Update documentation to reflect the GHCR image usage 2022-08-08 12:31:18 +02:00
Badlop f080aa5fd9 Apply the minimal changes required to use the GHCR image 2022-08-08 12:31:16 +02:00
Badlop 682c258760 Copy ejabberd-docker-install.bat from docker-ejabberd git and rename it 2022-08-08 12:31:14 +02:00
Badlop 7d8fa3c880 ext_mod: Support managing remote nodes in the cluster 2022-08-05 16:15:05 +02:00
Badlop 72944d895b ext_mod: Handle correctly when COMMIT.json not found 2022-08-05 16:15:03 +02:00
Badlop 00e6b0c97c Show allow_query_users room option in disco info (#3830) 2022-08-04 12:28:15 +02:00
Badlop a798a21386 CI: Remove syntax_tools from applications, as fast_xml fails Dialyzer 2022-08-04 12:05:46 +02:00
Mark Zealey 555ff2db4c Add log_burst_limit_* options (#3865)
* Add log_burst_limit_* options

On our ejabberd deployment we were sometimes seeing more than 500
msgs/sec of legitimate traffic, however this was getting silently
dropped. Provide config options to enable this limit to be configured
from the config file.

* Pass new logging vars in via ejabberdctl
2022-08-01 12:07:54 +02:00
Paweł Chmielowski 9b647a7afe Skip connection exit message when we triggered reconnection 2022-07-28 19:25:17 +02:00
Paweł Chmielowski 2b3644c8ac Handle errors reported from begin/commit inside transaction 2022-07-28 19:24:28 +02:00
Paweł Chmielowski 3d329c7e8f Make connection close errors bubble up from inside sql transaction 2022-07-28 13:17:35 +02:00
Badlop 1ea53bf940 Add syntax_tools to applications, required when using ejabberd_sql_pt (#3869) 2022-07-27 15:16:52 +02:00
Badlop bc8050eb03 Don't bother with COMMIT.json user-friendly feature in automated user case 2022-07-27 15:16:51 +02:00
Badlop a38ed7fb2c Handle not found COMMIT.json, for example in GH Actions 2022-07-27 15:16:49 +02:00
Badlop 033656d70e Add WebAdmin page for managing external modules 2022-07-26 15:42:13 +02:00
Badlop 853f35c706 Remove nginx and libgd3, so the proper versions can be installed 2022-07-26 15:42:13 +02:00
Paweł Chmielowski 7b944444ce Catch mysql connection being close earlier 2022-07-19 14:35:35 +02:00
Paweł Chmielowski 73167ef1bd Make first sql reconnect wait shorter time 2022-07-19 14:32:47 +02:00
Paweł Chmielowski 43f36205bd React to sql driver process exit earlier
If there are queued request when connection closes we may try to process
those requests (by trying to send them to already terminated db process,
and waiting until we hit timeout) before we see that driver is not longer
alive. This change adds check for driver exit before we process next
queued sql request, and immediately switch to connection state if we have
one.
2022-07-15 13:51:30 +02:00
Alexey Shchepin 99d9e315a3 Don't set affiliation to 'none' if it's already 'none' in mod_muc_room:process_item_change/3 2022-07-01 09:39:37 +03:00
Linus Jahn e10c67a74a mod_mix_pam: Display joined channels on webadmin page 2022-06-28 22:15:04 +02:00
Paweł Chmielowski 991d52f019 Fix error reporting in 'make options' on OTP24+ 2022-06-24 11:36:54 +02:00
Paweł Chmielowski 06147deccd Don't register listeners that failed to start in config reload
This should alleviate some issues in #3850
2022-06-21 11:09:37 +02:00
Paweł Chmielowski 46c947bc76 Define batch delete function types in coresponding behaviours 2022-06-17 10:35:02 +02:00
Paweł Chmielowski a2efde185a Fix mam delete_old_messages_batch for sql backend
Too much copy/paste from spool equivalent...
2022-06-17 10:22:57 +02:00
Badlop 382c3836af Runtime: Add Xref options to be as strict as CI 2022-06-12 13:08:29 +02:00
Badlop 6d39af7dd6 Runtime: No need for a specific mix erlang 25 job 2022-06-12 13:08:27 +02:00
Badlop a30d8c718f Update workflows to Erlang 25 2022-06-12 13:08:24 +02:00
Paweł Chmielowski a89b1f332d Use INSERT ... ON DUPLICATE KEY UPDATE for upsert on mysql
This can be used for all upsert expressions (where REPLACE INTO used
previously were only possible to use for subset of queries), and may
potentially help with deadlocks reported by mysql when we issues multiple
querier for same key in quick succession.
2022-06-10 16:25:50 +02:00
Badlop a6101cc26d Container: Set a less frequent healthcheck to reduce CPU usage (#3826) 2022-06-09 12:34:44 +02:00
Badlop 06a2b1c671 Container: Support to pass a fork repository as argument 2022-06-09 11:57:49 +02:00
Badlop 8d94ae4cb0 Container: Fix build instructions 2022-06-09 11:41:34 +02:00
Holger Weiss fbf43f2a31 make-binaries: Include CAPTCHA script with release 2022-05-28 15:00:25 +02:00
Holger Weiss b4c78336a6 make-binaries: Edit rebar.config more carefully
Don't break the (currently nonexistent) case where a dependency's
rebar.config file specifies LDFLAGS before and after "-lstdc++", such as
"-lfoo -lstdc++ -lbar".
2022-05-28 10:21:43 +02:00
Holger Weiss c1ee86e85c make-binaries: Fix linking of EIMP dependencies
Avoid linker errors such as the following when using GCC 10 or newer:

| multiple definition of `gdImageCreateFromJpegPtr'

See: https://gcc.gnu.org/gcc-10/porting_to.html

Fixes #3514.
2022-05-25 20:37:37 +02:00
Badlop 5a2e58e066 Fix regression on stop_ping in clustering context (thanks to fdie)(#3817) 2022-05-23 16:52:27 +02:00
Badlop 0e25f8d43e Fix mod_conversejs crash when mod_register not enabled (#3824) 2022-05-23 16:49:35 +02:00
Badlop 75ffce0417 configure also when running "make update", which is similar to "make deps" 2022-05-23 16:49:19 +02:00
Badlop 34e1ddb66f Update "make help" with recent changes 2022-05-23 13:58:50 +02:00
Badlop 26e6bb4a17 Use "make deps", which performs additional steps (#3823) 2022-05-23 13:58:41 +02:00
Badlop 7850ce0ec8 Ensure deps configuration is ran when getting deps (#3823) 2022-05-23 13:58:33 +02:00
Badlop 7d16907296 Configure eimp with mix to detect image convert properly (#3823) 2022-05-23 13:58:08 +02:00
Badlop ddc457060b Improve "make clean" and "distclean" 2022-05-23 13:57:17 +02:00
Badlop 93f994d50a Generate start scripts in "make all", not in "make install" (#3821) 2022-05-23 13:57:06 +02:00
Paweł Chmielowski 75a771bfec Don't leak DESTDIR in files copied by 'make install'
This fixes issue #3819
2022-05-19 12:20:58 +02:00
Holger Weiss e6c1bf9c9a make-binaries: Adjust Mnesia spool directory path
Adjust the default Mnesia directory for compatibility with older binary
packages.

Closes #3818.
2022-05-18 17:08:05 +02:00
Holger Weiss cac31f9325 make-packages: Include systemd unit with RPM
Don't forget to include the /etc/systemd/system/ejabberd.service unit
with the RPM package.

Closes #3816.
2022-05-18 10:20:34 +02:00
Paweł Chmielowski 99064548e8 Fix parsing of scram password from prosody
Looks like parsed integer no longer are convered to floats on erlang side,
so let's make check for them less restrictive.
2022-05-17 13:21:30 +02:00
Holger Weiss 553a1ccadf Merge remote-tracking branch 'processone/pr/3813'
* processone/pr/3813:
  make-installers: Support non-root installation
  make-installers: Override code on upgrade
  make-installers: Apply cosmetic changes
2022-05-17 12:44:34 +02:00
Holger Weiss 621445e096 make-installers: Support non-root installation
If the installer is invoked without superuser privileges, warn the user,
ask for the installation prefix, and perform a local installation on
confirmation.
2022-05-17 12:40:12 +02:00
Licaon_Kter 432e97296c Fix typos in changelog 2022-05-17 11:45:57 +02:00
Badlop 4f8e6fe844 Fix errors and warnings for "rebar3 edoc" 2022-05-17 10:42:02 +02:00
Badlop 01b791c0fa Define license for hex.pm using SPDX identifier
Until now, when publishing package to hex.pm, it complained:
> The following licenses are not recognized by SPDX:
>  * GPLv2
> Consider using licenses from https://spdx.org/licenses
2022-05-17 10:42:00 +02:00
Badlop dde096515d Update mix.lock with ex_doc 2022-05-17 10:41:59 +02:00
Badlop 78e97f3605 ex_doc is required to publish docs to hex.pm
Revert "Let's assume ex_doc is no longer needed"
This reverts commit 2f92dc40df.
2022-05-17 10:41:57 +02:00
Badlop 6c9f97d7cc Update README.md, the installers are now in GitHub Releases 2022-05-17 10:41:56 +02:00
Badlop 861347e911 CHANGELOG: Update to 22.05 version 2022-05-17 10:41:53 +02:00
Holger Weiss c54fe5b29e make-installers: Override code on upgrade
Use tar's --skip-old-files option for the data directory (/opt/ejabberd)
only.  Files in the code directory (/opt/ejabberd-$version) should be
overridden on upgrade.
2022-05-16 00:45:01 +02:00
Holger Weiss 6d93d49c6c make-installers: Apply cosmetic changes 2022-05-16 00:13:43 +02:00
Holger Weiss 8addf96f9e make-binaries: Bump dependency versions 2022-05-12 01:02:33 +02:00
Paweł Chmielowski a916d94000 Pass room state to muc_{un}subscribed hook 2022-05-09 17:32:34 +02:00
Paweł Chmielowski ed7fc956d5 Allow muc_{un}subscribe hooks to modify sent packets 2022-05-09 16:34:27 +02:00
Badlop 024ad02169 Revert "Temporary workaround to provide a 22.05 tagged container"
This reverts commit 3449621ccc.
2022-05-06 17:58:58 +02:00
Badlop 3449621ccc Temporary workaround to provide a 22.05 tagged container 2022-05-06 17:30:26 +02:00
Badlop e5782a519a Use alternate method to get priv/ path when copying captcha scripts 2022-05-06 17:30:24 +02:00
Badlop fbeaa2e03a Remove dependabot because it gets fired in forks too 2022-05-06 17:30:21 +02:00
530 changed files with 54646 additions and 13559 deletions
+1 -4
View File
@@ -1,4 +1 @@
# Update the VARIANT arg to pick an Elixir version: latest, 1.11.4, etc.
ARG VARIANT=latest
FROM ghcr.io/processone/elixir:${VARIANT}
FROM ghcr.io/processone/devcontainer:latest
+4 -45
View File
@@ -1,48 +1,7 @@
{
"name": "ejabberd",
// "dockerComposeFile": "docker-compose.yml",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "latest" // 1.11.4
}
},
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "/bin/zsh",
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["pgourlain.erlang", "jakebecker.elixir-ls"],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5222, 5280, 5269],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sh .devcontainer/post-create.sh",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"portsAttributes": {
"1883": {
"label": "MQTT"
},
"5222": {
"label": "XMPP C2S"
},
"5223": {
"label": "Legacy XMPP C2S"
},
"5269": {
"label": "XMPP S2S"
},
"5280": {
"label": "ejabberd HTTP"
},
"5443": {
"label": "ejabberd HTTPS"
}
}
"build": {"dockerfile": "Dockerfile"},
"extensions": ["erlang-ls.erlang-ls"],
"postCreateCommand": ".devcontainer/prepare-container.sh",
"remoteUser": "vscode"
}
-8
View File
@@ -1,8 +0,0 @@
ejabberd:
image: ejabberd/ecs
ports:
- 5222:5222
- 5223:5223
- 5269:5269
- 5280:5280
- 1883:1883
+3
View File
@@ -0,0 +1,3 @@
echo "export PATH=/workspaces/ejabberd/_build/relive:$PATH" >>$HOME/.bashrc
echo "COOKIE" >$HOME/.erlang.cookie
chmod 400 $HOME/.erlang.cookie
+43
View File
@@ -1,3 +1,46 @@
.git
.win32
.examples
*.swp
*~
\#*#
.#*
.edts
*.dump
/Makefile
/config.log
/config.status
/config/releases.exs
/configure
/aclocal.m4
/*.cache
/deps/
/.deps-update/
/ebin/
/ejabberd.init
/ejabberd.service
/ejabberdctl
/ejabberdctl.example
/rel/ejabberd/
/rel/overlays/
/src/eldap_filter_yecc.erl
/vars.config
/dialyzer/
/test/*.beam
/test/*.ctc
/logs/
/priv/bin/captcha*sh
/priv/sql
/rel/ejabberd
/_build
/database/
/.rebar
/rebar.lock
/log/
Mnesia.nonode@nohost/
# Binaries created with tools/make-{binaries,installers,packages}:
/ejabberd_*.deb
/ejabberd-*.rpm
/ejabberd-*.run
/ejabberd-*.tar.gz
/.github/container/Dockerfile
+1 -2
View File
@@ -6,8 +6,7 @@ assignees: ''
---
Before creating a ticket, please consider if this should fit the discussion forum better:
https://github.com/processone/ejabberd/discussions
Before creating a ticket, please consider if this should fit the [discussion forum](https://github.com/processone/ejabberd/discussions) better.
## Environment
+6 -3
View File
@@ -7,17 +7,20 @@ assignees: ''
---
Before creating a ticket, please consider if this should fit the discussion forum better:
https://github.com/processone/ejabberd/discussions
Before creating a ticket, please consider if this should fit the [discussion forum](https://github.com/processone/ejabberd/discussions) better.
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Ex. I'm always frustrated when...
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+155
View File
@@ -0,0 +1,155 @@
name: 'Manage Database'
inputs:
for:
default: ""
description: 'One or more databases to manage:
mysql, pgsql, redis, mssql'
do:
default: ""
description: 'One or more tasks to do:
install, start, user, create, drop, dump'
dump-suffix:
default: ""
description: 'Suffix to append to the dump file name'
mssql-schema:
default: ""
description: 'SQL schema for the MSSQL database:
singlehost or multihost'
runs:
using: "composite"
steps:
############################################################# Install #####
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'install')
shell: sh
run: |
sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf
sudo rm -f /var/lib/man-db/auto-update || echo ok
sudo apt-get -q update
sudo apt-get -q -y install postgresql
- if: contains(inputs.for, 'redis') && contains(inputs.do, 'install')
shell: sh
run: |
sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf
sudo rm -f /var/lib/man-db/auto-update || echo ok
sudo apt-get -q update
sudo apt-get -q -y install redis-server
- if: contains(inputs.for, 'mssql') && contains(inputs.do, 'install')
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: tdsodbc
- if: contains(inputs.for, 'mssql') && contains(inputs.do, 'install')
shell: sh
run: |
docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=ejabberd_Test1" \
-v $(pwd)/test/docker/db/mssql/initdb/initdb_mssql.sql:/initdb_mssql.sql:ro \
-v $(pwd)/sql/mssql.sql:/mssql.sql:ro \
-v $(pwd)/sql/mssql.new.sql:/mssql.new.sql:ro \
-p 1433:1433 --name ejabberd-mssql \
"mcr.microsoft.com/mssql/server:2019-latest"
sleep 10
docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd \
-C -U SA -P ejabberd_Test1 -S localhost -i /initdb_mssql.sql
- if: contains(inputs.for, 'mssql') && contains(inputs.do, 'install')
&& inputs.mssql-schema == 'singlehost'
shell: sh
run: |
docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd \
-C -U SA -P ejabberd_Test1 -S localhost -d ejabberd_test \
-i /mssql.sql
- if: contains(inputs.for, 'mssql') && contains(inputs.do, 'install')
&& inputs.mssql-schema == 'multihost'
shell: sh
run: |
docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd \
-C -U SA -P ejabberd_Test1 -S localhost -d ejabberd_test \
-i /mssql.new.sql
############################################################### Start #####
- if: contains(inputs.for, 'mysql') && contains(inputs.do, 'start')
shell: sh
run: |
sudo systemctl start mysql.service
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'start')
shell: sh
run: |
sudo systemctl start postgresql.service
pg_isready
################################################################ User #####
- if: contains(inputs.for, 'mysql') && contains(inputs.do, 'user')
shell: sh
run: |
mysql -u root -proot -e "CREATE USER 'ejabberd_test'@'localhost'
IDENTIFIED BY 'ejabberd_test';"
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'user')
shell: sh
run: |
sudo -u postgres psql -c "CREATE USER ejabberd_test
WITH PASSWORD 'ejabberd_test';"
################################################################ Dump #####
- if: contains(inputs.for, 'mysql') && contains(inputs.do, 'dump')
shell: sh
run: |
sudo mysqldump -u root -proot ejabberd_test \
> mysql-${{ inputs.dump-suffix }}.sql
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'dump')
shell: sh
run: |
sudo -u postgres pg_dump ejabberd_test \
> pgsql-${{ inputs.dump-suffix }}.sql
################################################################ Drop #####
- if: contains(inputs.for, 'mysql') && contains(inputs.do, 'drop')
shell: sh
run: |
mysql -u root -proot -e "DROP DATABASE ejabberd_test;"
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'drop')
shell: sh
run: |
sudo -u postgres psql -c "DROP DATABASE ejabberd_test;"
############################################################## Create #####
- if: contains(inputs.for, 'mysql') && contains(inputs.do, 'create')
shell: sh
run: |
mysql -u root -proot -e "CREATE DATABASE ejabberd_test;"
mysql -u root -proot -e "GRANT ALL ON ejabberd_test.*
TO 'ejabberd_test'@'localhost';"
- if: contains(inputs.for, 'pgsql') && contains(inputs.do, 'create')
shell: sh
run: |
sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES
ON DATABASE ejabberd_test TO ejabberd_test;"
sudo -u postgres psql -c "GRANT ALL ON SCHEMA public TO ejabberd_test;"
sudo -u postgres psql -c "ALTER DATABASE ejabberd_test
OWNER TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
TABLES IN SCHEMA public
TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
SEQUENCES IN SCHEMA public
TO ejabberd_test;"
+195
View File
@@ -0,0 +1,195 @@
name: 'Manage ejabberd'
inputs:
for:
default: ""
description: 'Release method, one of:
prod, dev, install, run, deb'
do:
default: ""
description: 'One or more tasks to perform:
deploy, no_acme, no_tls,
start, register, update_sql, stop,
check, logs'
username:
default: "user1"
description: 'Username part of the account JID'
host:
default: "localhost"
description: 'Host part of the account JID'
tool:
default: "rebar3"
description: 'Build tool to use:
rebar or rebar3 (only relevant to make rebar2)'
rel_name_vsn:
default: ""
description: 'Base name of installer files'
configure:
default: ""
description: 'Options to append to ./configure'
runs:
using: "composite"
steps:
- name: Path Definitions
id: path
shell: bash
run: |
case ${{ inputs.for }} in
'prod')
BASE="_build/prod/rel/ejabberd"
echo "conf=$BASE/conf" >> $GITHUB_OUTPUT
echo "logs=$BASE/logs" >> $GITHUB_OUTPUT
echo "ectl=$BASE/bin/ejabberdctl" >> $GITHUB_OUTPUT
;;
'dev')
BASE="_build/dev/rel/ejabberd"
echo "conf=$BASE/conf" >> $GITHUB_OUTPUT
echo "logs=$BASE/logs" >> $GITHUB_OUTPUT
echo "ectl=$BASE/bin/ejabberdctl" >> $GITHUB_OUTPUT
;;
'install')
BASE="/tmp/ejabberd"
echo "conf=$BASE/etc/ejabberd" >> $GITHUB_OUTPUT
echo "logs=$BASE/var/log/ejabberd" >> $GITHUB_OUTPUT
echo "ectl=$BASE/sbin/ejabberdctl" >> $GITHUB_OUTPUT
;;
'deb')
BASE="/opt/ejabberd"
echo "base=$BASE" >> $GITHUB_OUTPUT
echo "conf=$BASE/conf" >> $GITHUB_OUTPUT
echo "logs=$BASE/logs" >> $GITHUB_OUTPUT
echo "ectl=sudo /opt/${{ inputs.rel_name_vsn }}/bin/ejabberdctl" >> $GITHUB_OUTPUT
;;
'run')
BASE="$HOME/opt/ejabberd"
echo "base=$BASE" >> $GITHUB_OUTPUT
echo "conf=$BASE/conf" >> $GITHUB_OUTPUT
echo "logs=$BASE/logs" >> $GITHUB_OUTPUT
echo "ectl=$HOME/opt/${{ inputs.rel_name_vsn }}/bin/ejabberdctl" >> $GITHUB_OUTPUT
;;
esac
############################################################# Compile #####
- if: contains(inputs.do, 'compile')
shell: sh
run: |
TOOL=${{ inputs.tool }}
[ "${TOOL%3}" = "rebar" ] && TOOL="./$TOOL"
./autogen.sh
./configure --with-rebar=$TOOL \
--prefix=/tmp/ejabberd \
--enable-all ${{ inputs.configure }}
sed -i 's|, syntax_tools||g' src/ejabberd.app.src.script
REBAR_PROFILE=test make
############################################################## Deploy #####
- if: contains(inputs.do, 'deploy') &&
inputs.for == 'prod' && inputs.tool == 'rebar'
shell: sh
run: |
mkdir -p _build/prod && ln -s `pwd`/rel/ _build/prod/rel
- if: contains(inputs.do, 'deploy') &&
inputs.for == 'dev' && inputs.tool == 'rebar'
shell: sh
run: |
mkdir -p _build/dev && ln -s `pwd`/rel/ _build/dev/rel
- if: contains(inputs.do, 'deploy') &&
(inputs.for == 'prod' ||
inputs.for == 'dev' ||
inputs.for == 'install')
shell: sh
run: |
make ${{ inputs.for }}
- if: contains(inputs.do, 'deploy') &&
inputs.for == 'deb'
shell: sh
run: |
sudo dpkg -i $(ls -1 *.deb)
- if: contains(inputs.do, 'deploy') &&
inputs.for == 'run'
shell: sh
run: |
./$(ls -1 *.run)
################################################################ ACME #####
- if: contains(inputs.do, 'no_acme')
shell: sh
run: |
sed -i 's/loglevel/acme:\n auto: false\nloglevel/g' \
${{ steps.path.outputs.conf }}/ejabberd.yml
################################################################# TLS #####
- if: contains(inputs.do, 'no_tls') &&
inputs.for == 'dev'
shell: sh
run: |
sed -i 's/starttls_required: true/starttls_required: false/g' \
${{ steps.path.outputs.conf }}/ejabberd.yml
############################################################### Start #####
- if: contains(inputs.do, 'start')
shell: sh
run: |
${{ steps.path.outputs.ectl }} start
${{ steps.path.outputs.ectl }} started
############################################################ Register #####
- if: contains(inputs.do, 'register')
shell: sh
run: |
${{ steps.path.outputs.ectl }} \
register ${{ inputs.username }} ${{ inputs.host }} s0mePass
${{ steps.path.outputs.ectl }} \
registered_users ${{ inputs.host }} >> registered.log
grep -q '${{ inputs.username }}' registered.log
########################################################### UpdateSQL #####
- if: contains(inputs.do, 'update_sql')
shell: sh
run: |
${{ steps.path.outputs.ectl }} \
update_sql
################################################################ Stop #####
- if: contains(inputs.do, 'stop')
shell: sh
run: |
${{ steps.path.outputs.ectl }} stop
${{ steps.path.outputs.ectl }} stopped
############################################################### Check #####
- if: contains(inputs.do, 'check')
shell: sh
run: |
grep -q 'is started' ${{ steps.path.outputs.logs }}/ejabberd.log
grep -q 'is stopped' ${{ steps.path.outputs.logs }}/ejabberd.log
test $(find ${{ steps.path.outputs.logs }}/ -empty -name error.log)
################################################################ Logs #####
- if: contains(inputs.do, 'logs') || failure()
shell: sh
run: |
SUDO=sudo
[ "${{ inputs.for }}" = "deb" ] || SUDO=""
echo "::group::View ejabberd.log"
$SUDO cat ${{ steps.path.outputs.logs }}/ejabberd.log
echo "::endgroup::"
echo "::group::View error.log"
$SUDO cat ${{ steps.path.outputs.logs }}/error.log
echo "::endgroup::"
+179 -88
View File
@@ -1,54 +1,101 @@
FROM alpine:3.15.4 AS build
ARG VERSION=master
#' Define default build variables
ARG OTP_VSN='28.4.1.0'
ARG ELIXIR_VSN='1.19.5'
ARG UID='9000'
ARG USER='ejabberd'
ARG HOME="opt/$USER"
ARG BUILD_DIR="/$USER"
ARG VERSION='master'
RUN apk upgrade --update musl \
&& apk add \
autoconf \
automake \
bash \
build-base \
curl \
elixir \
erlang-odbc \
erlang-reltool \
expat-dev \
file \
gd-dev \
git \
jpeg-dev \
libpng-dev \
libwebp-dev \
linux-pam-dev \
openssl \
openssl-dev \
sqlite-dev \
yaml-dev \
zlib-dev
################################################################################
#' Compile ejabberdapi
FROM docker.io/golang:1.25-alpine AS api
RUN go install -v \
github.com/processone/ejabberd-api/cmd/ejabberd@master \
&& mv bin/ejabberd bin/ejabberdapi
################################################################################
#' build and install ejabberd directly from source
FROM docker.io/erlang:${OTP_VSN}-alpine AS ejabberd
RUN apk -U add --no-cache \
ca-certificates \
autoconf \
automake \
bash \
build-base \
curl \
expat-dev \
file \
gd-dev \
git \
jpeg-dev \
libpng-dev \
libwebp-dev \
linux-pam-dev \
npm \
openssl-dev \
sqlite-dev \
yaml-dev \
zlib-dev
ARG ELIXIR_VSN
RUN wget -O - https://github.com/elixir-lang/elixir/archive/v$ELIXIR_VSN.tar.gz \
| tar -xzf -
WORKDIR /elixir-$ELIXIR_VSN
ENV ERL_FLAGS="+JPperf true"
RUN make install clean
RUN mix local.hex --force \
&& mix local.rebar --force
WORKDIR ejabberd
ARG BUILD_DIR
COPY / $BUILD_DIR/
RUN git clone https://github.com/processone/ejabberd.git . \
&& git checkout $VERSION \
&& mv .github/container/ejabberdctl.template . \
WORKDIR $BUILD_DIR
RUN mv .github/container/ejabberdctl.template . \
&& mv .github/container/ejabberd.yml.example . \
&& ./autogen.sh \
&& ./configure --with-rebar=mix --enable-all \
&& mix deps.get \
&& make rel
&& make deps \
&& make prod
RUN cp -r _build/prod/rel/ejabberd/ /opt/ejabberd-$VERSION \
&& mkdir -p /opt/ejabberd \
&& mv /opt/ejabberd-$VERSION/conf /opt/ejabberd/conf
WORKDIR /rootfs
ARG VERSION
ARG HOME
RUN mkdir -p $HOME $HOME-$VERSION \
&& cp -r $BUILD_DIR/_build/prod/rel/ejabberd/* $HOME-$VERSION \
&& mv $HOME-$VERSION/conf $HOME/conf
RUN DESCRIBE=$(git describe --tags) \
&& MIXVER=$(echo $DESCRIBE.0 | sed -e 's/-g.*//' -e 's/-/./' | tr -d '[:space:]') \
&& mkdir /opt/ejabberd-$VERSION/lib/ejabberd-$MIXVER/priv/bin \
&& cp tools/captcha*.sh /opt/ejabberd-$VERSION/lib/ejabberd-$MIXVER/priv/bin/
RUN cp -p $BUILD_DIR/tools/captcha*.sh $HOME-$VERSION/lib
RUN export PEM=/opt/ejabberd/conf/server.pem \
&& curl -o "/opt/ejabberd/conf/cacert.pem" 'https://curl.se/ca/cacert.pem' \
RUN find "$HOME-$VERSION/bin" -name 'ejabberd' -delete \
&& find "$HOME-$VERSION/releases" -name 'COOKIE' -delete
RUN wget -O "$HOME/conf/cacert.pem" 'https://curl.se/ca/cacert.pem'
#' Prepare ejabberd for runtime
RUN apk -U add --no-cache \
git \
libcap \
openssl
RUN mkdir -p usr/local/bin $HOME/conf $HOME/database $HOME/logs $HOME/upload
COPY --from=api /go/bin/ejabberdapi usr/local/bin/
RUN if [ ! -d $HOME/.ejabberd-modules ]; \
then \
if [ -d $BUILD_DIR/.ejabberd-modules ]; \
then cp -r $BUILD_DIR/.ejabberd-modules $HOME; \
else git clone https://github.com/processone/ejabberd-contrib --depth 1 \
$HOME/.ejabberd-modules/sources/ejabberd-contrib; \
fi \
fi
RUN export PEM=$HOME/conf/server.pem \
&& openssl req -x509 \
-batch \
-nodes \
@@ -56,62 +103,106 @@ RUN export PEM=/opt/ejabberd/conf/server.pem \
-keyout $PEM \
-out $PEM \
-days 3650 \
-subj "/CN=localhost" \
&& sed -i '/^loglevel:/a \ \
\nca_file: /opt/ejabberd/conf/cacert.pem \
\ncertfiles: \
\n - /opt/ejabberd/conf/server.pem' "/opt/ejabberd/conf/ejabberd.yml"
-subj "/CN=localhost"
FROM alpine:3.15.4
ENV HOME=/opt/ejabberd
RUN sed -i 's|^#CTL_OVER_HTTP=|CTL_OVER_HTTP=../|' "$HOME/conf/ejabberdctl.cfg"
RUN apk upgrade --update musl \
&& apk add \
expat \
freetds \
gd \
jpeg \
libgd \
libpng \
libstdc++ \
libwebp \
linux-pam \
ncurses-libs \
openssl \
sqlite \
sqlite-libs \
unixodbc \
yaml \
zlib \
&& ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so \
&& rm -rf /var/cache/apk/*
RUN home_root_dir=$(echo $HOME | sed 's|\(.*\)/.*|\1 |') \
&& setcap 'cap_net_bind_service=+ep' $(find $home_root_dir -name beam.smp) \
&& echo -e \
"#!/bin/sh \
\n[ -z \$ERLANG_NODE_ARG ] && export ERLANG_NODE_ARG=ejabberd@localhost \
\nexport EMA=\"\$EJABBERD_MACRO_ADMIN\" \
\nexport HOST=\"\${EJABBERD_MACRO_HOST:-localhost}\" \
\nif [ -n \"\$EMA\" ] \
\nthen \
\n if [ \"\$EMA\" != \"\${EMA%%@*}\" ] \
\n then \
\n export USERNAME=\"\${EMA%%@*}\" \
\n export HOST=\"\${EMA##*@}\" \
\n else \
\n export USERNAME=\"\$EMA\" \
\n export SHOW_WARNING=\"true\" \
\n fi \
\nelif [ -n \"\$REGISTER_ADMIN_PASSWORD\" ] \
\nthen \
\n export USERNAME=\"admin\" \
\nelse \
\n export USERNAME=\"\$(od -A n -N 8 -t x8 /dev/urandom)\" \
\nfi \
\nexport EJABBERD_MACRO_ADMIN=\"\$USERNAME@\$HOST\" \
\n[ -n \"\$SHOW_WARNING\" ] && echo \"WARNING: The EJABBERD_MACRO_ADMIN environment variable was set to '\$EMA', but it should include the host... I'll overwrite it to become '\$EJABBERD_MACRO_ADMIN'.\" \
\n[ -n \"\$CTL_ON_CREATE\" ] && export SEPARATOR=\";\" \
\n[ -n \"\$REGISTER_ADMIN_PASSWORD\" ] && export CTL_ON_CREATE=\"register \${EJABBERD_MACRO_ADMIN%%@*} \${EJABBERD_MACRO_ADMIN##*@} \$REGISTER_ADMIN_PASSWORD \$SEPARATOR \$CTL_ON_CREATE\" \
\nexport CONFIG_DIR=/$HOME/conf \
\nexport LOGS_DIR=/$HOME/logs \
\nexport SPOOL_DIR=/$HOME/database \
\nexec /$(find $home_root_dir -name ejabberdctl) \"\$@\"" \
> usr/local/bin/ejabberdctl \
&& chmod +x usr/local/bin/* \
&& scanelf --needed --nobanner --format '%n#p' --recursive $home_root_dir \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e $home_root_dir" $1 " ]") == 0 { next } { print "so:" $1 }' \
| sed -e "s|so:libc.so|so:libc.musl-$(uname -m).so.1|" \
> /tmp/runDeps
COPY --from=build /opt /opt
RUN echo -e \
"#!/bin/sh \
\n[ -z \$ERLANG_NODE_ARG ] && export ERLANG_NODE_ARG=ejabberd@localhost \
\nexport CONFIG_DIR=/opt/ejabberd/conf \
\nexport LOGS_DIR=/opt/ejabberd/logs \
\nexport SPOOL_DIR=/opt/ejabberd/database \
\nexec $(find /opt -name ejabberdctl) \"\$@\"" > /usr/local/bin/ejabberdctl \
&& chmod +x /usr/local/bin/ejabberdctl
ARG UID
RUN chown -R $UID:$UID $HOME
RUN addgroup ejabberd -g 9000 \
&& adduser -s /bin/sh -D -G ejabberd ejabberd -u 9000 \
&& mkdir -p $HOME/conf $HOME/database $HOME/logs $HOME/upload \
&& chown -R ejabberd:ejabberd $HOME
RUN cp /rootfs/$HOME-$VERSION/lib/captcha*.sh usr/local/bin/
RUN mkdir $HOME/sql \
&& find /rootfs/$HOME-$VERSION/lib/ -name *.sql -exec cp {} $HOME/sql \; -exec cp {} $HOME/database \;
################################################################################
#' Remove erlang/OTP & rebar3
FROM docker.io/erlang:${OTP_VSN}-alpine AS runtime
RUN apk del .erlang-rundeps \
&& rm -f $(which rebar3) \
&& find /usr -type d -name 'erlang' -exec rm -rf {} + \
&& find /usr -type l -exec test ! -e {} \; -delete
#' Update alpine, finalize runtime environment
COPY --from=ejabberd /tmp/runDeps /tmp/runDeps
RUN apk -U upgrade --available --no-cache \
&& apk add --no-cache \
$(cat /tmp/runDeps) \
so:libcap.so.2 \
so:libtdsodbc.so \
curl \
tini \
&& rm /tmp/runDeps
ARG USER
ARG UID
ARG HOME
RUN addgroup $USER -g $UID \
&& adduser -s /sbin/nologin -D -u $UID -h /$HOME -G $USER $USER
RUN ln -fs /usr/local/bin/ /opt/ejabberd/bin
RUN rm -rf /home \
&& ln -fs /opt /home
################################################################################
#' Build together production image
FROM scratch
ARG USER
ARG HOME
COPY --from=runtime / /
COPY --from=ejabberd /rootfs /
HEALTHCHECK \
--interval=5s \
--interval=1m \
--timeout=5s \
--start-period=5s \
--retries=120 \
CMD /usr/local/bin/ejabberdctl status
--retries=10 \
CMD ejabberdctl status
WORKDIR $HOME
USER ejabberd
VOLUME ["$HOME/conf", "$HOME/database", "$HOME/logs", "$HOME/upload"]
EXPOSE 1883 4369-4399 5222 5269 5280 5443
WORKDIR /$HOME
USER $USER
VOLUME ["/$HOME"]
EXPOSE 1880 1883 4369-4399 5210 5222 5269 5280 5443 5478 7777 50000-50099
ENTRYPOINT ["/usr/local/bin/ejabberdctl"]
ENTRYPOINT ["/sbin/tini","--","ejabberdctl"]
CMD ["foreground"]
+294
View File
@@ -0,0 +1,294 @@
@echo off
::
:: ejabberd container installer for Windows
:: -------------------------------------
:: v0.4
::
:: This batch script downloads an ejabberd container image
:: and setups a docker container to run ejabberd.
::
:: 1. Download and install Docker:
::
:: If you use Windows 10, download Docker Desktop from:
:: https://www.docker.com/
::
:: If you use Windows 7 or 8, download Docker Toolbox from:
:: https://github.com/docker/toolbox/releases
:: After installation, run Docker Quickstart Installer
::
::
:: 2. Edit those options:
:: Directory where your ejabberd deployment files will be installed
:: (configuration, database, logs, ...)
::
:: In Windows 10 you can configure the path:
set INSTALL_DIR_WINDOWS10=C:\ejabberd
:: In older Windows, not configurable, it will be installed in:
:: C:\Users\%USERNAME%\ejabberd
:: Please enter the desired ejabberd domain name.
:: The domain is the visible attribute that is added to the username
:: to form the Jabber Identifier (for example: user@example.net).
:: This computer must be known on the network with this address name.
:: You can later add more in conf/ejabberd.yml
set HOST=localhost
:: Please enter the administrator username for the current
:: ejabberd installation. A Jabber account with this username
:: will be created and granted administrative privileges.
:: Don't use blankspaces in the username.
set USER=admin
:: Please provide a password for that new administrator account
set PASSWORD=
:: By default this downloads 'latest' ejabberd version,
:: but you can set a specific version, for example '22.05'
:: or the bleeding edge 'master'. See available tags in
:: https://github.com/processone/ejabberd/pkgs/container/ejabberd
set VERSION=latest
:: This tells docker what ports ejabberd will use.
:: You can later configure them in conf/ejabberd.yml
set PORTS=5180 5222 5269 5443
::
:: 3. Now save this script and run it.
::
::
:: 4. When installation is completed:
::
:: If using Windows 10, open Docker Desktop and you can:
::
:: - (>) START the ejabberd container
:: - Enter WebAdmin: click the ([->]) OPEN IN BROWSER button
:: - To try ejabberdctl, click the (>_) CLI button, then: ejabberdctl
:: - ([]) STOP the ejabberd container
::
:: If using an old Windows, open Kitematic and you can:
::
:: - START the ejabberd container
:: - Open your configuration, logs, ... in Settings > Volumes
:: - Enter WebAdmin in Settings > Hostname/Ports > click on the 5180 port
:: - Try ejabberdctl in EXEC, then: ejabberdctl
:: - STOP the ejabberd container
::
:: You can delete the container and create it again running this script,
:: the configuration and database are maintained.
::
::===============================================================
:: Check Windows version
::
::===============================================================
set INSTALL_DIR_DOCKER=c/Users/%USERNAME%/ejabberd
for /f "tokens=4-5 delims=. " %%i in ('ver') do set WVERSION=%%i.%%j
if "%wversion%" == "10.0" (
echo === Preparing paths to install in Windows 10...
set INSTALL_DIR=%INSTALL_DIR_WINDOWS10%
set VC=-v %INSTALL_DIR_WINDOWS10%\conf:/opt/ejabberd/conf
set VD=-v %INSTALL_DIR_WINDOWS10%\database:/opt/ejabberd/database
set VL=-v %INSTALL_DIR_WINDOWS10%\logs:/opt/ejabberd/logs
set VM=-v %INSTALL_DIR_WINDOWS10%\ejabberd-modules:/opt/ejabberd/.ejabberd-modules
set DOCKERDOWNLOAD="First download and install Docker Desktop from https://www.docker.com/"
) else (
echo === Preparing paths to install in Windows older than 10...
set INSTALL_DIR=C:\Users\%USERNAME%\ejabberd
set VC=-v "/%INSTALL_DIR_DOCKER%/conf:/opt/ejabberd/conf"
set VD=-v "/%INSTALL_DIR_DOCKER%/database:/opt/ejabberd/database"
set VL=-v "/%INSTALL_DIR_DOCKER%/logs:/opt/ejabberd/logs"
set VM=-v "/%INSTALL_DIR_DOCKER%/ejabberd-modules:/opt/ejabberd/.ejabberd-modules"
set DOCKERDOWNLOAD="First download and install Docker Toolbox from https://github.com/docker/toolbox/releases"
)
set VOLUMES=%VC% %VD% %VL% %VM%
::===============================================================
:: Check docker is installed
::
::===============================================================
docker version >NUL
if %ERRORLEVEL% NEQ 0 (
echo.
echo === ERROR: It seems docker is not installed!!!
echo.
echo %DOCKERDOWNLOAD%
echo === Then try to run this script again.
echo.
pause
exit 1
)
::===============================================================
:: Check install options are correctly set
::
::===============================================================
if [%PASSWORD%]==[] (
echo.
echo === ERROR: PASSWORD not set!!!
echo.
echo === Please edit this script and set the PASSWORD.
echo === Then try to run this script again.
echo.
pause
exit 1
)
::===============================================================
:: Download Docker image
::
::===============================================================
set IMAGE=ghcr.io/processone/ejabberd:%VERSION%
echo.
echo === Checking if the '%IMAGE%' container image was already downloaded...
docker image history %IMAGE% >NUL
if %ERRORLEVEL% NEQ 0 (
echo === The '%IMAGE%' container image was not downloaded yet.
echo.
echo === Downloading the '%IMAGE%' container image, please wait...
docker pull %IMAGE%
) else (
echo === The '%IMAGE%' container image was already downloaded.
)
::===============================================================
:: Create preliminary container
::
::===============================================================
echo.
echo === Checking if the 'ejabberd' container already exists...
docker container logs ejabberd
if %ERRORLEVEL% EQU 0 (
echo.
echo === The 'ejabberd' container already exists.
echo === Nothing to do, so installation finishes now.
echo === You can go to Docker Desktop and start the 'ejabberd' container.
echo.
pause
exit 1
) else (
echo === The 'ejabberd' container doesn't yet exist,
echo === so let's continue the installation process.
)
echo.
if exist %INSTALL_DIR% (
echo === The INSTALL_DIR %INSTALL_DIR% already exists.
echo === No need to create the preliminary 'ejabberd-pre' image.
) else (
echo === The INSTALL_DIR %INSTALL_DIR% doesn't exist.
echo === Let's create the preliminary 'ejabberd-pre' image.
CALL :create-ejabberd-pre
)
::===============================================================
:: Create final container
::
::===============================================================
echo.
echo === Creating the final 'ejabberd' container using %IMAGE% image...
setlocal EnableDelayedExpansion
set PS=
for %%a in (%PORTS%) do (
set PS=!PS! -p %%a:%%a
)
docker create --name ejabberd --hostname localhost %PS% %VOLUMES% %IMAGE%
echo.
echo === Installation completed.
echo.
pause
EXIT /B %ERRORLEVEL%
::===============================================================
:: Function to create preliminary container
::
::===============================================================
:create-ejabberd-pre
echo.
echo === Creating a preliminary 'ejabberd-pre' container using %IMAGE% image...
docker create --name ejabberd-pre --hostname localhost %IMAGE%
echo.
echo === Now 'ejabberd-pre' will be started.
docker container start ejabberd-pre
echo.
echo === Waiting ejabberd to be running...
set /A timeout = 10
set status=4
goto :while
:statusstart
docker exec -it ejabberd-pre ejabberdctl status
goto :statusend
:while
if %status% GTR 0 (
echo.
timeout /t 1 /nobreak >NUL
set /A timeout = timeout - 1
if %timeout% EQU 0 (
set status=-1
) else (
goto :statusstart
:statusend
set status=%ERRORLEVEL%
)
goto :while
)
echo.
echo === Setting a few options...
docker exec -it ejabberd-pre sed -i "s!- localhost!- %HOST%!g" conf/ejabberd.yml
docker exec -it ejabberd-pre sed -i "s!^acl:!acl:\n admin:\n user:\n - \"%USER%@%HOST%\"!g" conf/ejabberd.yml
docker exec -it ejabberd-pre sed -i "s!5280!5180!g" conf/ejabberd.yml
docker exec -it ejabberd-pre sed -i "s!/admin!/!g" conf/ejabberd.yml
docker exec -it ejabberd-pre ejabberdctl reload_config
echo.
echo === Registering the administrator account...
docker exec -it ejabberd-pre ejabberdctl register %USER% %HOST% %PASSWORD%
docker exec -it ejabberd-pre ejabberdctl stop
echo.
echo === Copying conf, database, logs...
mkdir %INSTALL_DIR%
mkdir %INSTALL_DIR%\conf
mkdir %INSTALL_DIR%\database
mkdir %INSTALL_DIR%\logs
mkdir %INSTALL_DIR%\ejabberd-modules
docker cp ejabberd-pre:/opt/ejabberd/conf/ %INSTALL_DIR%
docker cp ejabberd-pre:/opt/ejabberd/database/ %INSTALL_DIR%
docker cp ejabberd-pre:/opt/ejabberd/logs/ %INSTALL_DIR%
echo.
echo === Deleting the preliminary 'ejabberd-pre' container...
docker stop ejabberd-pre
docker rm ejabberd-pre
EXIT /B 0
+289
View File
@@ -0,0 +1,289 @@
###
### ejabberd configuration file
###
### The parameters used in this configuration file are explained at
###
### https://docs.ejabberd.im/admin/configuration
###
### The configuration file is written in YAML.
### *******************************************************
### ******* !!! WARNING !!! *******
### ******* YAML IS INDENTATION SENSITIVE *******
### ******* MAKE SURE YOU INDENT SECTIONS CORRECTLY *******
### *******************************************************
### Refer to http://en.wikipedia.org/wiki/YAML for the brief description.
###
define_macro:
HOST: localhost
## ADMIN: ... # set by /usr/local/bin/ejabberdctl
PORT_C2S: 5222
PORT_C2S_TLS: 5223
PORT_S2S: 5269
PORT_HTTP_TLS: 5443
PORT_HTTP: 5280
PORT_BROWSER: 1880
PORT_STUN: 5478
PORT_TURN_MIN: 50000
PORT_TURN_MAX: 50099
PORT_MQTT: 1883
PORT_PROXY65: 7777
STARTTLS_REQUIRED: true
hosts:
- HOST
loglevel: info
## If you already have certificates, list them here
# certfiles:
# - /etc/letsencrypt/live/domain.tld/fullchain.pem
# - /etc/letsencrypt/live/domain.tld/privkey.pem
ca_file: /opt/ejabberd/conf/cacert.pem
certfiles:
- /opt/ejabberd/conf/server.pem
listen:
-
port: PORT_C2S
ip: "::"
module: ejabberd_c2s
max_stanza_size: 262144
shaper: c2s_shaper
access: c2s
starttls_required: STARTTLS_REQUIRED
-
port: PORT_C2S_TLS
ip: "::"
module: ejabberd_c2s
max_stanza_size: 262144
shaper: c2s_shaper
access: c2s
tls: true
-
port: PORT_S2S
ip: "::"
module: ejabberd_s2s_in
max_stanza_size: 524288
shaper: s2s_shaper
-
port: PORT_HTTP_TLS
ip: "::"
module: ejabberd_http
tls: true
request_handlers:
/admin: ejabberd_web_admin
/api: mod_http_api
/bosh: mod_bosh
/captcha: ejabberd_captcha
/upload: mod_http_upload
/websocket: ejabberd_http_ws
-
port: PORT_HTTP
ip: "::"
module: ejabberd_http
request_handlers:
/admin: ejabberd_web_admin
/.well-known/acme-challenge: ejabberd_acme
-
port: PORT_BROWSER
ip: "::"
module: ejabberd_http
request_handlers:
/: ejabberd_web_admin
-
port: "unix:../sockets/ctl_over_http.sock"
module: ejabberd_http
unix_socket:
mode: '0600'
request_handlers:
/ctl: ejabberd_ctl
-
port: PORT_STUN
ip: "::"
transport: udp
module: ejabberd_stun
use_turn: true
turn_min_port: PORT_TURN_MIN
turn_max_port: PORT_TURN_MAX
## The server's public IPv4 address:
# turn_ipv4_address: "203.0.113.3"
## The server's public IPv6 address:
# turn_ipv6_address: "2001:db8::3"
-
port: PORT_MQTT
ip: "::"
module: mod_mqtt
backlog: 1000
s2s_use_starttls: optional
acl:
local:
user_regexp: ""
loopback:
ip:
- 127.0.0.0/8
- ::1/128
admin:
user:
- ADMIN
access_rules:
local:
allow: local
c2s:
deny: blocked
allow: all
announce:
allow: admin
configure:
allow: admin
muc_create:
allow: local
pubsub_createnode:
allow: local
trusted_network:
allow: loopback
api_permissions:
"console commands":
from: ejabberd_ctl
who: all
what: "*"
"webadmin commands":
from: ejabberd_web_admin
who: admin
what: "*"
"adhoc commands":
from: mod_adhoc_api
who: admin
what: "*"
"http access":
from: mod_http_api
who:
access:
allow:
- acl: loopback
- acl: admin
oauth:
scope: "ejabberd:admin"
access:
allow:
- acl: loopback
- acl: admin
what:
- "*"
- "!stop"
- "!start"
"public commands":
who:
ip: 127.0.0.1/8
what:
- status
- connected_users_number
shaper:
normal:
rate: 3000
burst_size: 20000
fast: 100000
shaper_rules:
max_user_sessions: 10
max_user_offline_messages:
5000: admin
100: all
c2s_shaper:
none: admin
normal: all
s2s_shaper: fast
modules:
mod_adhoc: {}
mod_adhoc_api: {}
mod_admin_extra: {}
mod_announce:
access: announce
mod_avatar: {}
mod_blocking: {}
mod_bosh: {}
mod_caps: {}
mod_carboncopy: {}
mod_client_state: {}
mod_configure: {}
mod_disco: {}
mod_fail2ban: {}
mod_http_api: {}
mod_http_upload:
put_url: https://@HOST_URL_ENCODE@:5443/upload
custom_headers:
"Access-Control-Allow-Origin": "https://@HOST@"
"Access-Control-Allow-Methods": "GET,HEAD,PUT,OPTIONS"
"Access-Control-Allow-Headers": "Content-Type"
mod_last: {}
mod_mam:
## Mnesia is limited to 2GB, better to use an SQL backend
## For small servers SQLite is a good fit and is very easy
## to configure. Uncomment this when you have SQL configured:
## db_type: sql
assume_mam_usage: true
default: always
mod_mqtt: {}
mod_muc:
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
access_mam:
- allow
default_room_options:
mam: true
mod_muc_admin: {}
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping: {}
mod_privacy: {}
mod_private: {}
mod_proxy65:
access: local
max_connections: 5
port: PORT_PROXY65
mod_pubsub:
access_createnode: pubsub_createnode
plugins:
- flat
- pep
force_node_config:
## Avoid buggy clients to make their bookmarks public
storage:bookmarks:
access_model: whitelist
mod_push: {}
mod_push_keepalive: {}
mod_register:
## Only accept registration requests from the "trusted"
## network (see access_rules section above).
## Think twice before enabling registration from any
## address. See the Jabber SPAM Manifesto for details:
## https://github.com/ge0rg/jabber-spam-fighting-manifesto
ip_access: trusted_network
mod_roster:
versioning: true
mod_s2s_bidi: {}
mod_s2s_dialback: {}
mod_shared_roster: {}
mod_stream_mgmt:
resend_on_timeout: if_offline
mod_stun_disco: {}
mod_vcard: {}
mod_vcard_xupdate: {}
mod_version:
show_os: false
### Local Variables:
### mode: yaml
### End:
### vim: set filetype=yaml tabstop=8
+325 -42
View File
@@ -15,10 +15,10 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd -P)"
# shellcheck disable=SC2034
ERTS_VSN="{{erts_vsn}}"
ERL="{{erl}}"
IEX="{{bindir}}/iex"
EPMD="{{epmd}}"
[ -z "$ERLANG_COOKIE" ] && ERL_OPTIONS="-setcookie $(cat "${SCRIPT_DIR%/*}/releases/COOKIE")"
[ -n "$ERLANG_COOKIE" ] && [ ! -f "$HOME"/.erlang.cookie ] && echo "$ERLANG_COOKIE" > "$HOME"/.erlang.cookie && chmod 400 "$HOME"/.erlang.cookie
IEX="{{iexpath}}"
COOKIE_FILE="$HOME"/.erlang.cookie
[ -n "$ERLANG_COOKIE" ] && [ ! -f "$COOKIE_FILE" ] && echo "$ERLANG_COOKIE" > "$COOKIE_FILE" && chmod 400 "$COOKIE_FILE"
# check the proper system user is used
case $(id -un) in
@@ -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
@@ -68,20 +67,30 @@ done
# shellcheck source=ejabberdctl.cfg.example
[ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH"
[ -n "$ERLANG_NODE_ARG" ] && ERLANG_NODE="$ERLANG_NODE_ARG"
[ "$ERLANG_NODE" = "${ERLANG_NODE%@*}" ] && ERLANG_NODE="$ERLANG_NODE@$(hostname -s)"
[ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] && S="-s"
: "${SPOOL_DIR:="{{spool_dir}}"}"
: "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}"
# backward support for old mnesia spool dir path
: "${SPOOL_DIR_OLD:="$SPOOL_DIR/$ERLANG_NODE"}"
[ -r "$SPOOL_DIR_OLD/schema.DAT" ] && [ ! -r "$SPOOL_DIR/schema.DAT" ] && SPOOL_DIR="$SPOOL_DIR_OLD"
# define erl parameters
ERLANG_OPTS="+K $POLL +P $ERL_PROCESSES $ERL_OPTIONS"
if [ -n "$FIREWALL_WINDOW" ] ; then
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_listen_min ${FIREWALL_WINDOW%-*} inet_dist_listen_max ${FIREWALL_WINDOW#*-}"
fi
if [ -n "$INET_DIST_INTERFACE" ] ; then
INET_DIST_INTERFACE2=$("$ERL" -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
if [ -n "$INET_DIST_INTERFACE2" ] ; then
if [ "$(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l)" -eq 7 ] ; then
INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp"
fi
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2"
fi
fi
[ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -erl_epmd_port $ERL_DIST_PORT -start_epmd false"
# if vm.args file exists in config directory, pass it to Erlang VM
[ -f "$VMARGS" ] && ERLANG_OPTS="$ERLANG_OPTS -args_file $VMARGS"
ERL_LIBS='{{libdir}}'
@@ -89,9 +98,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")"
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"
@@ -101,6 +113,7 @@ export EJABBERD_LOG_PATH
export EJABBERD_PID_PATH
export ERL_CRASH_DUMP
export ERL_EPMD_ADDRESS
export ERL_DIST_PORT
export ERL_INETRC
export ERL_MAX_PORTS
export ERL_MAX_ETS_TABLES
@@ -109,6 +122,14 @@ export CONTRIB_MODULES_CONF_DIR
export ERL_LIBS
export SCRIPT_DIR
# Only required for Erlang/OTP 25:
export ERL_FLAGS="$ERL_FLAGS -enable-feature maybe_expr"
set_dist_client()
{
[ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -dist_listen false"
}
# run command either directly or via su $INSTALLUSER
run_cmd()
{
@@ -119,9 +140,19 @@ run_cmd()
}
exec_cmd()
{
case $EXEC_CMD in
as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
as_current_user) exec "$@" ;;
case $EXEC_CMD,$(uname -s) in
as_install_user,OpenBSD)
su -s /bin/sh "$INSTALLUSER" -c 'exec "$0" "$@"' "$@"
;;
as_install_user,NetBSD)
su "$INSTALLUSER" -c 'exec "$0" "$@"' -- "$@"
;;
as_install_user,*)
su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@"
;;
as_current_user,*)
"$@"
;;
esac
}
run_erl()
@@ -153,9 +184,11 @@ debugwarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To detach this shell from ejabberd, press:"
echo " control+c, control+c"
echo "To exit and detach this shell from ejabberd, press:"
echo " control+g and then q"
echo ""
#vt100 echo "Please do NOT use control+c in this debug shell !"
#vt100 echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
echo " EJABBERD_BYPASS_WARNINGS=true"
@@ -176,8 +209,10 @@ livewarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To exit this LIVE mode and stop ejabberd, press:"
echo " q(). and press the Enter key"
echo "To stop ejabberd gracefully:"
echo " ejabberd:stop()."
echo "To quit erlang immediately, press:"
echo " control+g and then q"
echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
@@ -188,6 +223,39 @@ 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
}
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 ""
@@ -216,21 +284,40 @@ help()
}
# dynamic node name helper
uid()
{
uuid=$(uuidgen 2>/dev/null)
random=$(awk 'BEGIN { srand(); print int(rand()*32768) }' /dev/null)
[ -z "$uuid" ] && [ -f /proc/sys/kernel/random/uuid ] && uuid=$(cat /proc/sys/kernel/random/uuid)
[ -z "$uuid" ] && uuid=$(printf "%X" "${random:-$$}$(date +%M%S)")
uuid=$(printf '%s' $uuid | sed 's/^\(...\).*$/\1/')
[ $# -eq 0 ] && echo "${uuid}-${ERLANG_NODE}"
[ $# -eq 1 ] && echo "${uuid}-${1}-${ERLANG_NODE}"
[ $# -eq 2 ] && echo "${uuid}-${1}@${2}"
uid() {
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
case $# in
0) NN="${PF}-${N}-${ERLANG_NODE}"
;;
1) NN="${PF}-${N}-${1}-${ERLANG_NODE}"
;;
2) NN="${PF}-${N}-${1}@${2}"
;;
esac
N=$(( N + 1 + ( $$ % 5 ) ))
"$EPMD" -names 2>/dev/null | grep -q " ${NN%@*} "
do :; done
echo $NN
else
# Erlang/OTP 23 or higher: use native dynamic node code
# https://www.erlang.org/patches/otp-23.0#OTP-13812
if [ "$ERLANG_NODE" != "${ERLANG_NODE%.*}" ]; then
echo "undefined@${ERLANG_NODE#*@}"
else
echo "undefined"
fi
fi
}
# stop epmd if there is no other running node
stop_epmd()
{
[ -n "$ERL_DIST_PORT" ] && return
"$EPMD" -names 2>/dev/null | grep -q name || "$EPMD" -kill >/dev/null
}
@@ -238,6 +325,19 @@ stop_epmd()
# if all ok, ensure runtime directory exists and make it current directory
check_start()
{
ECSIMAGE_DBPATH=$HOME/database/$ERLANG_NODE
[ ! -d "$ECSIMAGE_DBPATH" ] && ln -s $HOME/database $HOME/database/$ERLANG_NODE
[ -n "$ERL_DIST_PORT" ] && {
netstat -nl | grep ":5210" >/dev/null && {
echo "Error: The file ejabberdctl.cfg has configured ERL_DIST_PORT=$ERL_DIST_PORT"
echo " but the port 5210 is already in use."
echo " Stop that program or configure a different ERL_DIST_PORT"
echo ""
netstat -nlp | grep ":5210"
echo ""
}
return
}
"$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && {
pgrep -f "$ERLANG_NODE" >/dev/null && {
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."
@@ -270,14 +370,32 @@ post_waiter_loop()
LIST=$@
HEAD=${LIST%% ; *}
TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD"
$0 $HEAD
HEAD2=${HEAD#\! *}
echo ":> ejabberdctl $HEAD2"
$0 $HEAD2
ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then
if [ "$HEAD" != "$HEAD2" ] ; then
echo ":> FAILURE in command '$HEAD2' !!! Ignoring result"
else
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
fi
fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
}
# allow sync calls
wait_status()
{
wait_status_node "$ERLANG_NODE" $1 $2 $3
}
wait_status_node()
{
CONNECT_NODE=$1
shift
# args: status try delay
# return: 0 OK, 1 KO
timeout="$2"
@@ -288,14 +406,71 @@ wait_status()
if [ $timeout -eq 0 ] ; then
status="$1"
else
run_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \
-extra "$ERLANG_NODE" $NO_TIMEOUT status > /dev/null
run_erl "$(uid ctl)" -hidden -noinput \
-eval 'net_kernel:connect_node('"'$CONNECT_NODE'"')' \
-s ejabberd_ctl \
-extra "$CONNECT_NODE" $NO_TIMEOUT status > /dev/null
status="$?"
fi
done
[ $timeout -gt 0 ]
}
exec_other_command()
{
exec_other_command_node $ERLANG_NODE "$@"
}
exec_other_command_node()
{
CONNECT_NODE=$1
shift
if [ -z "$CTL_OVER_HTTP" ] || [ ! -S "$CTL_OVER_HTTP" ] \
|| [ ! -x "$(command -v curl)" ] || [ -z "$1" ] || [ "$1" = "help" ] \
|| [ "$1" = "mnesia_info_ctl" ]|| [ "$1" = "print_sql_schema" ] ; then
run_erl "$(uid ctl)" -hidden -noinput \
-eval 'net_kernel:connect_node('"'$CONNECT_NODE'"')' \
-s ejabberd_ctl \
-extra "$CONNECT_NODE" $NO_TIMEOUT "$@"
result=$?
case $result in
3) help;;
*) :;;
esac
return $result
else
exec_ctl_over_http_socket "$@"
fi
}
exec_ctl_over_http_socket()
{
COMMAND=${1}
CARGS=""
while [ $# -gt 0 ]; do
[ -z "$CARGS" ] && CARGS="[" || CARGS="${CARGS}, "
CARGS="${CARGS}\"$1\""
shift
done
CARGS="${CARGS}]"
TEMPHEADERS=temp-headers.log
curl \
--unix-socket ${CTL_OVER_HTTP} \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "${CARGS}" \
--dump-header ${TEMPHEADERS} \
--no-progress-meter \
"http://localhost/ctl/${COMMAND}"
result=$(sed -n 's/.*status-code: \([0-9]*\).*/\1/p' < $TEMPHEADERS)
rm ${TEMPHEADERS}
case $result in
2|3) exec_other_command help ${COMMAND};;
*) :;;
esac
exit $result
}
# ensure we can change current directory to SPOOL_DIR
[ -f "$SPOOL_DIR/schema.DAT" ] || FIRST_RUN=true
[ -d "$SPOOL_DIR" ] || run_cmd mkdir -p "$SPOOL_DIR"
@@ -304,6 +479,103 @@ cd "$SPOOL_DIR" || {
exit 6
}
printe()
{
printf "\n"
printf "\e[1;40;32m==> %s\e[0m\n" "$1"
}
## Function copied from tools/make-installers
user_agrees()
{
question="$*"
if [ -t 0 ]
then
printe "$question (y/n) [n]"
read -r response
case "$response" in
[Yy]|[Yy][Ee][Ss])
return 0
;;
[Nn]|[Nn][Oo]|'')
return 1
;;
*)
echo 'Please respond with "yes" or "no".'
user_agrees "$question"
;;
esac
else # Assume 'yes' if not running interactively.
return 0
fi
}
mnesia_change()
{
ERLANG_NODE_OLD="$1"
[ "$ERLANG_NODE_OLD" = "" ] \
&& echo "Error: Please provide the old erlang node name, for example:" \
&& echo " ejabberdctl mnesia_change ejabberd@oldmachine" \
&& exit 1
SPOOL_DIR_BACKUP=$SPOOL_DIR/$ERLANG_NODE_OLD-backup/
OLDFILE=$SPOOL_DIR_BACKUP/$ERLANG_NODE_OLD.backup
NEWFILE=$SPOOL_DIR_BACKUP/$ERLANG_NODE.backup
printe "This changes your mnesia database from node name '$ERLANG_NODE_OLD' to '$ERLANG_NODE'"
[ -d "$SPOOL_DIR_BACKUP" ] && printe "WARNING! A backup of old node already exists in $SPOOL_DIR_BACKUP"
if ! user_agrees "Do you want to proceed?"
then
echo 'Operation aborted.'
exit 1
fi
printe "Starting ejabberd with old node name $ERLANG_NODE_OLD ..."
exec_erl "$ERLANG_NODE_OLD" $EJABBERD_OPTS -detached
wait_status_node $ERLANG_NODE_OLD 0 30 2
result=$?
case $result in
1) echo "There was a problem starting ejabberd with the old erlang node name. " \
&& echo "Check for log errors in $EJABBERD_LOG_PATH" \
&& exit $result;;
*) :;;
esac
exec_other_command_node $ERLANG_NODE_OLD "status"
printe "Making backup of old database to file $OLDFILE ..."
mkdir $SPOOL_DIR_BACKUP
exec_other_command_node $ERLANG_NODE_OLD backup "$OLDFILE"
printe "Changing node name in new backup file $NEWFILE ..."
exec_other_command_node $ERLANG_NODE_OLD mnesia_change_nodename "$ERLANG_NODE_OLD" "$ERLANG_NODE" "$OLDFILE" "$NEWFILE"
printe "Stopping old ejabberd..."
exec_other_command_node $ERLANG_NODE_OLD "stop"
wait_status_node $ERLANG_NODE_OLD 3 30 2 && stop_epmd
printe "Moving old mnesia spool files to backup subdirectory $SPOOL_DIR_BACKUP ..."
mv $SPOOL_DIR/*.DAT $SPOOL_DIR_BACKUP
mv $SPOOL_DIR/*.DCD $SPOOL_DIR_BACKUP
mv $SPOOL_DIR/*.LOG $SPOOL_DIR_BACKUP
printe "Starting ejabberd with new node name $ERLANG_NODE ..."
exec_erl "$ERLANG_NODE" $EJABBERD_OPTS -detached
wait_status 0 30 2
exec_other_command "status"
printe "Installing fallback of new mnesia..."
exec_other_command install_fallback "$NEWFILE"
printe "Stopping new ejabberd..."
exec_other_command "stop"
wait_status 3 30 2 && stop_epmd
printe "Finished, now you can start ejabberd normally"
}
# main
case $1 in
start)
@@ -326,44 +598,55 @@ case $1 in
;;
debug)
debugwarning
set_dist_client
exec_erl "$(uid debug)" -hidden -remsh "$ERLANG_NODE"
;;
etop)
exec_erl "$(uid top)" -hidden -node "$ERLANG_NODE" -s etop \
-s erlang halt -output text
set_dist_client
exec_erl "$(uid top)" -hidden -remsh "$ERLANG_NODE" \
-eval 'net_kernel:connect_node('"'$ERLANG_NODE'"')' \
-s etop \
-output text
check_etop_result
;;
iexdebug)
debugwarning
set_dist_client
exec_iex "$(uid debug)" --remsh "$ERLANG_NODE"
check_iex_result
;;
iexlive)
livewarning
exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS" --app ejabberd
exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS"
check_iex_result
;;
ping)
PEER=${2:-$ERLANG_NODE}
[ "$PEER" = "${PEER%.*}" ] && PS="-s"
set_dist_client
exec_cmd "$ERL" ${PS:--}name "$(uid ping "$(hostname $PS)")" $ERLANG_OPTS \
-noinput -hidden -eval 'io:format("~p~n",[net_adm:ping('"'$PEER'"')])' \
-s erlang halt -output text
-noinput -hidden \
-eval 'net_kernel:connect_node('"'$PEER'"')' \
-eval 'io:format("~p~n",[net_adm:ping('"'$PEER'"')])' \
-eval 'halt(case net_adm:ping('"'$PEER'"') of pong -> 0; pang -> 1 end).' \
-output text
;;
started)
set_dist_client
wait_status 0 30 2 # wait 30x2s before timeout
;;
stopped)
set_dist_client
wait_status 3 30 2 && stop_epmd # wait 30x2s before timeout
;;
mnesia_change)
mnesia_change $2
;;
post_waiter)
post_waiter_waiting
;;
*)
run_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \
-extra "$ERLANG_NODE" $NO_TIMEOUT "$@"
result=$?
case $result in
2|3) help;;
*) :;;
esac
exit $result
set_dist_client
exec_other_command "$@"
;;
esac
-18
View File
@@ -1,18 +0,0 @@
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"
+342 -206
View File
@@ -4,7 +4,6 @@ on:
push:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
@@ -12,190 +11,237 @@ on:
pull_request:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
- '**.md'
env:
DEV: _build/dev/rel/ejabberd
jobs:
tests:
name: Tests
############################################################### Compile #####
compile:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
otp: ['19.3', '24', '25.0-rc3']
include:
- otp: '19.3'
rebar: 2
os: ubuntu-18.04
- otp: '24'
rebar: 3
os: ubuntu-20.04
- otp: '25.0-rc3'
rebar: 3
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
otp: ['28']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Test shell scripts
if: matrix.otp == 24
run: |
shellcheck test/ejabberd_SUITE_data/gencerts.sh
shellcheck tools/captcha.sh
shellcheck ejabberd.init.template
shellcheck -x ejabberdctl.template
- name: Get specific Erlang/OTP
uses: ErlGang/setup-erlang@master
if: matrix.otp != 24
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: Get a compatible Rebar
if: matrix.rebar == 2
run: |
rm rebar
wget https://github.com/processone/ejabberd/raw/21.12/rebar
chmod +x rebar
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libexpat1-dev libgd-dev libpam0g-dev
libsqlite3-dev libwebp-dev libyaml-dev
- name: Prepare databases
run: |
sudo systemctl start mysql.service
sudo systemctl start postgresql.service
mysql -u root -proot -e "CREATE USER 'ejabberd_test'@'localhost'
IDENTIFIED BY 'ejabberd_test';"
mysql -u root -proot -e "CREATE DATABASE ejabberd_test;"
mysql -u root -proot -e "GRANT ALL ON ejabberd_test.*
TO 'ejabberd_test'@'localhost';"
mysql -u root -proot ejabberd_test < sql/mysql.sql
pg_isready
sudo -u postgres psql -c "CREATE USER ejabberd_test
WITH PASSWORD 'ejabberd_test';"
sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;"
sudo -u postgres psql ejabberd_test -f sql/pg.sql
sudo -u postgres psql -c "GRANT ALL PRIVILEGES
ON DATABASE ejabberd_test TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
TABLES IN SCHEMA public
TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
SEQUENCES IN SCHEMA public
TO ejabberd_test;"
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Prepare rebar
run: |
echo '{xref_ignores, [{eldap_filter_yecc, return_error, 2}
]}.' >>rebar.config
echo '{xref_checks, [deprecated_function_calls, deprecated_functions,
locals_not_used, undefined_function_calls, undefined_functions]}.
% Disabled: exports_not_used,' >>rebar.config
echo '{dialyzer, [{get_warnings, true}, {plt_extra_apps, [cache_tab,
eimp, epam, esip, ezlib, fast_tls, fast_xml, fast_yaml,
mqtree, p1_acme, p1_mysql, p1_oauth2, p1_pgsql, p1_utils, pkix,
sqlite3, stringprep, stun, xmpp, yconf]} ]}.' >>rebar.config
echo '{ct_extra_params, "-verbosity 20"}.' >>rebar.config
echo "{ct_opts, [{verbosity, 20}, {keep_logs, 20}]}." >>rebar.config
- name: Cache rebar
uses: actions/cache@v3
- name: Cache rebar3
uses: actions/cache@v5
with:
path: |
deps/
dialyzer/
ebin/
~/.cache/rebar3/
key: ${{matrix.otp}}-${{matrix.rebar}}-${{hashFiles('rebar.config')}}
- name: Download test logs
if: matrix.otp == 24 && github.repository == 'processone/ejabberd'
continue-on-error: true
run: |
mkdir -p _build/test
curl -sSL https://github.com/processone/ecil/tarball/gh-pages |
tar -C _build/test --strip-components=1 --wildcards -xzf -
rm -rf _build/test/logs/last/
_build/default/lib/
key: ci-${{ matrix.otp }}-${{hashFiles('rebar.*')}}
- name: Compile
run: |
./autogen.sh
[[ ${{ matrix.rebar }} = 2 ]] && REBAR=rebar || REBAR=`which rebar3`
./configure --with-rebar=$REBAR \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-mssql \
--disable-odbc
make update
make
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: rebar3
configure: --disable-elixir
- name: Compress compiled.tar
run: |
tar -cvf /tmp/compiled.tar .
- uses: actions/upload-artifact@v6
with:
name: compiled-${{ matrix.otp }}
path: /tmp/compiled.tar
retention-days: 1
########################################################## Static Tests #####
static:
needs: compile
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['28']
steps:
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- uses: actions/download-artifact@v7
with:
name: compiled-${{ matrix.otp }}
- run: tar -xf compiled.tar
- name: Test shell scripts
run: |
shellcheck ejabberd.init.template
shellcheck -x ejabberdctl.template
shellcheck .vscode/relive.sh
shellcheck rel/setup-dev.sh
shellcheck rel/setup-relive.sh
shellcheck test/ejabberd_SUITE_data/gencerts.sh
shellcheck tools/captcha.sh
shellcheck tools/emacs-indent.sh
shellcheck tools/generate-doap.sh
shellcheck tools/prepare-tr.sh
shellcheck tools/rebar3-format.sh
- run: make install -s
- run: make hooks
- run: make options
- run: make xref
- run: |
make dialyzer
[ ${{ matrix.rebar }} = 3 ] && true \
|| { cat dialyzer/error.log ; test ! -s dialyzer/error.log ; }
- run: make dialyzer
- run: make testeunit
- run: make elvis
if: matrix.otp > '25'
- name: Check Production Release
if: matrix.rebar == 3
- run: make install -s
######################################################### Dynamic Tests #####
dynamic:
needs: compile
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['28']
steps:
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.otp < '28'
with:
packages: libexpat1-dev libgd-dev libpam0g-dev
libsqlite3-dev libwebp-dev libyaml-dev
- uses: actions/download-artifact@v7
with:
name: compiled-${{ matrix.otp }}
- run: tar -xf compiled.tar
- name: Check production release
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, stop, check
- name: Start development release
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, no_tls, start, register
username: user123
- name: Run XMPP Interoperability Tests against CI server
if: matrix.otp == '28'
continue-on-error: true
uses: XMPP-Interop-Testing/xmpp-interop-tests-action@v1.7.2
with:
domain: 'localhost'
adminAccountUsername: 'user123'
adminAccountPassword: 's0mePass'
disabledSpecifications: RFC6121,XEP-0030,XEP-0045,XEP-0054,XEP-0060,
XEP-0080,XEP-0115,XEP-0118,XEP-0215,XEP-0347,
XEP-0363,XEP-0384,XEP-0421
- name: Stop development release
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: stop, check
- name: View production logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: logs
- name: View development logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: logs
##################################################### Common Test Suite #####
ct:
needs: compile
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['28']
backend: [agnostic, extauth, ldap, mnesia, mysql, pgsql, redis, sqlite]
schema: [single, multi]
exclude:
- backend: agnostic
schema: single
- backend: extauth
schema: single
- backend: ldap
schema: single
- backend: mnesia
schema: single
- backend: redis
schema: single
steps:
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- uses: actions/download-artifact@v7
with:
name: compiled-${{ matrix.otp }}
- run: tar -xf compiled.tar
- name: Prepare database
uses: ./.github/actions/manage-database
with:
for: ${{ matrix.backend }}
do: install, start, user, create
- name: Setup multihost SQL schema
if: matrix.schema == 'multi'
run: |
make rel
RE=_build/prod/rel/ejabberd
$RE/bin/ejabberdctl start
$RE/bin/ejabberdctl started
$RE/bin/ejabberdctl stop
$RE/bin/ejabberdctl stopped
cat $RE/logs/ejabberd.log
grep -q "is stopped in" $RE/logs/ejabberd.log
sed -i 's|multihost_schema, false|multihost_schema, true|g' \
test/suite.erl
- name: Check Development Release
if: matrix.rebar == 3
run: |
make dev
RE=_build/dev/rel/ejabberd
$RE/bin/ejabberdctl start
$RE/bin/ejabberdctl started
$RE/bin/ejabberdctl stop
$RE/bin/ejabberdctl stopped
cat $RE/logs/ejabberd.log
grep -q "is stopped in" $RE/logs/ejabberd.log
- name: Run tests (OTP 19.3)
if: matrix.otp == '19.3'
id: ct2
run: make test
- name: Run tests
if: matrix.otp != '19.3'
id: ct
run: CT_BACKENDS=${{ matrix.backend }} make test
- name: Send to coveralls
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(cd priv && ln -sf ../sql)
COMMIT=`echo $GITHUB_SHA | cut -c 1-7`
DATE=`date +%s`
REF_NAME=`echo $GITHUB_REF_NAME | tr "/" "_"`
NODENAME=$DATE@$GITHUB_RUN_NUMBER-$GITHUB_ACTOR-$REF_NAME-$COMMIT
LABEL=`git show -s --format=%s | cut -c 1-30`
rebar3 ct --name $NODENAME --label "$LABEL"
rebar3 cover
DIAGNOSTIC=1 ./rebar3 as test coveralls send
- name: Check results
if: always() && (steps.ct.outcome != 'skipped' || steps.ct2.outcome != 'skipped')
if: always() && (steps.ct.outcome != 'skipped')
id: ctresults
run: |
[[ -d _build ]] && ln -s _build/test/logs/last/ logs || true
@@ -204,20 +250,44 @@ jobs:
grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log
test $(find logs/ -empty -name error.log)
- name: View logs failures
if: failure() && steps.ctresults.outcome == 'failure'
- name: View logs
if: always()
run: |
echo "::group::ejabberd.log"
find logs/ -name ejabberd.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::error.log"
find logs/ -name error.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::exunit.log"
find logs/ -name exunit.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::suite.log (only failures)"
cat logs/suite.log | awk \
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
find logs/ -name error.log -exec cat '{}' ';'
find logs/ -name exunit.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::suite.log (complete)"
cat logs/suite.log
echo "::endgroup::"
- name: Send to coveralls
if: matrix.otp == 24
- name: Upload CT logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: ct-logs-${{ matrix.otp }}-${{ matrix.backend }}-${{ matrix.schema }}
path: _build/test/logs
retention-days: 14
############################################################# Coveralls #####
cover:
needs: ct
runs-on: ubuntu-24.04-arm
steps:
- name: Finish parallel upload to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DIAGNOSTIC=1 rebar3 as test coveralls send
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data '{"repo_name":"$GITHUB_REPOSITORY",
@@ -225,57 +295,123 @@ jobs:
"payload":{"build_num":$GITHUB_RUN_ID,
"status":"done"}}'
- name: Upload test logs
if: always() && steps.ct.outcome == 'failure' && github.repository == 'processone/ejabberd'
uses: peaceiris/actions-gh-pages@v3
################################################################ Schema #####
schema:
needs: compile
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['28']
steps:
- uses: erlef/setup-beam@v1
with:
publish_dir: _build/test
exclude_assets: '.github,lib,plugins'
external_repository: processone/ecil
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
keep_files: true
otp-version: ${{ matrix.otp }}
- name: View ECIL address
if: always() && steps.ct.outcome == 'failure' && github.repository == 'processone/ejabberd'
run: |
CTRUN=`ls -la _build/test/logs/last | sed 's|.*-> ||'`
echo "::notice::View CT results: https://processone.github.io/ecil/logs/$CTRUN/"
- uses: actions/download-artifact@v7
with:
name: compiled-${{ matrix.otp }}
- run: tar -xf compiled.tar
- name: Prepare new schema
###################################### multi-changed ##
- name: Prepare databases
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql
do: install, start, user, create
- name: Prepare configuration
run: |
[[ -d logs ]] && rm -rf logs
[[ -d _build/test/logs ]] && rm -rf _build/test/logs || true
mysql -u root -proot -e "DROP DATABASE ejabberd_test;"
sudo -u postgres psql -c "DROP DATABASE ejabberd_test;"
mysql -u root -proot -e "CREATE DATABASE ejabberd_test;"
mysql -u root -proot -e "GRANT ALL ON ejabberd_test.*
TO 'ejabberd_test'@'localhost';"
mysql -u root -proot ejabberd_test < sql/mysql.new.sql
sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;"
sudo -u postgres psql ejabberd_test -f sql/pg.new.sql
sudo -u postgres psql -c "GRANT ALL PRIVILEGES
ON DATABASE ejabberd_test TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
TABLES IN SCHEMA public
TO ejabberd_test;"
sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL
SEQUENCES IN SCHEMA public
TO ejabberd_test;"
sudo sed -i 's|new_schema, false|new_schema, true|g' test/suite.erl
- run: CT_BACKENDS=mysql,pgsql make test
id: ctnewschema
- name: Check results
if: always() && steps.ctnewschema.outcome != 'skipped'
CT_BACKENDS=mysql,pgsql ./rebar3 ct \
--suite=test/ejabberd_SUITE --group=configtest_single
make dev
cp test/ejabberd_SUITE_data/ejabberd.yml ${{ env.DEV }}/conf/
cp _build/test/logs/last/*.yml ${{ env.DEV }}/database/
echo "define_macro: [CONFIGTEST_CONFIG: {modules: {mod_muc: {}}}]" \
> ${{ env.DEV }}/database/configtest.yml
cp _build/test/logs/last/*.pem ${{ env.DEV }}/conf/
cp _build/test/logs/last/*.pem ${{ env.DEV }}/database/
- name: Run ejabberd
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: start, update_sql, stop, check, logs
username: user2
- name: Dump multihost databases
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql
do: dump
dump-suffix: multi-changed
######################################### multi-auto ##
- name: Prepare databases
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql
do: drop, create
- name: Configure multihost schema
run: |
[[ -d _build ]] && ln -s _build/test/logs/last/ logs || true
ln `find logs/ -name suite.log` logs/suite.log
grep 'TEST COMPLETE' logs/suite.log
grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log
test $(find logs/ -empty -name error.log)
- name: View logs failures
if: failure() && steps.ctnewschema.outcome != 'skipped'
sed -i 's|MULTIHOST_SCHEMA|true|g' ${{ env.DEV }}/conf/ejabberd.yml
- name: Run ejabberd for multihost
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: start, stop, check, logs
username: user2
- name: Dump multihost databases
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql
do: dump
dump-suffix: multi-auto
############################################ compare ##
- name: View SQL schemas (mysql)
run: |
cat logs/suite.log | awk \
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
find logs/ -name error.log -exec cat '{}' ';'
find logs/ -name exunit.log -exec cat '{}' ';'
perl test/ejabberd_SUITE_data/sql_sort.pl \
<mysql-multi-auto.sql >mysql-multi2.sql
perl test/ejabberd_SUITE_data/sql_sort.pl \
<mysql-multi-changed.sql >mysql-changed2.sql
echo "::group::differences multi-auto > multi-changed"
diff -u mysql-multi2.sql mysql-changed2.sql || echo ok
echo "::endgroup::"
echo "::group::multi-auto.sql"
cat mysql-multi-auto.sql
echo "::endgroup::"
echo "::group::multi-changed.sql"
cat mysql-multi-changed.sql
echo "::endgroup::"
- name: View SQL schemas (pgsql)
run: |
perl test/ejabberd_SUITE_data/sql_sort.pl \
<pgsql-multi-auto.sql >pgsql-multi2.sql
perl test/ejabberd_SUITE_data/sql_sort.pl \
<pgsql-multi-changed.sql >pgsql-changed2.sql
echo "::group::differences (multi-auto > multi-changed)"
diff -u pgsql-multi2.sql pgsql-changed2.sql || echo ok
echo "::endgroup::"
echo "::group::multi-auto.sql"
cat pgsql-multi-auto.sql
echo "::endgroup::"
echo "::group::multi-changed.sql"
cat pgsql-multi-changed.sql
echo "::endgroup::"
- name: View ejabberd logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: logs
+71 -20
View File
@@ -4,7 +4,6 @@ on:
push:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
@@ -15,20 +14,32 @@ env:
IMAGE_NAME: ${{ github.repository }}
jobs:
container:
name: Container
runs-on: ubuntu-20.04
build:
runs-on: ubuntu-24.04${{ matrix.suffix }}
strategy:
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
suffix:
- platform: arm64
suffix: -arm
permissions:
packages: write
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v1.14.1
- name: Checkout ejabberd-contrib
uses: actions/checkout@v6
with:
repository: processone/ejabberd-contrib
path: .ejabberd-modules/sources/ejabberd-contrib
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -36,33 +47,73 @@ jobs:
- name: Get git describe
id: gitdescribe
run: echo "::set-output name=ver::$(git describe --tags)"
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
- name: Extract metadata (tags, labels) for Docker
- uses: docker/metadata-action@v5
id: meta
uses: docker/metadata-action@v3.8.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--${{ matrix.platform }}
labels: |
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
org.opencontainers.image.licenses=GPL-2.0
org.opencontainers.image.vendor=ProcessOne
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker image
uses: docker/build-push-action@v2.10.0
- uses: docker/build-push-action@v6
with:
build-args: |
VERSION=${{ steps.gitdescribe.outputs.ver }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .github/container
context: .
file: .github/container/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
platforms: linux/${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
merge:
needs: [build]
runs-on: ubuntu-24.04
outputs:
image-uri: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.merge.outputs.digest }}
steps:
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta-amd
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--amd64
- uses: docker/metadata-action@v5
id: meta-arm
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--arm64
- uses: docker/metadata-action@v5
id: meta-result
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: int128/docker-manifest-create-action@v2
id: merge
with:
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.meta-result.outputs.tags }}
sources: |
${{ steps.meta-amd.outputs.tags }}
${{ steps.meta-arm.outputs.tags }}
#- uses: dataaxiom/ghcr-cleanup-action@v1
# with:
# dry-run: true
# delete-tags: '*--a??64'
# delete-untagged: true
# delete-ghost-images: true
# delete-partial-images: true
# delete-orphaned-images: true
+42 -17
View File
@@ -4,7 +4,6 @@ on:
push:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
@@ -12,7 +11,6 @@ on:
pull_request:
paths-ignore:
- '.devcontainer/**'
- 'examples/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
@@ -20,14 +18,25 @@ on:
jobs:
binaries:
name: Binaries
runs-on: ubuntu-latest
runs-on: ubuntu-22.04${{ matrix.suffix }}
strategy:
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
suffix:
- platform: arm64
suffix: -arm
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache build directory
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/build/
key: ${{runner.os}}-ct-ng-1.25.0-RC2
key: installers-ubuntu-22.04-${{runner.arch}}-${{hashFiles('tools/make-binaries')}}
- name: Install prerequisites
run: |
sudo apt-get -qq update
@@ -39,25 +48,41 @@ jobs:
- name: Install FPM
run: |
gem install --no-document --user-install fpm
echo $HOME/.gem/ruby/*/bin >> $GITHUB_PATH
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
echo $HOME/.local/share/gem/ruby/*/bin >> $GITHUB_PATH
- name: Build binary archives
run: CHECK_DEPS=false tools/make-binaries
- name: Build DEB and RPM packages
run: tools/make-packages
- name: Build installers
run: tools/make-installers
- run: echo "rel_name_vsn=$(ls *.run | sed 's/-1-linux.*//g')" >> $GITHUB_OUTPUT
id: vsn
- name: Test RUN
uses: ./.github/actions/manage-ejabberd
with:
for: run
do: deploy, no_acme, start, register, stop, check, logs
username: user1
host: $(hostname --fqdn)
rel_name_vsn: ${{ steps.vsn.outputs.rel_name_vsn }}
- name: Test DEB
uses: ./.github/actions/manage-ejabberd
with:
for: deb
do: deploy, register, stop, logs
username: user1
host: $(hostname --fqdn)
rel_name_vsn: ${{ steps.vsn.outputs.rel_name_vsn }}
- name: Collect packages
run: |
mkdir ejabberd-packages
mv ejabberd_*.deb ejabberd-*.rpm ejabberd-*.run ejabberd-packages
- name: Upload packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: ejabberd-packages
name: ejabberd-packages-${{ matrix.platform }}
#
# Appending the wildcard character ("*") is a trick to make
# "ejabberd-packages" the root directory of the uploaded ZIP file:
@@ -70,15 +95,15 @@ jobs:
release:
name: Release
needs: [binaries]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.ref_type == 'tag'
steps:
- name: Download packages
uses: actions/download-artifact@v3
uses: actions/download-artifact@v7
with:
name: ejabberd-packages
merge-multiple: true
- name: Draft Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: ejabberd-packages/*
+193 -191
View File
@@ -26,120 +26,184 @@ on:
jobs:
################################################################ Rebars #####
rebars:
name: Rebars
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
otp: ['19.3', '21.3', '22.0', '24.3', '25.0-rc3']
otp: ['25', '26', '27', '28', '29']
rebar: ['rebar', 'rebar3']
include:
- otp: '19.3'
os: ubuntu-18.04
- otp: '21.3'
os: ubuntu-20.04
- otp: '22.0'
os: ubuntu-20.04
- otp: '24.3'
os: ubuntu-20.04
- otp: '25.0-rc3'
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
exclude:
- otp: '27'
rebar: 'rebar'
- otp: '28'
rebar: 'rebar'
- otp: '29'
rebar: 'rebar'
container:
image: erlang:${{ matrix.otp }}
image: public.ecr.aws/docker/library/erlang:${{ matrix.otp }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Prepare libraries
run: |
apt-get -qq update
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
apt-get -q -y install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Cache rebar3
if: matrix.rebar == 'rebar3'
uses: actions/cache@v5
with:
path: |
~/.cache/rebar3/
_build/default/lib/
key: runtime-${{ matrix.otp }}-${{matrix.rebar}}-${{hashFiles('rebar.*')}}
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=`which ${{ matrix.rebar }}` \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
make update
make
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: ${{ matrix.rebar }}
configure: --disable-elixir
- run: make hooks
- run: make options
- run: make xref
- run: make dialyzer
- run: make elvis
if: matrix.otp > '25' && matrix.rebar == 'rebar3'
- name: Test rel (rebar2)
if: matrix.rebar == 'rebar'
run: |
make rel
rel/ejabberd/bin/ejabberdctl start \
&& rel/ejabberd/bin/ejabberdctl started
rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
rel/ejabberd/bin/ejabberdctl registered_users localhost
cat rel/ejabberd/logs/*
- name: Production
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, register, stop, check, logs
tool: ${{ matrix.rebar }}
username: user1
- name: Test rel
if: matrix.rebar != 'rebar'
run: |
make rel
_build/prod/rel/ejabberd/bin/ejabberdctl start \
&& _build/prod/rel/ejabberd/bin/ejabberdctl started
_build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost
_build/prod/rel/ejabberd/bin/ejabberdctl stop \
&& _build/prod/rel/ejabberd/bin/ejabberdctl stopped
cat _build/prod/rel/ejabberd/logs/*
- name: Development
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, start, register, stop, check, logs
tool: ${{ matrix.rebar }}
username: user2
- name: Test dev
if: matrix.rebar != 'rebar'
run: |
make dev
_build/dev/rel/ejabberd/bin/ejabberdctl start \
&& _build/dev/rel/ejabberd/bin/ejabberdctl started
_build/dev/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost
_build/dev/rel/ejabberd/bin/ejabberdctl stop \
&& _build/dev/rel/ejabberd/bin/ejabberdctl stopped
cat _build/dev/rel/ejabberd/logs/*
- name: Installed
uses: ./.github/actions/manage-ejabberd
with:
for: install
do: deploy, start, register, stop, check, logs
tool: ${{ matrix.rebar }}
username: user3
mix:
name: Mix
####################################################### Rebar3 + Elixir #####
rebar3-elixir:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
otp: ['21.3', '22.0', '24.3']
elixir: ['1.10.3', '1.11.4', '1.12.3', '1.13.0']
exclude:
- otp: '21.3'
elixir: '1.12.3'
- otp: '21.3'
elixir: '1.13.0'
- otp: '24.3'
elixir: '1.10.3'
- otp: '24.3'
elixir: '1.11.4'
runs-on: ubuntu-20.04
elixir: ['1.14', '1.18', '1.19']
container:
image: public.ecr.aws/docker/library/elixir:${{ matrix.elixir }}
steps:
- uses: actions/checkout@v3
- name: Get specific Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/checkout@v6
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
apt-get -qq update
apt-get -q -y install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Remove Elixir Matchers
- name: Enable Module.Example and an Elixir dependency
run: |
sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" \
ejabberd.yml.example
cat ejabberd.yml.example
sed -i 's|^{deps, \[\(.*\)|{deps, [{decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}},\n \1|g' rebar.config
cat rebar.config
- name: Cache hex.pm
uses: actions/cache@v5
with:
path: |
~/.cache/rebar3/
key: runtime-${{matrix.elixir}}-${{hashFiles('rebar.*')}}
- name: Install Hex and Rebar3 manually on older Elixir
if: matrix.elixir < '1.15'
run: |
mix local.hex --force
mix local.rebar --force
- name: Compile
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: ./rebar3
- name: Test scripts, deps, eunit
run: |
make scripts deps
./rebar3 eunit --verbose
- run: make hooks
- run: make options
- run: make xref
#- run: make dialyzer
- run: make elvis
if: matrix.otp > '25'
- name: Production
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, register, stop, check, logs
username: user1
- name: Release
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, start, register, stop, check, logs
username: user2
- name: Installed
uses: ./.github/actions/manage-ejabberd
with:
for: install
do: deploy, start, register, stop, check, logs
username: user3
################################################################### Mix #####
mix:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
elixir: ['1.14', '1.18', '1.19']
container:
image: public.ecr.aws/docker/library/elixir:${{ matrix.elixir }}
steps:
- uses: actions/checkout@v6
- name: Prepare libraries
run: |
apt-get -qq update
apt-get -q -y install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Remove Elixir matchers
run: |
echo "::remove-matcher owner=elixir-mixCompileWarning::"
echo "::remove-matcher owner=elixir-credoOutputDefault::"
@@ -147,122 +211,60 @@ jobs:
echo "::remove-matcher owner=elixir-mixTestFailure::"
echo "::remove-matcher owner=elixir-dialyzerOutputDefault::"
- name: Compile
- name: Enable Module.Example and an Elixir dependency
run: |
./autogen.sh
./configure --with-rebar=mix \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
mix deps.get
make
sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" \
ejabberd.yml.example
cat ejabberd.yml.example
sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config
cat rebar.config
- run: make xref
- name: Run rel
run: |
make rel
_build/prod/rel/ejabberd/bin/ejabberdctl start \
&& _build/prod/rel/ejabberd/bin/ejabberdctl started
_build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log
_build/prod/rel/ejabberd/bin/ejabberdctl stop \
&& _build/prod/rel/ejabberd/bin/ejabberdctl stopped
- name: Run dev
run: |
make dev
_build/dev/rel/ejabberd/bin/ejabberdctl start \
&& _build/dev/rel/ejabberd/bin/ejabberdctl started
_build/dev/rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass
_build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost >> registered.log
_build/dev/rel/ejabberd/bin/ejabberdctl stop \
&& _build/dev/rel/ejabberd/bin/ejabberdctl stopped
- name: Check rel
if: always()
run: |
grep -q '^user1$' registered.log
grep -q '^user2$' registered.log
grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log
test $(find _build/prod/ -empty -name error.log)
grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log
grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log
test $(find _build/dev/ -empty -name error.log)
- name: View logs failures
if: failure()
run: |
cat _build/prod/rel/ejabberd/logs/ejabberd.log
cat _build/prod/rel/ejabberd/logs/error.log
cat _build/dev/rel/ejabberd/logs/ejabberd.log
cat _build/dev/rel/ejabberd/logs/error.log
mix25:
name: Mix 25
strategy:
fail-fast: false
matrix:
otp: ['25.0-rc3']
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get specific Erlang/OTP
uses: ErlGang/setup-erlang@master
- name: Cache hex.pm
uses: actions/cache@v5
with:
otp-version: ${{ matrix.otp }}
path: |
~/.hex/
key: runtime-${{matrix.elixir}}-${{hashFiles('mix.*')}}
- name: Get Elixir
- name: Install Hex and Rebar3 manually on older Elixir
if: matrix.elixir < '1.15'
run: |
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb \
&& sudo dpkg -i erlang-solutions_2.0_all.deb
sudo apt-get update
sudo apt-get install elixir
mix local.hex --force
mix local.rebar --force
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=mix \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
mix deps.get
make
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: mix
- run: make hooks
- run: make options
- run: make xref
- run: make dialyzer
- run: make elvis
if: matrix.otp > '25'
- name: Test rel
run: |
make rel
_build/prod/rel/ejabberd/bin/ejabberdctl start \
&& _build/prod/rel/ejabberd/bin/ejabberdctl started
_build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost
_build/prod/rel/ejabberd/bin/ejabberdctl stop \
&& _build/prod/rel/ejabberd/bin/ejabberdctl stopped
cat _build/prod/rel/ejabberd/logs/*
- run: make edoc
- name: Test dev
run: |
make dev
_build/dev/rel/ejabberd/bin/ejabberdctl start \
&& _build/dev/rel/ejabberd/bin/ejabberdctl started
_build/dev/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost
_build/dev/rel/ejabberd/bin/ejabberdctl stop \
&& _build/dev/rel/ejabberd/bin/ejabberdctl stopped
cat _build/dev/rel/ejabberd/logs/*
- name: Production
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, register, stop, check, logs
username: user1
- name: Development
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, start, register, stop, check, logs
username: user2
- name: Installed
uses: ./.github/actions/manage-ejabberd
with:
for: install
do: deploy, start, register, stop, check, logs
username: user3
+177
View File
@@ -0,0 +1,177 @@
name: Weekly
on:
schedule:
- cron: '30 9 * * 0'
jobs:
############################################################### Compile #####
test:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['25', '26', '27', '28', '29.0-rc1']
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libexpat1-dev libgd-dev libpam0g-dev
libsqlite3-dev libwebp-dev libyaml-dev
- name: Compile
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: rebar3
configure: --disable-elixir --disable-mssql
########################################################## Static Tests #####
- name: Test shell scripts
run: |
shellcheck ejabberd.init.template
shellcheck -x ejabberdctl.template
shellcheck .vscode/relive.sh
shellcheck rel/setup-dev.sh
shellcheck rel/setup-relive.sh
shellcheck test/ejabberd_SUITE_data/gencerts.sh
shellcheck tools/captcha.sh
shellcheck tools/emacs-indent.sh
shellcheck tools/generate-doap.sh
shellcheck tools/prepare-tr.sh
shellcheck tools/rebar3-format.sh
- run: make hooks
- run: make options
- run: make xref
- run: make dialyzer
- run: make testeunit
- run: make elvis
if: matrix.otp > '25'
- run: make install -s
######################################################### Dynamic Tests #####
- name: Check production release
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, stop, check
- name: Start development release
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, no_tls, start, register
username: user123
- name: Stop development release
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: stop, check
- name: View production logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: logs
- name: View development logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: logs
##################################################### Common Test Suite #####
- name: Prepare database
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql, redis
do: install, start, user, create
- name: Setup multihost SQL schema
run: |
sed -i 's|new_schema, false|new_schema, true|g' test/suite.erl
- name: Run tests
id: ct
run: make test
- name: Send to coveralls
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DIAGNOSTIC=1 ./rebar3 as test coveralls send
- name: Check results
if: always() && (steps.ct.outcome != 'skipped')
id: ctresults
run: |
[[ -d _build ]] && ln -s _build/test/logs/last/ logs || true
ln `find logs/ -name suite.log` logs/suite.log
grep 'TEST COMPLETE' logs/suite.log
grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log
test $(find logs/ -empty -name error.log)
- name: View logs
if: always()
run: |
echo "::group::ejabberd.log"
find logs/ -name ejabberd.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::error.log"
find logs/ -name error.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::exunit.log"
find logs/ -name exunit.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::suite.log (only failures)"
cat logs/suite.log | awk \
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
echo "::endgroup::"
echo "::group::suite.log (complete)"
cat logs/suite.log
echo "::endgroup::"
- name: Upload CT logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: ct-logs-${{ matrix.otp }}
path: _build/test/logs
retention-days: 14
############################################################# Coveralls #####
cover:
needs: test
if: always()
runs-on: ubuntu-24.04-arm
steps:
- name: Finish parallel upload to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -v -k https://coveralls.io/webhook \
--header "Content-Type: application/json" \
--data '{"repo_name":"$GITHUB_REPOSITORY",
"repo_token":"$GITHUB_TOKEN",
"payload":{"build_num":$GITHUB_RUN_ID,
"status":"done"}}'
+9 -1
View File
@@ -5,8 +5,10 @@
\#*#
.#*
.edts
.tool-versions
*.dump
/Makefile
/doc
/config.log
/config.status
/config/releases.exs
@@ -15,6 +17,7 @@
/*.cache
/deps/
/.deps-update/
/.ejabberd-modules/
/ebin/
/ejabberd.init
/ejabberd.service
@@ -31,14 +34,19 @@
/priv/bin/captcha*sh
/priv/sql
/rel/ejabberd
/recompile.log
/_build
/database/
/.rebar
/rebar.lock
/log/
Mnesia.nonode@nohost/
/TAGS
/tags
# Binaries created with tools/make-{binaries,installers,packages}:
/ejabberd_*.deb
/ejabberd-*.rpm
/ejabberd-*.run
/ejabberd-*.tar.gz
/priv/mod_invites/static/bootstrap/
/priv/mod_invites/static/jquery/
/node_modules/
+5
View File
@@ -0,0 +1,5 @@
{
"recommendations": [
"erlang-ls.erlang-ls"
]
}
+66
View File
@@ -0,0 +1,66 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Relive (Vim)",
"type": "erlang",
"request": "launch",
"runinterminal": [
"./rebar3", "shell",
"--apps", "ejabberd",
"--config", "rel/relive.config",
"--script", "rel/relive.escript",
"--name", "ejabberd@localhost",
"--setcookie", "COOKIE"
],
"projectnode": "ejabberd@localhost",
"cookie": "COOKIE",
"timeout": 900,
"cwd": "."
},
{
"name": "Relive (VSCode)",
"type": "erlang",
"request": "launch",
"runinterminal": [
".vscode/relive.sh"
],
"projectnode": "ejabberd@localhost",
"cookie": "COOKIE",
"timeout": 300,
"cwd": "${workspaceRoot}"
},
{
"name": "Relive (alternate)",
"type": "erlang",
"request": "launch",
"runinterminal": [
"./rebar3", "shell",
"--apps", "ejabberd",
"--config", "rel/relive.config",
"--script", "rel/relive.escript",
"--name", "ejabberd@localhost",
"--setcookie", "COOKIE"
],
"projectnode": "ejabberd@localhost",
"cookie": "COOKIE",
"timeout": 300,
"cwd": "${workspaceRoot}"
},
{
"name": "Attach",
"type": "erlang",
"request": "attach",
"runinterminal": [
"./rebar3", "shell",
"--sname", "clean@localhost",
"--setcookie", "COOKIE",
"--start-clean"
],
"projectnode": "ejabberd@localhost",
"cookie": "COOKIE",
"timeout": 300,
"cwd": "${workspaceRoot}"
}
]
}
Vendored Executable
+6
View File
@@ -0,0 +1,6 @@
[ ! -f Makefile ] \
&& ./autogen.sh \
&& ./configure --with-rebar=rebar3 \
&& make
make relive
+13
View File
@@ -0,0 +1,13 @@
{
"editor.tabSize": 8,
"remote.portsAttributes": {
"1883": {"label": "MQTT", "onAutoForward": "silent"},
"4369": {"label": "EPMD", "onAutoForward": "silent"},
"5222": {"label": "XMPP C2S", "onAutoForward": "silent"},
"5223": {"label": "XMPP C2S (legacy)", "onAutoForward": "silent"},
"5269": {"label": "XMPP S2S", "onAutoForward": "silent"},
"5280": {"label": "HTTP", "onAutoForward": "silent"},
"5443": {"label": "HTTPS", "onAutoForward": "silent"},
"7777": {"label": "XMPP SOCKS5 (proxy65)", "onAutoForward": "silent"}
}
}
+1464 -72
View File
File diff suppressed because it is too large Load Diff
+19 -4
View File
@@ -22,6 +22,21 @@ Examples of unacceptable behavior by participants include:
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Guidelines for Respectful and Efficient Communication on Issues, Discussions, and PRs
To ensure that our maintainers can efficiently manage issues and provide timely updates, we kindly ask that all comments on GitHub tickets remain relevant to the topic of the issue. Please avoid posting comments solely to ping maintainers or ask for updates. If you need information on the status of an issue, consider the following:
- **Check the Issue Timeline:** Review the existing comments and updates on the issue before posting.
- **Use Reactions:** If you want to show that you are interested in an issue, use GitHub's reaction feature (e.g., thumbs up) instead of commenting.
- **Be Patient:** Understand that maintainers may be working on multiple tasks and will provide updates as soon as possible.
Additionally, please be aware that:
- **User Responses:** Users who report issues may no longer be using the software, may have switched to other projects, or may simply be busy. It is their right not to respond to follow-up questions or comments.
- **Maintainer Priorities:** Maintainers have the right to define their own priorities and schedule. They will address issues based on their availability and the project's needs.
By following these guidelines, you help us maintain a productive and respectful environment for everyone involved.
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
@@ -34,13 +49,13 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at conduct@process-one.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at the email address: conduct AT process-one.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://www.contributor-covenant.org/
[version]: https://www.contributor-covenant.org/version/1/4/
+20 -20
View File
@@ -7,7 +7,7 @@ from source code.
For a more detailed explanation, please check the
ejabberd Docs: [Source Code Installation][docs-source].
[docs-source]: https://docs.ejabberd.im/admin/installation/#source-code
[docs-source]: https://docs.ejabberd.im/admin/install/source/
Requirements
@@ -15,20 +15,20 @@ Requirements
To compile ejabberd you need:
- GNU Make
- GCC
- Libexpat ≥ 1.95
- Libyaml ≥ 0.1.4
- Erlang/OTP ≥ 19.3
- OpenSSL ≥ 1.0.0
- GNU Make
- GCC
- Libexpat ≥ 1.95
- Libyaml ≥ 0.1.4
- Erlang/OTP ≥ 25.0
- OpenSSL ≥ 1.0.0
Other optional libraries are:
- Zlib ≥ 1.2.3, for Stream Compression support (XEP-0138)
- PAM library, for Pluggable Authentication Modules (PAM)
- ImageMagick's Convert program and Ghostscript fonts, for CAPTCHA
challenges
- Elixir ≥ 1.10.3, to support Elixir, and alternative to rebar/rebar3
- Zlib ≥ 1.2.3, for Stream Compression support (XEP-0138)
- PAM library, for Pluggable Authentication Modules (PAM)
- ImageMagick's Convert program and Ghostscript fonts, for CAPTCHA
challenges
- Elixir ≥ 1.14.0, for Elixir support
If your system splits packages in libraries and development headers,
install the development packages too.
@@ -43,7 +43,7 @@ There are several ways to obtain the ejabberd source code:
- Source code package from [ejabberd GitHub Releases][ghr]
- Latest development code from [ejabberd Git repository][gitrepo]
[p1dl]: https://www.process-one.net/en/ejabberd/downloads/
[p1dl]: https://www.process-one.net/download/ejabberd/
[ghr]: https://github.com/processone/ejabberd/releases
[gitrepo]: https://github.com/processone/ejabberd
@@ -65,6 +65,11 @@ To configure the compilation, features, install paths...
./configure --help
The build tool automatically downloads and compiles the
erlang libraries that [ejabberd depends on][docs-repo].
[docs-repo]: https://docs.ejabberd.im/developer/repositories/
Install in the System
---------------------
@@ -89,13 +94,8 @@ Build an OTP Release
Instead of installing ejabberd in the system, you can build an OTP release
that includes all necessary to run ejabberd in a subdirectory:
./configure --with-rebar=rebar3
make rel
Or, if you have Elixir available and plan to develop Elixir code:
./configure --with-rebar=mix
make dev
./configure
make prod
Check the full list of targets:
+941 -93
View File
File diff suppressed because it is too large Load Diff
+27 -28
View File
@@ -3,21 +3,21 @@
We'd love for you to contribute to our source code and to make ejabberd even better than it is
today! Here are the guidelines we'd like you to follow:
* [Code of Conduct](#coc)
* [Questions and Problems](#question)
* [Issues and Bugs](#issue)
* [Feature Requests](#feature)
* [Issue Submission Guidelines](#submit)
* [Pull Request Submission Guidelines](#submit-pr)
* [Signing the CLA](#cla)
* [Code of Conduct](#code-of-conduct)
* [Questions and Problems](#questions-bugs-features)
* [Issues and Bugs](#found-an-issue-or-bug)
* [Feature Requests](#missing-a-feature)
* [Issue Submission Guidelines](#issue-submission-guidelines)
* [Pull Request Submission Guidelines](#pull-request-submission-guidelines)
* [Signing the CLA](#signing-the-contributor-license-agreement-cla)
## <a name="coc"></a> Code of Conduct
## Code of Conduct
Help us keep ejabberd community open-minded and inclusive. Please read and follow our [Code of Conduct][coc].
## <a name="requests"></a> Questions, Bugs, Features
## Questions, Bugs, Features
### <a name="question"></a> Got a Question or Problem?
### Got a Question or Problem?
Do not open issues for general support questions as we want to keep GitHub issues for bug reports
and feature requests. You've got much better chances of getting your question answered on dedicated
@@ -25,25 +25,25 @@ support platforms, the best being [Stack Overflow][stackoverflow].
Stack Overflow is a much better place to ask questions since:
- there are thousands of people willing to help on Stack Overflow
- questions and answers stay available for public viewing so your question / answer might help
* there are thousands of people willing to help on Stack Overflow
* questions and answers stay available for public viewing so your question / answer might help
someone else
- Stack Overflow's voting system assures that the best answers are prominently visible.
* Stack Overflow's voting system assures that the best answers are prominently visible.
To save your and our time, we will systematically close all issues that are requests for general
support and redirect people to the section you are reading right now.
Other channels for support are:
- [ejabberd Mailing List][list]
- [ejabberd XMPP room][muc]: ejabberd@conference.process-one.net
- [ejabberd XMPP room logs][logs]
### <a name="issue"></a> Found an Issue or Bug?
* ejabberd XMPP room: [ejabberd@conference.process-one.net][muc]
* [ejabberd Mailing List][list]
### Found an Issue or Bug?
If you find a bug in the source code, you can help us by submitting an issue to our
[GitHub Repository][github]. Even better, you can submit a Pull Request with a fix.
### <a name="feature"></a> Missing a Feature?
### Missing a Feature?
You can request a new feature by submitting an issue to our [GitHub Repository][github-issues].
@@ -52,9 +52,9 @@ If you would like to implement a new feature then consider what kind of change i
* **Major Changes** that you wish to contribute to the project should be discussed first in an
[GitHub issue][github-issues] that clearly outlines the changes and benefits of the feature.
* **Small Changes** can directly be crafted and submitted to the [GitHub Repository][github]
as a Pull Request. See the section about [Pull Request Submission Guidelines](#submit-pr).
as a Pull Request. See the section about [Pull Request Submission Guidelines](#pull-request-submission-guidelines).
## <a name="submit"></a> Issue Submission Guidelines
## Issue Submission Guidelines
Before you submit your issue search the archive, maybe your question was already answered.
@@ -64,7 +64,7 @@ the effort we can spend fixing issues and adding new features, by not reporting
The "[new issue][github-new-issue]" form contains a number of prompts that you should fill out to
make it easier to understand and categorize the issue.
## <a name="submit-pr"></a> Pull Request Submission Guidelines
## Pull Request Submission Guidelines
By submitting a pull request for a code or doc contribution, you need to have the right
to grant your contribution's copyright license to ProcessOne. Please check [ProcessOne CLA][cla]
@@ -80,6 +80,7 @@ Before you submit your pull request consider the following guidelines:
```shell
git checkout -b my-fix-branch master
```
* Test your changes and, if relevant, expand the automated test suite.
* Create your patch commit, including appropriate test cases.
* If the changes affect public APIs, change or add relevant [documentation][doc-repo].
@@ -88,6 +89,7 @@ Before you submit your pull request consider the following guidelines:
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Push your branch to GitHub:
@@ -123,28 +125,25 @@ restarted.
That's it! Thank you for your contribution!
## <a name="cla"></a> Signing the Contributor License Agreement (CLA)
## Signing the Contributor License Agreement (CLA)
Upon submitting a Pull Request, we will ask you to sign our CLA if you haven't done
so before. It's a quick process, we promise, and you will be able to do it all online
You can read [ProcessOne Contribution License Agreement][cla] in PDF.
Here's a link to the [ProcessOne Contribution License Agreement][cla].
This is part of the legal framework of the open-source ecosystem that adds some red tape,
but protects both the contributor and the company / foundation behind the project. It also
gives us the option to relicense the code with a more permissive license in the future.
[coc]: https://github.com/processone/ejabberd/blob/master/CODE_OF_CONDUCT.md
[stackoverflow]: https://stackoverflow.com/questions/tagged/ejabberd?sort=newest
[list]: https://lists.jabber.ru/mailman/listinfo/ejabberd
[list]: https://web.archive.org/web/20230319174915/http://lists.jabber.ru/mailman/listinfo/ejabberd
[muc]: xmpp:ejabberd@conference.process-one.net
[logs]: https://process-one.net/logs/ejabberd@conference.process-one.net/
[github]: https://github.com/processone/ejabberd
[github-issues]: https://github.com/processone/ejabberd/issues
[github-new-issue]: https://github.com/processone/ejabberd/issues/new
[github-pr]: https://github.com/processone/ejabberd/pulls
[doc-repo]: https://github.com/processone/docs.ejabberd.im
[developer-setup]: https://docs.ejabberd.im/developer/
[cla]: https://www.process-one.net/resources/ejabberd-cla.pdf
[license]: https://github.com/processone/ejabberd/blob/master/COPYING
[cla]: https://cla.process-one.net/
+1
View File
@@ -26,6 +26,7 @@ We would like to thanks official ejabberd source code contributors:
- Sonny Scroggin
- Alexey Shchepin
- Shelley Shyan
- Stefan Strigler
- Radoslaw Szymczyszyn
- Stu Tomlinson
- Christian Ulrich
+396 -153
View File
@@ -1,8 +1,26 @@
REBAR = @ESCRIPT@ @rebar@
#.
#' definitions
#
# Only required for Erlang/OTP 25
MAYBE=ERL_FLAGS="-enable-feature maybe_expr"
ESCRIPT = @ESCRIPT@
REBAR = $(MAYBE) @rebar@ # rebar|rebar3|mix binary (or path to binary)
REBAR3 = @REBAR3@ # path to rebar3 binary
MIX = @rebar@
AWK = @AWK@
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@
SED = @SED@
ERL = @ERL@
EPMD = @EPMD@
IEX = @IEX@
INSTALLUSER=@INSTALLUSER@
INSTALLGROUP=@INSTALLGROUP@
REBAR_ENABLE_ELIXIR = @elixir@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -10,27 +28,27 @@ exec_prefix = @exec_prefix@
DESTDIR =
# /etc/ejabberd/
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
ETCDIR = @sysconfdir@/ejabberd
# /bin/
BINDIR = $(DESTDIR)@bindir@
BINDIR = @bindir@
# /sbin/
SBINDIR = $(DESTDIR)@sbindir@
SBINDIR = @sbindir@
# /lib/
LIBDIR = $(DESTDIR)@libdir@
LIBDIR = @libdir@
# /lib/ejabberd/
EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
EJABBERDDIR = @libdir@/ejabberd
# /share/doc/ejabberd
PACKAGE_TARNAME = @PACKAGE_TARNAME@
datarootdir = @datarootdir@
DOCDIR = $(DESTDIR)@docdir@
DOCDIR = @docdir@
# /share/doc/man/man5
MANDIR = $(DESTDIR)@mandir@/man5
MANDIR = @mandir@/man5
# /usr/lib/ejabberd/ebin/
BEAMDIR = $(EJABBERDDIR)/ebin
@@ -66,12 +84,15 @@ SQLDIR = $(PRIVDIR)/sql
LUADIR = $(PRIVDIR)/lua
# /var/lib/ejabberd/
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
SPOOLDIR = @localstatedir@/lib/ejabberd
# /var/log/ejabberd/
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
LOGDIR = @localstatedir@/log/ejabberd
#.
#' install user
#
INSTALLUSER=@INSTALLUSER@
# if no user was enabled, don't set privileges or ownership
ifeq ($(INSTALLUSER),)
O_USER=
@@ -86,22 +107,26 @@ else
CHOWN_OUTPUT=&1
INIT_USER=$(INSTALLUSER)
endif
# if no group was enabled, don't set privileges or ownership
INSTALLGROUP=@INSTALLGROUP@
ifneq ($(INSTALLGROUP),)
G_USER=-g $(INSTALLGROUP)
endif
ifeq "$(MIX)" "mix"
#.
#' rebar / rebar3 / mix
#
ifeq "$(notdir $(MIX))" "mix"
REBAR_VER:=6
REBAR_VER_318:=0
else
REBAR_VER:=$(shell $(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}')
REBAR_VER_318:=$(shell $(REBAR) --version | awk -F '[ .]' '/rebar / {print ($$2 == 3 && $$3 >= 18 ? 1 : 0)}')
REBAR_VER:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print $$2}')
REBAR_VER_318:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print ($$2 == 3 && $$3 >= 18 ? 1 : 0)}')
endif
ifeq "$(REBAR_VER)" "6"
REBAR=$(MIX)
REBAR=$(MAYBE) $(MIX)
SKIPDEPS=
LISTDEPS=deps.tree
UPDATEDEPS=deps.update
@@ -109,13 +134,30 @@ ifeq "$(REBAR_VER)" "6"
DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/dev/lib
GET_DEPS= deps.get
CONFIGURE_DEPS=
CONFIGURE_DEPS=(cd deps/eimp; ./configure)
EBINDIR=$(DEPSDIR)/ejabberd/ebin
XREFOPTIONS=graph
EDOCPRE=MIX_ENV=edoc
EDOCTASK=docs --proglang erlang
CLEANARG=--deps
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
REBARREL=MIX_ENV=prod $(REBAR) release --overwrite
REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite
RELIVECMD=escript rel/relive.escript && MIX_ENV=dev RELIVE=true iex --name ejabberd@localhost -S mix run
RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(MAYBE) $(IEX) --name ejabberd@localhost -S mix run
RELIVECTLCMD=$(ESCRIPT) rel/relive.escript ctl && _build/relivectl/ejabberdctl live
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
COPY_REL_TARGET = dev
GET_DEPS_TRANSLATIONS=MIX_ENV=translations $(REBAR) $(GET_DEPS)
DEPSDIR_TRANSLATIONS=deps
else
ifeq ($(REBAR_ENABLE_ELIXIR),true)
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
EXPLICIT_ELIXIR_COMPILE=MIX_ENV=default mix compile.elixir
EXPLICIT_ELIXIR_COMPILE_DEV=MIX_ENV=dev mix compile.elixir
PREPARE_ELIXIR_SCRIPTS=$(MKDIR_P) rel/overlays; cp $(ELIXIR_LIBDIR_RAW)/../bin/iex rel/overlays/; cp $(ELIXIR_LIBDIR_RAW)/../bin/elixir rel/overlays/; sed -i 's|ERTS_BIN=$$|ERTS_BIN=$$SCRIPT_PATH/../../erts-{{erts_vsn}}/bin/|' rel/overlays/elixir
endif
ifeq "$(REBAR_VER)" "3"
SKIPDEPS=
LISTDEPS=tree
@@ -131,9 +173,15 @@ endif
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=$(DEPSDIR)/ejabberd/ebin
XREFOPTIONS=
CLEANARG=--all
REBARREL=$(REBAR) as prod tar
REBARDEV=REBAR_PROFILE=dev $(REBAR) release
RELIVECMD=$(REBAR) relive
REBARDEV=$(REBAR) as dev release
RELIVECMD=$(REBAR) as dev relive
RELIVECTLCMD=$(ESCRIPT) rel/relive.escript ctl && _build/relivectl/ejabberdctl live
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
COPY_REL_TARGET = dev
GET_DEPS_TRANSLATIONS=$(REBAR) as translations $(GET_DEPS)
DEPSDIR_TRANSLATIONS=_build/translations/lib
else
SKIPDEPS=skip_deps=true
LISTDEPS=-q list-deps
@@ -145,50 +193,109 @@ else
CONFIGURE_DEPS=$(REBAR) configure-deps
EBINDIR=ebin
XREFOPTIONS=
CLEANARG=
REBARREL=$(REBAR) generate
REBARDEV=
REBARDEV=@echo "Rebar2 detected... dev not supported.\
\nTry: make prod, or: ./configure --with-rebar=rebar3 ; make dev"
RELIVECMD=@echo "Rebar2 detected... relive not supported.\
\nTry: ./configure --with-rebar=./rebar3 ; make relive"
\nTry: ./configure --with-rebar=rebar3 ; make relive"
RELIVECTLCMD=@echo "Rebar2 detected... relivectl not supported.\
\nTry: ./configure --with-rebar=rebar3 ; make relivectl"
REL_LIB_DIR = rel/ejabberd/lib
COPY_REL_TARGET = rel
endif
endif
all: deps src
#.
#' main targets
#
deps: $(DEPSDIR)/.got
all: scripts deps src
deps: $(DEPSDIR)/.got invites-deps
$(DEPSDIR)/.got:
rm -rf $(DEPSDIR)/.got
rm -rf $(DEPSDIR)/.built
mkdir -p $(DEPSDIR)
$(MKDIR_P) $(DEPSDIR)
$(REBAR) $(GET_DEPS) && :> $(DEPSDIR)/.got
$(CONFIGURE_DEPS)
$(DEPSDIR)/.built: $(DEPSDIR)/.got
$(CONFIGURE_DEPS)
$(REBAR) compile && :> $(DEPSDIR)/.built
ifeq (, $(shell which npm))
INSTALL_INVITES_DEPS=tools/dl_invites_page_deps.sh priv/mod_invites/static
else
INSTALL_INVITES_DEPS=npm install
endif
invites-deps: priv/mod_invites/static/bootstrap/ priv/mod_invites/static/jquery/
priv/mod_invites/static/bootstrap/:
$(INSTALL_INVITES_DEPS)
priv/mod_invites/static/jquery/:
$(INSTALL_INVITES_DEPS)
src: $(DEPSDIR)/.built
$(REBAR) $(SKIPDEPS) compile
$(EXPLICIT_ELIXIR_COMPILE)
update:
rm -rf $(DEPSDIR)/.got
rm -rf $(DEPSDIR)/.built
$(REBAR) $(UPDATEDEPS) && :> $(DEPSDIR)/.got
$(CONFIGURE_DEPS)
xref: all
xref: src
$(REBAR) $(SKIPDEPS) xref $(XREFOPTIONS)
hooks: all
hooks: src
tools/hook_deps.sh $(EBINDIR)
options: all
options: src
tools/opt_types.sh ejabberd_option $(EBINDIR)
translations:
tools/prepare-tr.sh $(DEPSDIR)
$(GET_DEPS_TRANSLATIONS)
tools/prepare-tr.sh $(DEPSDIR_TRANSLATIONS)
edoc:
$(ERL) -noinput +B -eval \
'case edoc:application(ejabberd, ".", []) of ok -> halt(0); error -> halt(1) end.'
doap:
tools/generate-doap.sh
#.
#' edoc
#
edoc: edoc_files edoc_compile
$(EDOCPRE) $(REBAR) $(EDOCTASK)
edoc_compile: deps
$(EDOCPRE) $(REBAR) compile
edoc_files: _build/edoc/docs.md _build/edoc/logo.png
_build/edoc/docs.md: edoc_compile
echo "For much more detailed and complete ejabberd documentation, " \
"go to the [ejabberd Docs](https://docs.ejabberd.im/) site." \
> _build/edoc/docs.md
_build/edoc/logo.png: edoc_compile
wget https://docs.ejabberd.im/assets/img/footer_logo_e.png -O _build/edoc/logo.png
#.
#' format / indent
#
format:
tools/rebar3-format.sh $(REBAR3)
indent:
tools/emacs-indent.sh
#.
#' copy-files
#
JOIN_PATHS=$(if $(wordlist 2,1000,$(1)),$(firstword $(1))/$(call JOIN_PATHS,$(wordlist 2,1000,$(1))),$(1))
@@ -201,7 +308,7 @@ ELIXIR_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,$(word 2,$(1))) $(wordlist 5,1000,
DEPS_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,$(word 2,$(1))) $(wordlist 3,1000,$(1))
MAIN_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,ejabberd) $(1)
TO_DEST_SINGLE=$(if $(subst X$(DEPSBASE)X,,X$(word 1,$(1))X),$(call MAIN_TO_DEST,$(1)),$(if $(subst XlibX,,X$(word $(LIBIX),$(1))X),$(call DEPS_TO_DEST,$(wordlist $(DEPIX),1000,$(1))),$(call ELIXIR_TO_DEST,$(wordlist $(DEPIX),1000,$(1)))))
TO_DEST=$(foreach path,$(1),$(call JOIN_PATHS,$(call TO_DEST_SINGLE,$(subst /, ,$(path)))))
TO_DEST=$(foreach path,$(1),$(call JOIN_PATHS,$(DESTDIR)$(call TO_DEST_SINGLE,$(subst /, ,$(path)))))
FILTER_DIRS=$(foreach path,$(1),$(if $(wildcard $(path)/*),,$(path)))
FILES_WILDCARD=$(call FILTER_DIRS,$(foreach w,$(1),$(wildcard $(w))))
@@ -217,8 +324,9 @@ BINARIES=$(DEPSDIR)/epam/priv/bin/epam $(DEPSDIR)/eimp/priv/bin/eimp $(DEPSDIR)/
DEPS_FILES_FILTERED=$(filter-out $(BINARIES) $(DEPSDIR)/elixir/ebin/elixir.app,$(DEPS_FILES))
DEPS_DIRS=$(sort $(DEPSDIR)/ $(foreach DEP,$(DEPS),$(DEPSDIR)/$(DEP)/) $(dir $(DEPS_FILES)))
MAIN_FILES=$(filter-out %/configure.beam,$(call FILES_WILDCARD,$(EBINDIR)/*.beam $(EBINDIR)/*.app priv/msgs/*.msg priv/css/*.css priv/img/*.png priv/js/*.js priv/lib/* include/*.hrl COPYING))
MAIN_DIRS=$(sort $(dir $(MAIN_FILES)) priv/bin priv/sql priv/lua)
MAIN_FILES=$(filter-out %/configure.beam,$(call FILES_WILDCARD,$(EBINDIR)/*.beam $(EBINDIR)/*.app priv/msgs/*.msg priv/css/*.css priv/img/*.png priv/js/*.js priv/lib/* priv/mod_invites/* priv/mod_invites/static/* priv/mod_invites/static/bootstrap/css/bootstrap.min.css priv/mod_invites/static/bootstrap/js/bootstrap.min.js priv/mod_invites/static/jquery/jquery.min.js \
priv/mod_invites/static/logos/* include/*.hrl COPYING))
MAIN_DIRS=$(sort $(dir $(MAIN_FILES)) priv/bin priv/sql priv/lua priv/mod_invites)
define DEP_VERSION_template
DEP_$(1)_VERSION:=$(shell $(SED) -e '/vsn/!d;s/.*, *"/$(1)-/;s/".*//' $(2) 2>/dev/null)
@@ -242,7 +350,7 @@ $(foreach file,$(DEPS_FILES_FILTERED) $(MAIN_FILES),$(eval $(call COPY_template,
$(foreach file,$(BINARIES),$(eval $(call COPY_BINARY_template,$(file))))
$(sort $(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS))):
$(INSTALL) -d $@
$(INSTALL) -d $@
$(call TO_DEST,priv/sql/lite.sql): sql/lite.sql $(call TO_DEST,priv/sql)
$(INSTALL) -m 644 $< $@
@@ -275,169 +383,254 @@ copy-files:
copy-files-sub: copy-files-sub2
#.
#' copy-files-rel
#
copy-files-rel: $(COPY_REL_TARGET)
#
# Libraries
(cd $(REL_LIB_DIR) && find . -follow -type f ! -executable -exec $(INSTALL) -vDm 640 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
#
# *.so:
(cd $(REL_LIB_DIR) && find . -follow -type f -executable -name *.so -exec $(INSTALL) -vDm 640 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
#
# Executable files
(cd $(REL_LIB_DIR) && find . -follow -type f -executable ! -name *.so -exec $(INSTALL) -vDm 550 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
#.
#' uninstall-librel
#
uninstall-librel:
(cd $(REL_LIB_DIR) && find . -follow -type f -exec rm -fv -v $(DESTDIR)$(LIBDIR)/{} \;)
(cd $(REL_LIB_DIR) && find . -follow -depth -type d -exec rm -dv -v $(DESTDIR)$(LIBDIR)/{} \;)
#.
#' relive
#
relive:
$(EXPLICIT_ELIXIR_COMPILE_DEV)
$(RELIVECMD)
relivectl:
$(EXPLICIT_ELIXIR_COMPILE_DEV)
$(RELIVECTLCMD)
relivelibdir=$(shell pwd)/$(DEPSDIR)
relivedir=$(shell pwd)/_build/relive
iexpath=$(shell which iex)
CONFIG_DIR = ${relivedir}/conf
SPOOL_DIR = ${relivedir}/database
LOGS_DIR = ${relivedir}/logs
relivebase=$(shell pwd)/$(DEPSBASE)
ejabberdctl.relive:
$(SED) -e "s*{{installuser}}*@INSTALLUSER@*g" \
-e "s*{{config_dir}}*${CONFIG_DIR}*g" \
-e "s*{{logs_dir}}*${LOGS_DIR}*g" \
-e "s*{{spool_dir}}*${SPOOL_DIR}*g" \
-e "s*{{bindir}}/iex*$(iexpath)*g" \
-e "s*{{bindir}}*@bindir@*g" \
-e "s*{{libdir}}*${relivelibdir}*g" \
-e "s*{{erl}}*@ERL@*g" \
-e "s*{{epmd}}*@EPMD@*g" ejabberdctl.template \
> ejabberdctl.relive
#.
#' scripts
#
ejabberdctl.example: vars.config
$(SED) -e "s*{{installuser}}*@INSTALLUSER@*g" \
-e "s*{{config_dir}}*${ETCDIR}*g" \
-e "s*{{logs_dir}}*${LOGDIR}*g" \
-e "s*{{spool_dir}}*${SPOOLDIR}*g" \
-e "s*{{bindir}}*@bindir@*g" \
-e "s*{{libdir}}*@libdir@*g" \
-e "s*{{erl}}*@ERL@*g" \
-e "s*{{epmd}}*@EPMD@*g" ejabberdctl.template \
> ejabberdctl.example
# Used for ejabberdctl.relive and ejabberdctl.relivectl
ejabberdctl.re%:
$(SED) -e "s*{{installuser}}*${INSTALLUSER}*g" \
-e "s*{{config_dir}}*${relivebase}/re${*}/conf*g" \
-e "s*{{logs_dir}}*${relivebase}/re${*}/logs*g" \
-e "s*{{spool_dir}}*${relivebase}/re${*}/database*g" \
-e "s*{{bindir}}*${BINDIR}*g" \
-e "s*{{libdir}}*${relivelibdir}${ELIXIR_LIBDIR}*g" \
-e "s*ERTS_VSN*# ERTS_VSN*g" \
-e "s*{{iexpath}}*${IEX}*g" \
-e "s*{{erl}}*${ERL}*g" \
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \
> ejabberdctl.re${*}
install: copy-files ejabberdctl.example
#
# Configuration files
$(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
[ -f $(ETCDIR)/ejabberd.yml ] \
&& $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
|| $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
[ -f $(ETCDIR)/ejabberdctl.cfg ] \
&& $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
|| $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
$(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
#
# Administration script
[ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
$(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
# Elixir binaries
[ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
[ -f $(DEPSDIR)/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/iex $(BINDIR)/iex || true
[ -f $(DEPSDIR)/elixir/bin/elixir ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/elixir $(BINDIR)/elixir || true
[ -f $(DEPSDIR)/elixir/bin/mix ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/mix $(BINDIR)/mix || true
#
# Init script
ejabberd.init:
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
-e "s*@installuser@*$(INIT_USER)*g" ejabberd.init.template \
> ejabberd.init
chmod 755 ejabberd.init
#
# Service script
ejabberd.service:
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
-e "s*@installuser@*$(INIT_USER)*g" ejabberd.service.template \
> ejabberd.service
chmod 644 ejabberd.service
ejabberdctl.example: vars.config
$(SED) -e "s*{{installuser}}*${INSTALLUSER}*g" \
-e "s*{{config_dir}}*${ETCDIR}*g" \
-e "s*{{logs_dir}}*${LOGDIR}*g" \
-e "s*{{spool_dir}}*${SPOOLDIR}*g" \
-e "s*{{bindir}}*${BINDIR}*g" \
-e "s*{{libdir}}*${LIBDIR}${ELIXIR_LIBDIR}*g" \
-e "s*ERTS_VSN*# ERTS_VSN*g" \
-e "s*{{iexpath}}*${IEX}*g" \
-e "s*{{erl}}*${ERL}*g" \
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \
> ejabberdctl.example
scripts: ejabberd.init ejabberd.service ejabberdctl.example
#.
#' install
#
install: copy-files install-main
install-rel: copy-files-rel install-main
install-main:
#
# Configuration files
$(INSTALL) -d -m 750 $(G_USER) $(DESTDIR)$(ETCDIR)
[ -f $(DESTDIR)$(ETCDIR)/ejabberd.yml ] \
&& $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(DESTDIR)$(ETCDIR)/ejabberd.yml-new \
|| $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(DESTDIR)$(ETCDIR)/ejabberd.yml
[ -f $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg ] \
&& $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg-new \
|| $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg
$(INSTALL) -b -m 644 $(G_USER) inetrc $(DESTDIR)$(ETCDIR)/inetrc
#
# Administration script
[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(SBINDIR)
$(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(DESTDIR)$(SBINDIR)/ejabberdctl
# Elixir binaries
[ -d $(DESTDIR)$(BINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)
[ -f $(DEPSDIR)/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/iex $(DESTDIR)$(BINDIR)/iex || true
[ -f $(DEPSDIR)/elixir/bin/elixir ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/elixir $(DESTDIR)$(BINDIR)/elixir || true
[ -f $(DEPSDIR)/elixir/bin/mix ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/mix $(DESTDIR)$(BINDIR)/mix || true
#
# Spool directory
$(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(SPOOLDIR)
$(INSTALL) -d -m 750 $(O_USER) $(DESTDIR)$(SPOOLDIR)
$(CHOWN_COMMAND) -R $(INSTALLUSER) $(DESTDIR)$(SPOOLDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(DESTDIR)$(SPOOLDIR)
#
# Log directory
$(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(LOGDIR)
$(INSTALL) -d -m 750 $(O_USER) $(DESTDIR)$(LOGDIR)
$(CHOWN_COMMAND) -R $(INSTALLUSER) $(DESTDIR)$(LOGDIR) >$(CHOWN_OUTPUT)
chmod -R 750 $(DESTDIR)$(LOGDIR)
#
# Documentation
$(INSTALL) -d $(MANDIR)
$(INSTALL) -d $(DOCDIR)
$(INSTALL) -d $(DESTDIR)$(MANDIR)
$(INSTALL) -d $(DESTDIR)$(DOCDIR)
[ -f man/ejabberd.yml.5 ] \
&& $(INSTALL) -m 644 man/ejabberd.yml.5 $(MANDIR) \
&& $(INSTALL) -m 644 man/ejabberd.yml.5 $(DESTDIR)$(MANDIR) \
|| echo "Man page not included in sources"
$(INSTALL) -m 644 COPYING $(DOCDIR)
$(INSTALL) -m 644 COPYING $(DESTDIR)$(DOCDIR)
#.
#' uninstall
#
uninstall: uninstall-binary
uninstall-rel: uninstall-binary uninstall-librel
uninstall-binary:
rm -f $(SBINDIR)/ejabberdctl
rm -f $(BINDIR)/iex
rm -f $(BINDIR)/elixir
rm -f $(BINDIR)/mix
rm -fr $(DOCDIR)
rm -f $(BEAMDIR)/*.beam
rm -f $(BEAMDIR)/*.app
rm -fr $(BEAMDIR)
rm -f $(INCLUDEDIR)/*.hrl
rm -fr $(INCLUDEDIR)
rm -fr $(PBINDIR)
rm -f $(SODIR)/*.so
rm -fr $(SODIR)
rm -f $(MSGSDIR)/*.msg
rm -fr $(MSGSDIR)
rm -f $(CSSDIR)/*.css
rm -fr $(CSSDIR)
rm -f $(IMGDIR)/*.png
rm -fr $(IMGDIR)
rm -f $(JSDIR)/*.js
rm -fr $(JSDIR)
rm -f $(SQLDIR)/*.sql
rm -fr $(SQLDIR)
rm -fr $(LUADIR)/*.lua
rm -fr $(LUADIR)
rm -fr $(PRIVDIR)
rm -fr $(EJABBERDDIR)
rm -f $(DESTDIR)$(SBINDIR)/ejabberdctl
rm -f $(DESTDIR)$(BINDIR)/iex
rm -f $(DESTDIR)$(BINDIR)/elixir
rm -f $(DESTDIR)$(BINDIR)/mix
rm -fr $(DESTDIR)$(DOCDIR)
rm -f $(DESTDIR)$(BEAMDIR)/*.beam
rm -f $(DESTDIR)$(BEAMDIR)/*.app
rm -fr $(DESTDIR)$(BEAMDIR)
rm -f $(DESTDIR)$(INCLUDEDIR)/*.hrl
rm -fr $(DESTDIR)$(INCLUDEDIR)
rm -fr $(DESTDIR)$(PBINDIR)
rm -f $(DESTDIR)$(SODIR)/*.so
rm -fr $(DESTDIR)$(SODIR)
rm -f $(DESTDIR)$(MSGSDIR)/*.msg
rm -fr $(DESTDIR)$(MSGSDIR)
rm -f $(DESTDIR)$(CSSDIR)/*.css
rm -fr $(DESTDIR)$(CSSDIR)
rm -f $(DESTDIR)$(IMGDIR)/*.png
rm -fr $(DESTDIR)$(IMGDIR)
rm -f $(DESTDIR)$(JSDIR)/*.js
rm -fr $(DESTDIR)$(JSDIR)
rm -f $(DESTDIR)$(SQLDIR)/*.sql
rm -fr $(DESTDIR)$(SQLDIR)
rm -fr $(DESTDIR)$(LUADIR)/*.lua
rm -fr $(DESTDIR)$(LUADIR)
rm -fr $(DESTDIR)$(PRIVDIR)
rm -fr $(DESTDIR)$(EJABBERDDIR)
rm -f $(DESTDIR)$(MANDIR)/ejabberd.yml.5
uninstall-all: uninstall-binary
rm -rf $(ETCDIR)
rm -rf $(EJABBERDDIR)
rm -rf $(SPOOLDIR)
rm -rf $(LOGDIR)
rm -rf $(DESTDIR)$(ETCDIR)
rm -rf $(DESTDIR)$(EJABBERDDIR)
rm -rf $(DESTDIR)$(SPOOLDIR)
rm -rf $(DESTDIR)$(LOGDIR)
#.
#' clean
#
clean:
rm -rf $(DEPSDIR)/.got
rm -rf $(DEPSDIR)/.built
rm -rf test/*.beam
$(REBAR) clean
rm -f rebar.lock
rm -f ejabberdctl.example ejabberd.init ejabberd.service
rm -rf priv/mod_invites/static/{jquery,bootstrap4}
$(REBAR) clean $(CLEANARG)
clean-rel:
rm -rf rel/ejabberd
distclean: clean clean-rel
rm -f aclocal.m4
rm -f config.status
rm -f config.log
rm -rf autom4te.cache
rm -rf $(EBINDIR)
rm -rf $(DEPSBASE)
rm -rf deps
rm -f Makefile
rm -f vars.config
rm -f src/ejabberd.app.src
rm -f ejabberdctl.example ejabberd.init ejabberd.service
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog
rel:
#.
#' releases
#
rel: prod
prod:
$(PREPARE_ELIXIR_SCRIPTS)
$(REBARREL)
DEV_CONFIG = _build/dev/rel/ejabberd/conf/ejabberd.yml
dev $(DEV_CONFIG):
$(PREPARE_ELIXIR_SCRIPTS)
$(REBARDEV)
#.
#' tags
#
TAGS:
etags *.erl
etags src/*.erl
#.
#' makefile
#
Makefile: Makefile.in
ifeq "$(REBAR_VER)" "3"
#.
#' dialyzer
#
ifeq "$(REBAR_VER)" "6" # Mix
dialyzer:
MIX_ENV=test $(REBAR) dialyzer
else
ifeq "$(REBAR_VER)" "3" # Rebar3
dialyzer:
$(REBAR) dialyzer
else
else # Rebar2
deps := $(wildcard $(DEPSDIR)/*/ebin)
dialyzer/erlang.plt:
@mkdir -p dialyzer
@$(MKDIR_P) dialyzer
@dialyzer --build_plt --output_plt dialyzer/erlang.plt \
-o dialyzer/erlang.log --apps kernel stdlib sasl crypto \
public_key ssl mnesia inets odbc compiler erts \
@@ -445,13 +638,13 @@ dialyzer/erlang.plt:
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
dialyzer/deps.plt:
@mkdir -p dialyzer
@$(MKDIR_P) dialyzer
@dialyzer --build_plt --output_plt dialyzer/deps.plt \
-o dialyzer/deps.log $(deps); \
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
dialyzer/ejabberd.plt:
@mkdir -p dialyzer
@$(MKDIR_P) dialyzer
@dialyzer --build_plt --output_plt dialyzer/ejabberd.plt \
-o dialyzer/ejabberd.log ebin; \
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
@@ -473,6 +666,18 @@ dialyzer: erlang_plt deps_plt ejabberd_plt
--get_warnings -o dialyzer/error.log ebin; \
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
endif
endif
#.
#' elvis
#
elvis:
$(REBAR) lint
#.
#' test
#
test:
@echo "************************** NOTICE ***************************************"
@@ -481,33 +686,71 @@ test:
@cd priv && ln -sf ../sql
$(REBAR) $(SKIPDEPS) ct
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
install uninstall uninstall-binary uninstall-all translations deps test \
quicktest erlang_plt deps_plt ejabberd_plt xref hooks options
.PHONY: test-%
define test-group-target
test-$1:
$(REBAR) $(SKIPDEPS) ct --suite=test/ejabberd_SUITE --group=$1
endef
ifneq ($(filter test-%,$(MAKECMDGOALS)),)
group_to_test := $(patsubst test-%,%,$(filter test-%,$(MAKECMDGOALS)))
$(eval $(call test-group-target,$(group_to_test)))
endif
testeunit:
$(REBAR) $(SKIPDEPS) eunit --verbose
#.
#' phony
#
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean prod rel \
install uninstall uninstall-binary uninstall-all translations deps test testeunit \
all dev doap help install-rel relive scripts uninstall-rel update \
erlang_plt deps_plt ejabberd_plt xref hooks options format indent
#.
#' help
#
help:
@echo ""
@echo " [all] Compile dependencies and ejabberd"
@echo " src Compile ejabberd"
@echo " deps Get dependencies"
@echo " update Update dependencies' source code"
@echo " [all] "
@echo " scripts Prepare ejabberd start scripts"
@echo " deps Get and configure dependencies"
@echo " src Compile dependencies and ejabberd"
@echo " update Update dependencies source code"
@echo " clean Clean binary files"
@echo " distclean Clean completely the development files"
@echo ""
@echo " install Install ejabberd to /usr/local"
@echo " install-rel Install ejabberd to /usr/local (using release)"
@echo " uninstall Uninstall ejabberd (buggy)"
@echo " uninstall-rel Uninstall ejabberd (using release)"
@echo " uninstall-all Uninstall also configuration, logs, mnesia... (buggy)"
@echo ""
@echo " rel Build a production release"
@echo " prod Build a production release"
@echo " dev Build a development release"
@echo " relive Start a live ejabberd in _build/relive/"
@echo " relive Start live using rebar3/mix tools"
@echo " relivectl Start live using ejabberdctl script"
@echo ""
@echo " edoc Generate edoc documentation (unused)"
@echo " doap Generate DOAP file"
@echo " edoc Generate EDoc documentation [mix]"
@echo " options Generate ejabberd_option.erl"
@echo " translations Extract translation files (requires --enable-tools)"
@echo " tags Generate tags file for text editors"
@echo " translations Extract translation files"
@echo " TAGS Generate tags file for text editors"
@echo ""
@echo " format Format source code using rebar3_format"
@echo " indent Indent source code using erlang-mode [emacs]"
@echo ""
@echo " dialyzer Run Dialyzer static analyzer"
@echo " elvis Run Elvis source code style reviewer [rebar3]"
@echo " hooks Run hooks validator"
@echo " test Run Common Tests suite"
@echo " xref Run cross reference analysis"
@echo " test Run Common Tests suite [rebar3]"
@echo " testeunit Run EUnit suite [rebar3]"
@echo " test-<group> Run Common Test suite for specific group only [rebar3]"
@echo " xref Run cross reference analysis [rebar3]"
#.
#'
# vim: foldmarker=#',#. foldmethod=marker:
+40 -32
View File
@@ -1,36 +1,36 @@
<p align="center">
<img src="https://www.process-one.net/wp-content/uploads/2022/05/ejabberd-logo-rounded-index.png"
height="216">
<img src="https://www.process-one.net/wp-content/uploads/2022/05/ejabberd-logo-rounded-index.png">
</p>
<p align="center">
<a href="https://github.com/processone/ejabberd/tags" alt="GitHub tag (latest SemVer)">
<img src="https://img.shields.io/github/v/tag/processone/ejabberd?sort=semver&logo=embarcadero&label=&color=3fb0d2&logoWidth=20" /></a>
<a href="https://hex.pm/packages/ejabberd" alt="Hex version">
<img src="https://img.shields.io/hexpm/v/ejabberd.svg" /></a>
<a href="https://github.com/processone/ejabberd/pkgs/container/ejabberd" alt="GitHub Container">
<img src="https://img.shields.io/github/v/tag/processone/ejabberd?label=container&sort=semver" /></a>
<a href="https://hub.docker.com/r/ejabberd/ecs/" alt="Docker Image Version (latest semver)">
<img src="https://img.shields.io/docker/v/ejabberd/ecs?label=docker" /></a>
<a href="https://formulae.brew.sh/formula/ejabberd" alt="homebrew version">
<img src="https://img.shields.io/homebrew/v/ejabberd" /></a>
<a href="https://hub.docker.com/r/ejabberd/ecs/" alt="Docker Image Version (latest semver)">
<img src="https://img.shields.io/docker/v/ejabberd/ecs?label=ecs&logo=docker" /></a>
<a href="https://github.com/processone/ejabberd/pkgs/container/ejabberd" alt="GitHub Container">
<img src="https://img.shields.io/github/v/tag/processone/ejabberd?label=ejabberd&sort=semver&logo=docker" /></a>
<br />
<a href="https://github.com/processone/ejabberd/actions/workflows/ci.yml" alt="CI">
<img src="https://github.com/processone/ejabberd/actions/workflows/ci.yml/badge.svg" /></a>
<a href="https://coveralls.io/github/processone/ejabberd?branch=master" alt="Coverage Status">
<img src="https://coveralls.io/repos/github/processone/ejabberd/badge.svg?branch=master "Coverage in coveralls.io"" /></a>
<img src="https://coveralls.io/repos/github/processone/ejabberd/badge.svg?branch=master" /></a>
<a href="https://hosted.weblate.org/projects/ejabberd/ejabberd-po/" alt="Translation status">
<img src="https://hosted.weblate.org/widgets/ejabberd/-/ejabberd-po/svg-badge.svg"" /></a>
<img src="https://hosted.weblate.org/widgets/ejabberd/-/ejabberd-po/svg-badge.svg" /></a>
<a href="https://docs.ejabberd.im/" alt="ejabberd Docs">
<img src="https://img.shields.io/github/v/tag/processone/docs.ejabberd.im?sort=semver&logo=&label=docs&logoWidth=0" /></a>
</p>
[ejabberd][im] is an open-source,
robust, scalable and extensible realtime platform built using [Erlang/OTP][erlang],
that includes [XMPP][xmpp] Server, [MQTT][mqtt] Broker and [SIP][sip] Service.
Check the features in [ejabberd.im][im], [ejabberd Docs][features],
[ejabberd at ProcessOne][p1home], and a list of [supported protocols and XEPs][xeps].
[ejabberd at ProcessOne][p1home], and the list of [supported protocols in ProcessOne][xeps]
and [XMPP.org][xmppej].
Installation
------------
@@ -38,13 +38,16 @@ Installation
There are several ways to install ejabberd:
- Source code: compile yourself, see [COMPILE](COMPILE.md)
- Installers from [ProcessOne Downloads][p1dl] (run/deb/rpm for x64)
- Installers from [ejabberd GitHub Releases][releases] (run/deb/rpm for x64 and arm64)
- Container image from [ejabberd Docker Hub][hubecs], see [ecs README][docker-ecs-readme] (for x64)
- Container image from [ejabberd Github Packages][packages], see [CONTAINER](CONTAINER.md) (for x64 and arm64)
- Installers:
- [ProcessOne Download Page][p1download] or [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`)
- Docker Containers:
- `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
More info can be found in the `Installation` part of [ejabberd Docs](https://docs.ejabberd.im/admin/install/).
Documentation
-------------
@@ -61,7 +64,6 @@ Once ejabberd is installed, try:
ejabberdctl help
man ejabberd.yml
Development
-----------
@@ -73,31 +75,37 @@ 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
please send an email to the address: contact at process-one dot net
or some other method from [ProcessOne Contact][p1contact].
For commercial offering and support, including [ejabberd Business Edition][p1home]
and [Fluux (ejabberd in the Cloud)][fluux], please check [ProcessOne ejabberd page][p1home].
Security
--------
For information on how to report security vulnerabilities, please refer to the [SECURITY.md](SECURITY.md) file. It contains guidelines on how to report vulnerabilities privately and securely, ensuring that any issues are addressed in a timely and confidential manner.
Community
---------
There are several places to get in touch with other ejabberd developers and administrators:
- [ejabberd XMPP chatroom][muc]: ejabberd@conference.process-one.net
- [Mailing list][list]
- ejabberd XMPP chatroom: [ejabberd@conference.process-one.net][muc]
- [GitHub Discussions][discussions]
- [Stack Overflow][stackoverflow]
License
-------
ejabberd is released under the GNU General Public License v2 (see [COPYING](COPYING.md)),
and [ejabberd translations](https://github.com/processone/ejabberd-po/) under MIT License.
- ejabberd is released under the __GNU General Public License v2__ (see [COPYING](COPYING))
- [ejabberd translations](https://github.com/processone/ejabberd-po/) under __MIT License__.
[discussions]: https://github.com/processone/ejabberd/discussions
[docker-ecs-readme]: https://github.com/processone/docker-ejabberd/tree/master/ecs#readme
@@ -106,23 +114,23 @@ and [ejabberd translations](https://github.com/processone/ejabberd-po/) under MI
[erlang]: https://www.erlang.org/
[features]: https://docs.ejabberd.im/admin/introduction/
[fluux]: https://fluux.io/
[github]: https://github.com/processone/ejabberd
[homebrew]: https://docs.ejabberd.im/admin/installation/#homebrew
[homebrew]: https://docs.ejabberd.im/admin/install/homebrew/
[hubecs]: https://hub.docker.com/r/ejabberd/ecs/
[im]: https://ejabberd.im/
[im]: https://www.ejabberd.im/
[issues]: https://github.com/processone/ejabberd/issues
[list]: https://lists.jabber.ru/mailman/listinfo/ejabberd
[localization]: https://docs.ejabberd.im/developer/extending-ejabberd/localization/
[mqtt]: https://mqtt.org/
[muc]: xmpp:ejabberd@conference.process-one.net
[osp]: https://docs.ejabberd.im/admin/installation/#operating-system-packages
[p1contact]: https://www.process-one.net/en/company/contact/
[p1dl]: https://www.process-one.net/en/ejabberd/downloads/
[p1home]: https://www.process-one.net/en/ejabberd/
[osp]: https://docs.ejabberd.im/admin/install/os-package/
[p1contact]: https://www.process-one.net/contact/
[p1download]: https://www.process-one.net/download/ejabberd/
[p1home]: https://www.process-one.net/ejabberd/
[packages]: https://github.com/processone/ejabberd/pkgs/container/ejabberd
[packagesecs]: https://github.com/processone/docker-ejabberd/pkgs/container/ecs
[releases]: https://github.com/processone/ejabberd/releases
[sip]: https://en.wikipedia.org/wiki/Session_Initiation_Protocol
[stackoverflow]: https://stackoverflow.com/questions/tagged/ejabberd?sort=newest
[weblate]: https://hosted.weblate.org/projects/ejabberd/ejabberd-po/
[xeps]: https://www.process-one.net/en/ejabberd/protocols/
[xeps]: https://www.process-one.net/ejabberd-features/
[xmpp]: https://xmpp.org/
[xmppej]: https://xmpp.org/software/servers/ejabberd/
+45
View File
@@ -0,0 +1,45 @@
# Security Policy
## Supported Versions
We recommend that all users always use the latest version of ejabberd.
To ensure the best experience and security, upgrade to the latest version available on [this repo](https://github.com/processone/ejabberd).
## Reporting a Vulnerability
### Private Reporting
**Preferred Method**: Use GitHub's private vulnerability reporting system by clicking the "Report a Vulnerability" button in the [Security tab of this repository](https://github.com/processone/ejabberd/security). This ensures your report is securely transmitted and tracked.
**Alternative**: If you cannot use the GitHub system, send an email to **`contact@process-one.net`** with the following details:
- A clear description of the vulnerability.
- Steps to reproduce the issue.
- Any potential impact or exploitation scenarios.
### Response Time
We aim to acknowledge receipt of your report within 72 hours. You can expect regular updates on the status of your report.
### Resolution
If the vulnerability is confirmed, we will work on a patch or mitigation strategy.
We will notify you once the issue is resolved and coordinate a public disclosure if needed.
### Acknowledgements
We value and appreciate the contributions of security researchers and community members.
If you wish, we are happy to acknowledge your efforts publicly by listing your name (or alias) below in this document.
Please let us know if you would like to be recognized when reporting the vulnerability.
## Public Discussion
For general inquiries or discussions about the projects security, feel free to chat with us here:
- XMPP room: `ejabberd@conference.process-one.net`
- [GitHub Discussions](https://github.com/processone/ejabberd/discussions)
However, please note that if the issue is **critical** or potentially exploitable, **do not share it publicly**. Instead, we strongly recommend you contact the maintainers directly via the private reporting methods outlined above to ensure a secure and timely response.
Thank you for helping us improve the security of ejabberd!
+4 -2
View File
@@ -8,6 +8,8 @@ end
rootpath = System.get_env("RELEASE_ROOT", rootdefault)
config :ejabberd,
file: Path.join(rootpath, "conf/ejabberd.yml"),
log_path: Path.join(rootpath, 'logs/ejabberd.log')
log_path: Path.join(rootpath, "logs/ejabberd.log")
config :mnesia,
dir: Path.join(rootpath, 'database/')
dir: Path.join(rootpath, "database/")
config :exsync,
reload_callback: {:ejabberd_admin, :update, []}
+82 -14
View File
@@ -2,15 +2,26 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(ejabberd, m4_esyscmd([echo `git describe --tags 2>/dev/null || echo 22.05` | sed 's/-g.*//;s/-/./' | tr -d '\012']), [ejabberd@process-one.net], [ejabberd])
REQUIRE_ERLANG_MIN="8.3 (Erlang/OTP 19.3)"
AC_INIT(ejabberd, m4_esyscmd([echo `git describe --tags 2>/dev/null || echo 26.03` | sed 's/-g.*//;s/-/./' | tr -d '\012']), [ejabberd@process-one.net], [ejabberd])
AC_ARG_WITH(min-erlang,
AS_HELP_STRING([--with-min-erlang=version],[set minimal required erlang version, default to OTP25]),
[if test "X$withval" = "X"; then
REQUIRE_ERLANG_MIN="13.0 (Erlang/OTP 25.0)"
else
REQUIRE_ERLANG_MIN="$withval"
fi
], [REQUIRE_ERLANG_MIN="13.0 (Erlang/OTP 25.0)"])
REQUIRE_ERLANG_MAX="100.0.0 (No Max)"
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_SED
if test "x$GCC" = "xyes"; then
@@ -28,18 +39,42 @@ fi
])
AC_ARG_WITH(rebar,
AS_HELP_STRING([--with-rebar=bin],[use the rebar/rebar3/mix binary specified]),
AS_HELP_STRING([--with-rebar=bin],[use as build tool the rebar/rebar3/mix binary specified]),
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
rebar="rebar"
rebar="rebar3"
else
rebar="$with_rebar"
fi
], [rebar="rebar"])
], [rebar="unconfigured"])
AC_PATH_TOOL(ERL, erl, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(ERLC, erlc, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(EPMD, epmd, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(REBAR, rebar, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(REBAR3, rebar3, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(ELIXIR, elixir, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(IEX, iex, , [${extra_erl_path}$PATH])
AC_PATH_TOOL(MIX, mix, , [${extra_erl_path}$PATH])
if test "$rebar" = unconfigured; then
if test "x$ELIXIR" = "x" -o "x$IEX" = "x" -o "x$MIX" = "x"; then
if test "x$REBAR3" = "x"; then
rebar="rebar3"
else
rebar=$REBAR3
fi
else
rebar=$MIX
fi
fi
if test "x$rebar" = "xrebar" -a "x$REBAR" = "x" ; then
rebar="./rebar"
fi
if test "x$rebar" = "xrebar3" -a "x$REBAR3" = "x" ; then
rebar="./rebar3"
fi
AC_ERLANG_NEED_ERL
AC_ERLANG_NEED_ERLC
@@ -84,7 +119,7 @@ AC_ARG_ENABLE(debug,
esac],[if test "x$debug" = "x"; then debug=true; fi])
AC_ARG_ENABLE(elixir,
[AS_HELP_STRING([--enable-elixir],[enable Elixir support (default: no)])],
[AS_HELP_STRING([--enable-elixir],[enable Elixir support in Rebar3 (default: no)])],
[case "${enableval}" in
yes) elixir=true ;;
no) elixir=false ;;
@@ -112,7 +147,7 @@ esac],[full_xml=false])
ENABLEGROUP=""
AC_ARG_ENABLE(group,
[AS_HELP_STRING([--enable-group[[[[=GROUP]]]]], [allow this system group to start ejabberd (default: no)])],
[AS_HELP_STRING([--enable-group[[=GROUP]]], [specify the group of the account defined in --enable-user (default: no)])],
[case "${enableval}" in
yes) ENABLEGROUP=`groups |head -n 1` ;;
no) ENABLEGROUP="" ;;
@@ -157,12 +192,20 @@ AC_ARG_ENABLE(mysql,
esac],[if test "x$mysql" = "x"; then mysql=false; fi])
AC_ARG_ENABLE(new_sql_schema,
[AS_HELP_STRING([--enable-new-sql-schema],[use new SQL schema by default (default: no)])],
[AS_HELP_STRING([--enable-new-sql-schema],[obsolete, use --enable-multihost-sql-schema instead (default: no)])],
[case "${enableval}" in
yes) new_sql_schema=true ;;
no) new_sql_schema=false ;;
yes) multihost_sql_schema=true ;;
no) multihost_sql_schema=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-new-sql-schema) ;;
esac],[new_sql_schema=false])
esac],[multihost_sql_schema=false])
AC_ARG_ENABLE(multihost_sql_schema,
[AS_HELP_STRING([--enable-multihost-sql-schema],[use multihost SQL schema by default (default: no)])],
[case "${enableval}" in
yes) multihost_sql_schema=true ;;
no) multihost_sql_schema=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-multihost-sql-schema) ;;
esac],[multihost_sql_schema=false])
AC_ARG_ENABLE(odbc,
[AS_HELP_STRING([--enable-odbc],[enable pure ODBC support (default: no)])],
@@ -237,7 +280,7 @@ AC_ARG_ENABLE(system_deps,
esac],[if test "x$system_deps" = "x"; then system_deps=false; fi])
AC_ARG_ENABLE(tools,
[AS_HELP_STRING([--enable-tools],[build development tools (default: no)])],
[AS_HELP_STRING([--enable-tools],[include debugging/development tools (default: no)])],
[case "${enableval}" in
yes) tools=true ;;
no) tools=false ;;
@@ -246,7 +289,7 @@ esac],[if test "x$tools" = "x"; then tools=false; fi])
ENABLEUSER=""
AC_ARG_ENABLE(user,
[AS_HELP_STRING([--enable-user[[[[=USER]]]]], [allow this system user to start ejabberd (default: no)])],
[AS_HELP_STRING([--enable-user[[=USER]]], [allow this system user to start ejabberd (default: no)])],
[case "${enableval}" in
yes) ENABLEUSER=`whoami` ;;
no) ENABLEUSER="" ;;
@@ -280,8 +323,10 @@ case "`uname`" in
;;
esac
AC_MSG_RESULT([build tool to use (change using --with-rebar): $rebar])
AC_SUBST(roster_gateway_workaround)
AC_SUBST(new_sql_schema)
AC_SUBST(multihost_sql_schema)
AC_SUBST(full_xml)
AC_SUBST(odbc)
AC_SUBST(mssql)
@@ -305,3 +350,26 @@ AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_OUTPUT
AS_CASE([$rebar],
[*rebar3], [
deps=""
AS_IF([test "x$stun" = "xfalse"], [deps="stun,$deps"])
AS_IF([test "x$sqlite" = "xfalse"], [deps="sqlite3,$deps"])
AS_IF([test "x$pgsql" = "xfalse"], [deps="p1_pgsql,$deps"])
AS_IF([test "x$mysql" = "xfalse"], [deps="p1_mysql,$deps"])
AS_IF([test "x$zlib" = "xfalse"], [deps="ezlib,$deps"])
AS_IF([test "x$sip" = "xfalse"], [deps="esip,$deps"])
AS_IF([test "x$redis" = "xfalse"], [deps="eredis,$deps"])
AS_IF([test "x$pam" = "xfalse"], [deps="epam,$deps"])
AS_IF([test "x$deps" = "x"], [],
[AC_MSG_NOTICE([unlocking disabled rebar3 dependencies: $deps])
$rebar unlock "$deps"])
deps=""
ERLANG_VERSION=m4_esyscmd([erl -noinput -noshell -eval 'erlang:display(list_to_integer(erlang:system_info(otp_release))), halt().'])
AS_IF([test "$ERLANG_VERSION" -le "26"], [deps="jose,$deps"])
AS_IF([test "$ERLANG_VERSION" -ge "27"], [deps="jiffy,$deps"])
AS_IF([test "x$deps" = "x"], [],
[AC_MSG_NOTICE([unlocking rebar3 dependencies for old Erlang/OTP: $deps])
$rebar unlock "$deps"])
])
+876
View File
@@ -0,0 +1,876 @@
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:xmpp="https://linkmauve.fr/ns/xmpp-doap#"
xmlns:schema="https://schema.org/">
<Project>
<name>ejabberd</name>
<shortdesc>XMPP Server with MQTT Broker and SIP Service</shortdesc>
<description>Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP Server, MQTT Broker, SIP Service)</description>
<created>2002-11-16</created>
<os>BSD</os>
<os>Linux</os>
<os>macOS</os>
<os>Windows</os>
<programming-langauge>Erlang</programming-langauge>
<programming-langauge>C</programming-langauge>
<category rdf:resource="https://linkmauve.fr/ns/xmpp-doap#category-jabber"/>
<category rdf:resource="https://linkmauve.fr/ns/xmpp-doap#category-server"/>
<category rdf:resource="https://linkmauve.fr/ns/xmpp-doap#category-xmpp"/>
<homepage rdf:resource="https://www.ejabberd.im"/>
<download-page rdf:resource="https://www.process-one.net/download/ejabberd/"/>
<download-mirror rdf:resource="https://github.com/processone/ejabberd/tags"/>
<license rdf:resource="https://raw.githubusercontent.com/processone/ejabberd/master/COPYING"/>
<schema:logo rdf:resource="https://docs.ejabberd.im/assets/img/footer_logo_e@2x.png"/>
<bug-database rdf:resource="https://github.com/processone/ejabberd/issues"/>
<support-forum rdf:resource="xmpp:ejabberd@conference.process-one.net?join"/>
<repository>
<GitRepository>
<location rdf:resource="https://github.com/processone/ejabberd.git"/>
<browse rdf:resource="https://github.com/processone/ejabberd"/>
</GitRepository>
</repository>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc3261"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc3920"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc3921"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc5766"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc5802"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc6120"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc6121"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc6122"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc6455"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc7395"/>
<implements rdf:resource="https://www.rfc-editor.org/info/rfc7590"/>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0004.html"/>
<xmpp:version>2.13.2</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0012.html"/>
<xmpp:version>2.0</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_last</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0013.html"/>
<xmpp:version>1.3</xmpp:version>
<xmpp:since>16.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0016.html"/>
<xmpp:version>1.7</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_privacy</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0022.html"/>
<xmpp:version>1.4</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0023.html"/>
<xmpp:version>1.3</xmpp:version>
<xmpp:since>0.7.5</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0030.html"/>
<xmpp:version>2.5.0</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_disco</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0033.html"/>
<xmpp:version>1.1</xmpp:version>
<xmpp:since>15.04</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_multicast</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0039.html"/>
<xmpp:version>0.6.0</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_stats</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0045.html"/>
<xmpp:version>1.35.3</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0048.html"/>
<xmpp:version>1.2</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_pubsub</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0049.html"/>
<xmpp:version>1.2</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_private</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0050.html"/>
<xmpp:version>1.3.0</xmpp:version>
<xmpp:since>1.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_adhoc</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0054.html"/>
<xmpp:version>1.3.0</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_vcard</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0055.html"/>
<xmpp:version>1.3</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_vcard</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0059.html"/>
<xmpp:version>1.0</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0060.html"/>
<xmpp:version>1.14</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>partial</xmpp:status>
<xmpp:note>mod_pubsub</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0065.html"/>
<xmpp:version>1.8.2</xmpp:version>
<xmpp:since>2.0.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_proxy65</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0077.html"/>
<xmpp:version>2.4</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_register</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0078.html"/>
<xmpp:version>2.5</xmpp:version>
<xmpp:since>17.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_legacy_auth</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0082.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0085.html"/>
<xmpp:version>2.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_client_state</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0086.html"/>
<xmpp:version>1.0</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0092.html"/>
<xmpp:version>1.1</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_version</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0106.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0114.html"/>
<xmpp:version>1.6</xmpp:version>
<xmpp:since>0.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_service</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0115.html"/>
<xmpp:version>1.6.0</xmpp:version>
<xmpp:since>2.1.4</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_caps</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0124.html"/>
<xmpp:version>1.11.2</xmpp:version>
<xmpp:since>16.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_bosh</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0133.html"/>
<xmpp:version>1.3.1</xmpp:version>
<xmpp:since>13.10</xmpp:since>
<xmpp:status>partial</xmpp:status>
<xmpp:note>mod_configure</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0138.html"/>
<xmpp:version>2.1</xmpp:version>
<xmpp:since>1.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_c2s</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0153.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>17.09</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_vcard</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0156.html"/>
<xmpp:version>1.4.0</xmpp:version>
<xmpp:since>22.05</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_host_meta</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0157.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_disco</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0158.html"/>
<xmpp:version>1.0.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_captcha</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0160.html"/>
<xmpp:version>1.0.1</xmpp:version>
<xmpp:since>16.01</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0163.html"/>
<xmpp:version>1.2.2</xmpp:version>
<xmpp:since>2.0.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_pubsub</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0170.html"/>
<xmpp:version>1.0</xmpp:version>
<xmpp:since>17.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0175.html"/>
<xmpp:version>1.2</xmpp:version>
<xmpp:since>1.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_auth_anonymous</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0178.html"/>
<xmpp:version>1.2</xmpp:version>
<xmpp:since>17.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0185.html"/>
<xmpp:version>1.0</xmpp:version>
<xmpp:since>17.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_s2s_dialback</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0191.html"/>
<xmpp:version>1.3</xmpp:version>
<xmpp:since>2.1.7</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_blocking</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0198.html"/>
<xmpp:version>1.5.2</xmpp:version>
<xmpp:since>14.05</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_stream_mgmt</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0199.html"/>
<xmpp:version>2.0.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_ping</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0202.html"/>
<xmpp:version>2.0</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_time</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0203.html"/>
<xmpp:version>2.0</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0205.html"/>
<xmpp:version>1.0.2</xmpp:version>
<xmpp:since>1.1.2</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0206.html"/>
<xmpp:version>1.4</xmpp:version>
<xmpp:since>16.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_bosh</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0215.html"/>
<xmpp:version>1.0.0</xmpp:version>
<xmpp:since>20.04</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_stun_disco</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0220.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>17.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_s2s_dialback</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0223.html"/>
<xmpp:version>1.1.1</xmpp:version>
<xmpp:since>2.0.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_pubsub</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0227.html"/>
<xmpp:version>1.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>partial</xmpp:status>
<xmpp:note>ejabberd_piefxis</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0231.html"/>
<xmpp:version>1.1</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>ejabberd_captcha</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0237.html"/>
<xmpp:version>1.3</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_roster</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0248.html"/>
<xmpp:version>0.2</xmpp:version>
<xmpp:since>2.1.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_pubsub</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0249.html"/>
<xmpp:version>1.2</xmpp:version>
<xmpp:since>0.5.0</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0279.html"/>
<xmpp:version>0.2</xmpp:version>
<xmpp:since>2.1.3</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_sic</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0280.html"/>
<xmpp:version>1.0.1</xmpp:version>
<xmpp:since>13.06</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_carboncopy</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0288.html"/>
<xmpp:version>1.0.1</xmpp:version>
<xmpp:since>24.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_s2s_bidi</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0313.html"/>
<xmpp:version>0.6.1</xmpp:version>
<xmpp:since>15.06</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0317.html"/>
<xmpp:version>0.3.1</xmpp:version>
<xmpp:since>21.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc_room, 0.3.1 since 25.10</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0328.html"/>
<xmpp:version>0.1</xmpp:version>
<xmpp:since>19.09</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_jidprep</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0334.html"/>
<xmpp:version>1.0.0</xmpp:version>
<xmpp:since>16.01</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam, mod_muc_log, mod_offline</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0352.html"/>
<xmpp:version>0.1</xmpp:version>
<xmpp:since>14.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_client_state</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0355.html"/>
<xmpp:version>0.4.1</xmpp:version>
<xmpp:since>16.09</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_delegation</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0356.html"/>
<xmpp:version>0.4.1</xmpp:version>
<xmpp:since>24.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_privilege</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0357.html"/>
<xmpp:version>0.4.1</xmpp:version>
<xmpp:since>17.08</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_push</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0359.html"/>
<xmpp:version>0.7.0</xmpp:version>
<xmpp:since>15.09</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0363.html"/>
<xmpp:version>0.3.0</xmpp:version>
<xmpp:since>15.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_http_upload</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0368.html"/>
<xmpp:version>1.1.0</xmpp:version>
<xmpp:since>17.09</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0369.html"/>
<xmpp:version>0.14.1</xmpp:version>
<xmpp:since>16.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mix</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0379.html"/>
<xmpp:version>0.3.3</xmpp:version>
<xmpp:since>26.01</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_invites</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0384.html"/>
<xmpp:version>0.9.0</xmpp:version>
<xmpp:since>21.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>node_pep</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0386.html"/>
<xmpp:version>0.3.0</xmpp:version>
<xmpp:since>24.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0388.html"/>
<xmpp:version>1.0.4</xmpp:version>
<xmpp:since>24.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0398.html"/>
<xmpp:version>1.0.0</xmpp:version>
<xmpp:since>18.03</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_avatar</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0401.html"/>
<xmpp:version>0.5.0</xmpp:version>
<xmpp:since>26.01</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_invites</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0402.html"/>
<xmpp:version>1.2.0</xmpp:version>
<xmpp:since>23.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_private</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0405.html"/>
<xmpp:version>0.3.0</xmpp:version>
<xmpp:since>19.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mix_pam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0410.html"/>
<xmpp:version>1.1.0</xmpp:version>
<xmpp:since>18.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc_room</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0411.html"/>
<xmpp:version>1.1.0</xmpp:version>
<xmpp:since>18.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_private</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0421.html"/>
<xmpp:version>1.0.1</xmpp:version>
<xmpp:since>23.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0424.html"/>
<xmpp:version>0.4.2</xmpp:version>
<xmpp:since>24.02</xmpp:since>
<xmpp:status>partial</xmpp:status>
<xmpp:note>mod_mam, Tombstones not implemented</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0425.html"/>
<xmpp:version>0.3.0</xmpp:version>
<xmpp:since>24.06</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0431.html"/>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>24.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0440.html"/>
<xmpp:version>1.0.0</xmpp:version>
<xmpp:since>24.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note></xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0441.html"/>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>15.06</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_mam</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0445.html"/>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>26.01</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_invites</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0474.html"/>
<xmpp:version>0.5.0</xmpp:version>
<xmpp:since>24.02</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>, 0.4.0 since 25.03</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0480.html"/>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>24.10</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_scram_upgrade</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0484.html"/>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>24.12</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_auth_fast</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0485.html"/>
<xmpp:version>1.0.0</xmpp:version>
<xmpp:since>25.07</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_pubsub_serverinfo</xmpp:note>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0486.html"/>
<xmpp:version>0.1.0</xmpp:version>
<xmpp:since>24.07</xmpp:since>
<xmpp:status>complete</xmpp:status>
<xmpp:note>mod_muc</xmpp:note>
</xmpp:SupportedXep>
</implements>
</Project>
</rdf:RDF>
-1
View File
@@ -9,7 +9,6 @@ Group=@installuser@
LimitNOFILE=65536
Restart=on-failure
RestartSec=5
WatchdogSec=30
ExecStart=@ctlscriptpath@/ejabberdctl foreground
ExecStop=/bin/sh -c '@ctlscriptpath@/ejabberdctl stop && @ctlscriptpath@/ejabberdctl stopped'
ExecReload=@ctlscriptpath@/ejabberdctl reload_config
+17 -7
View File
@@ -36,17 +36,17 @@ listen:
-
port: 5223
ip: "::"
tls: true
module: ejabberd_c2s
max_stanza_size: 262144
shaper: c2s_shaper
access: c2s
starttls_required: true
tls: true
-
port: 5269
ip: "::"
module: ejabberd_s2s_in
max_stanza_size: 524288
shaper: s2s_shaper
-
port: 5443
ip: "::"
@@ -67,7 +67,7 @@ listen:
/admin: ejabberd_web_admin
/.well-known/acme-challenge: ejabberd_acme
-
port: 3478
port: 5478
ip: "::"
transport: udp
module: ejabberd_stun
@@ -111,11 +111,19 @@ access_rules:
api_permissions:
"console commands":
from:
- ejabberd_ctl
from: ejabberd_ctl
who: all
what: "*"
"admin access":
"webadmin commands":
from: ejabberd_web_admin
who: admin
what: "*"
"adhoc commands":
from: mod_adhoc_api
who: admin
what: "*"
"http access":
from: mod_http_api
who:
access:
allow:
@@ -156,6 +164,7 @@ shaper_rules:
modules:
mod_adhoc: {}
mod_adhoc_api: {}
mod_admin_extra: {}
mod_announce:
access: announce
@@ -170,7 +179,7 @@ modules:
mod_fail2ban: {}
mod_http_api: {}
mod_http_upload:
put_url: https://@HOST@:5443/upload
put_url: https://@HOST_URL_ENCODE@:5443/upload
custom_headers:
"Access-Control-Allow-Origin": "https://@HOST@"
"Access-Control-Allow-Methods": "GET,HEAD,PUT,OPTIONS"
@@ -224,6 +233,7 @@ modules:
ip_access: trusted_network
mod_roster:
versioning: true
mod_s2s_bidi: {}
mod_s2s_dialback: {}
mod_shared_roster: {}
mod_stream_mgmt:
+60 -16
View File
@@ -24,6 +24,34 @@
#
#ERL_MAX_PORTS=65536
#.
#' INET_DIST_INTERFACE: IP address where this Erlang node listens other nodes
#
# This communication is used by ejabberdctl command line tool,
# and in a cluster of several ejabberd nodes.
#
# Default: 0.0.0.0
#
#INET_DIST_INTERFACE=127.0.0.1
#.
#' ERL_DIST_PORT: Port number for Erlang distribution
#
# For Erlang distribution, clustering and ejabberdctl usage, the
# Erlang VM listens in a random TCP port number, and the Erlang Port
# Mapper Daemon (EPMD) is spawned and used to determine this port
# number.
#
# ERL_DIST_PORT can define this port number. In that case, EPMD is
# not spawned during ejabberd startup, and ERL_EPMD_ADDRESS is
# ignored. ERL_DIST_PORT must be set to the same port number during
# ejabberd startup and when calling ejabberdctl. This feature
# requires at least Erlang/OTP 23.1.
#
# Default: not defined
#
#ERL_DIST_PORT=5210
#.
#' FIREWALL_WINDOW: Range of allowed ports to pass through a firewall
#
@@ -37,20 +65,10 @@
#FIREWALL_WINDOW=
#.
#' INET_DIST_INTERFACE: IP address where this Erlang node listens other nodes
#
# This communication is used by ejabberdctl command line tool,
# and in a cluster of several ejabberd nodes.
#
# Default: 0.0.0.0
#
#INET_DIST_INTERFACE=127.0.0.1
#.
#' ERL_EPMD_ADDRESS: IP addresses where epmd listens for connections
#' ERL_EPMD_ADDRESS: IP addresses where EPMD listens for connections
#
# This environment variable may be set to a comma-separated
# list of IP addresses, in which case the epmd daemon
# list of IP addresses, in which case the EPMD daemon
# will listen only on the specified address(es) and on the
# loopback address (which is implicitly added to the list if it
# has not been specified). The default behaviour is to listen on
@@ -90,10 +108,11 @@
#.
#' ERL_OPTIONS: Additional Erlang options
#
# The next variable allows to specify additional options passed to erlang while
# starting ejabberd. Some useful options are -noshell, -detached, -heart. When
# ejabberd is started from an init.d script options -noshell and -detached are
# added implicitly. See erl(1) for more info.
# The next variable allows to specify additional options passed to
# all commands using erlang interpreter. This applies to starting
# ejabberd server itself but also auxiliary commands like for example
# starting debug shell. See erl(1) for list of commands that can be
# used here.
#
# It might be useful to add "-pa /usr/local/lib/ejabberd/ebin" if you
# want to add local modules in this path.
@@ -102,6 +121,20 @@
#
#ERL_OPTIONS=""
#.
#' EJABBERD_OPTS: Additional Erlang options to start ejabberd
#
# The next variable allows to specify additional options passed to erlang while
# starting ejabberd. Some useful options are -noshell, -detached, -heart. When
# ejabberd is started from an init.d script options -noshell and -detached are
# added implicitly. See erl(1) for more info.
#
# For example you can use value "-heart -env HEART_BEAT_TIMEOUT 120 -env ERL_CRASH_DUMP_SECONDS 60"
#
# Default: ""
#
#EJABBERD_OPTS=""
#.
#' ERLANG_NODE: Erlang node name
#
@@ -165,6 +198,17 @@
#
#CONTRIB_MODULES_CONF_DIR=/etc/ejabberd/modules
#.
#' CTL_OVER_HTTP: Path to ejabberdctl HTTP listener socket
#
# To speedup ejabberdctl execution time for ejabberd commands,
# you can setup an ejabberd_http listener with ejabberd_ctl handling requests,
# listening in a unix domain socket.
#
# Default: disabled
#
#CTL_OVER_HTTP=sockets/ctl_over_http.sock
#.
#'
# vim: foldmarker=#',#. foldmethod=marker:
+309 -38
View File
@@ -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}}"
INSTALLUSER="{{installuser}}"
# check the proper system user is used
@@ -59,7 +59,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
@@ -67,20 +66,30 @@ done
# shellcheck source=ejabberdctl.cfg.example
[ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH"
[ -n "$ERLANG_NODE_ARG" ] && ERLANG_NODE="$ERLANG_NODE_ARG"
[ "$ERLANG_NODE" = "${ERLANG_NODE%@*}" ] && ERLANG_NODE="$ERLANG_NODE@$(hostname -s)"
[ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] && S="-s"
: "${SPOOL_DIR:="{{spool_dir}}"}"
: "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}"
# backward support for old mnesia spool dir path
: "${SPOOL_DIR_OLD:="$SPOOL_DIR/$ERLANG_NODE"}"
[ -r "$SPOOL_DIR_OLD/schema.DAT" ] && [ ! -r "$SPOOL_DIR/schema.DAT" ] && SPOOL_DIR="$SPOOL_DIR_OLD"
# define erl parameters
ERLANG_OPTS="+K $POLL +P $ERL_PROCESSES $ERL_OPTIONS"
if [ -n "$FIREWALL_WINDOW" ] ; then
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_listen_min ${FIREWALL_WINDOW%-*} inet_dist_listen_max ${FIREWALL_WINDOW#*-}"
fi
if [ -n "$INET_DIST_INTERFACE" ] ; then
INET_DIST_INTERFACE2=$("$ERL" -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt)
if [ -n "$INET_DIST_INTERFACE2" ] ; then
if [ "$(echo "$INET_DIST_INTERFACE2" | grep -o "," | wc -l)" -eq 7 ] ; then
INET_DIST_INTERFACE2="$INET_DIST_INTERFACE2 -proto_dist inet6_tcp"
fi
ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2"
fi
fi
[ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -erl_epmd_port $ERL_DIST_PORT -start_epmd false"
# if vm.args file exists in config directory, pass it to Erlang VM
[ -f "$VMARGS" ] && ERLANG_OPTS="$ERLANG_OPTS -args_file $VMARGS"
ERL_LIBS='{{libdir}}'
@@ -88,9 +97,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")"
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"
@@ -100,6 +112,7 @@ export EJABBERD_LOG_PATH
export EJABBERD_PID_PATH
export ERL_CRASH_DUMP
export ERL_EPMD_ADDRESS
export ERL_DIST_PORT
export ERL_INETRC
export ERL_MAX_PORTS
export ERL_MAX_ETS_TABLES
@@ -108,12 +121,30 @@ export CONTRIB_MODULES_CONF_DIR
export ERL_LIBS
export SCRIPT_DIR
# Only required for Erlang/OTP 25:
export ERL_FLAGS="$ERL_FLAGS -enable-feature maybe_expr"
set_dist_client()
{
[ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -dist_listen false"
}
# run command either directly or via su $INSTALLUSER
exec_cmd()
{
case $EXEC_CMD in
as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
as_current_user) "$@" ;;
case $EXEC_CMD,$(uname -s) in
as_install_user,OpenBSD)
su -s /bin/sh "$INSTALLUSER" -c 'exec "$0" "$@"' "$@"
;;
as_install_user,NetBSD)
su "$INSTALLUSER" -c 'exec "$0" "$@"' -- "$@"
;;
as_install_user,*)
su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@"
;;
as_current_user,*)
"$@"
;;
esac
}
exec_erl()
@@ -140,9 +171,11 @@ debugwarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To detach this shell from ejabberd, press:"
echo " control+c, control+c"
echo "To exit and detach this shell from ejabberd, press:"
echo " control+g and then q"
echo ""
#vt100 echo "Please do NOT use control+c in this debug shell !"
#vt100 echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
echo " EJABBERD_BYPASS_WARNINGS=true"
@@ -163,8 +196,10 @@ livewarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To exit this LIVE mode and stop ejabberd, press:"
echo " q(). and press the Enter key"
echo "To stop ejabberd gracefully:"
echo " ejabberd:stop()."
echo "To quit erlang immediately, press:"
echo " control+g and then q"
echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
@@ -175,6 +210,39 @@ 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
}
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 ""
@@ -203,21 +271,40 @@ help()
}
# dynamic node name helper
uid()
{
uuid=$(uuidgen 2>/dev/null)
random=$(awk 'BEGIN { srand(); print int(rand()*32768) }' /dev/null)
[ -z "$uuid" ] && [ -f /proc/sys/kernel/random/uuid ] && uuid=$(cat /proc/sys/kernel/random/uuid)
[ -z "$uuid" ] && uuid=$(printf "%X" "${random:-$$}$(date +%M%S)")
uuid=$(printf '%s' $uuid | sed 's/^\(...\).*$/\1/')
[ $# -eq 0 ] && echo "${uuid}-${ERLANG_NODE}"
[ $# -eq 1 ] && echo "${uuid}-${1}-${ERLANG_NODE}"
[ $# -eq 2 ] && echo "${uuid}-${1}@${2}"
uid() {
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
case $# in
0) NN="${PF}-${N}-${ERLANG_NODE}"
;;
1) NN="${PF}-${N}-${1}-${ERLANG_NODE}"
;;
2) NN="${PF}-${N}-${1}@${2}"
;;
esac
N=$(( N + 1 + ( $$ % 5 ) ))
"$EPMD" -names 2>/dev/null | grep -q " ${NN%@*} "
do :; done
echo $NN
else
# Erlang/OTP 23 or higher: use native dynamic node code
# https://www.erlang.org/patches/otp-23.0#OTP-13812
if [ "$ERLANG_NODE" != "${ERLANG_NODE%.*}" ]; then
echo "undefined@${ERLANG_NODE#*@}"
else
echo "undefined"
fi
fi
}
# stop epmd if there is no other running node
stop_epmd()
{
[ -n "$ERL_DIST_PORT" ] && return
"$EPMD" -names 2>/dev/null | grep -q name || "$EPMD" -kill >/dev/null
}
@@ -225,6 +312,20 @@ stop_epmd()
# if all ok, ensure runtime directory exists and make it current directory
check_start()
{
[ -n "$ERL_DIST_PORT" ] && {
netstat -nl | grep ":$ERL_DIST_PORT" >/dev/null && {
echo ""
echo "NOTE: The file ejabberdctl.cfg has configured ERL_DIST_PORT=$ERL_DIST_PORT"
echo " and the port 5210 is already in use."
echo " If ejabberd fails to start with listen error eaddrinsuse,"
echo " try configuring in ejabberdctl.cfg a different"
echo " INET_DIST_INTERFACE, or different ERL_DIST_PORT"
echo ""
netstat -nlp 2>/dev/null | grep ":5210"
echo ""
}
return
}
"$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && {
pgrep -f "$ERLANG_NODE" >/dev/null && {
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."
@@ -243,6 +344,13 @@ check_start()
# allow sync calls
wait_status()
{
wait_status_node "$ERLANG_NODE" $1 $2 $3
}
wait_status_node()
{
CONNECT_NODE=$1
shift
# args: status try delay
# return: 0 OK, 1 KO
timeout="$2"
@@ -253,14 +361,71 @@ wait_status()
if [ $timeout -eq 0 ] ; then
status="$1"
else
exec_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \
-extra "$ERLANG_NODE" $NO_TIMEOUT status > /dev/null
exec_erl "$(uid ctl)" -hidden -noinput \
-eval 'net_kernel:connect_node('"'$CONNECT_NODE'"')' \
-s ejabberd_ctl \
-extra "$CONNECT_NODE" $NO_TIMEOUT status > /dev/null
status="$?"
fi
done
[ $timeout -gt 0 ]
}
exec_other_command()
{
exec_other_command_node $ERLANG_NODE "$@"
}
exec_other_command_node()
{
CONNECT_NODE=$1
shift
if [ -z "$CTL_OVER_HTTP" ] || [ ! -S "$CTL_OVER_HTTP" ] \
|| [ ! -x "$(command -v curl)" ] || [ -z "$1" ] || [ "$1" = "help" ] \
|| [ "$1" = "mnesia_info_ctl" ]|| [ "$1" = "print_sql_schema" ] ; then
exec_erl "$(uid ctl)" -hidden -noinput \
-eval 'net_kernel:connect_node('"'$CONNECT_NODE'"')' \
-s ejabberd_ctl \
-extra "$CONNECT_NODE" $NO_TIMEOUT "$@"
result=$?
case $result in
3) help;;
*) :;;
esac
return $result
else
exec_ctl_over_http_socket "$@"
fi
}
exec_ctl_over_http_socket()
{
COMMAND=${1}
CARGS=""
while [ $# -gt 0 ]; do
[ -z "$CARGS" ] && CARGS="[" || CARGS="${CARGS}, "
CARGS="${CARGS}\"$1\""
shift
done
CARGS="${CARGS}]"
TEMPHEADERS=temp-headers.log
curl \
--unix-socket ${CTL_OVER_HTTP} \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "${CARGS}" \
--dump-header ${TEMPHEADERS} \
--no-progress-meter \
"http://localhost/ctl/${COMMAND}"
result=$(sed -n 's/.*status-code: \([0-9]*\).*/\1/p' < $TEMPHEADERS)
rm ${TEMPHEADERS}
case $result in
2|3) exec_other_command help ${COMMAND};;
*) :;;
esac
exit $result
}
# ensure we can change current directory to SPOOL_DIR
[ -d "$SPOOL_DIR" ] || exec_cmd mkdir -p "$SPOOL_DIR"
cd "$SPOOL_DIR" || {
@@ -268,6 +433,103 @@ cd "$SPOOL_DIR" || {
exit 6
}
printe()
{
printf "\n"
printf "\e[1;40;32m==> %s\e[0m\n" "$1"
}
## Function copied from tools/make-installers
user_agrees()
{
question="$*"
if [ -t 0 ]
then
printe "$question (y/n) [n]"
read -r response
case "$response" in
[Yy]|[Yy][Ee][Ss])
return 0
;;
[Nn]|[Nn][Oo]|'')
return 1
;;
*)
echo 'Please respond with "yes" or "no".'
user_agrees "$question"
;;
esac
else # Assume 'yes' if not running interactively.
return 0
fi
}
mnesia_change()
{
ERLANG_NODE_OLD="$1"
[ "$ERLANG_NODE_OLD" = "" ] \
&& echo "Error: Please provide the old erlang node name, for example:" \
&& echo " ejabberdctl mnesia_change ejabberd@oldmachine" \
&& exit 1
SPOOL_DIR_BACKUP=$SPOOL_DIR/$ERLANG_NODE_OLD-backup/
OLDFILE=$SPOOL_DIR_BACKUP/$ERLANG_NODE_OLD.backup
NEWFILE=$SPOOL_DIR_BACKUP/$ERLANG_NODE.backup
printe "This changes your mnesia database from node name '$ERLANG_NODE_OLD' to '$ERLANG_NODE'"
[ -d "$SPOOL_DIR_BACKUP" ] && printe "WARNING! A backup of old node already exists in $SPOOL_DIR_BACKUP"
if ! user_agrees "Do you want to proceed?"
then
echo 'Operation aborted.'
exit 1
fi
printe "Starting ejabberd with old node name $ERLANG_NODE_OLD ..."
exec_erl "$ERLANG_NODE_OLD" $EJABBERD_OPTS -detached
wait_status_node $ERLANG_NODE_OLD 0 30 2
result=$?
case $result in
1) echo "There was a problem starting ejabberd with the old erlang node name. " \
&& echo "Check for log errors in $EJABBERD_LOG_PATH" \
&& exit $result;;
*) :;;
esac
exec_other_command_node $ERLANG_NODE_OLD "status"
printe "Making backup of old database to file $OLDFILE ..."
mkdir $SPOOL_DIR_BACKUP
exec_other_command_node $ERLANG_NODE_OLD backup "$OLDFILE"
printe "Changing node name in new backup file $NEWFILE ..."
exec_other_command_node $ERLANG_NODE_OLD mnesia_change_nodename "$ERLANG_NODE_OLD" "$ERLANG_NODE" "$OLDFILE" "$NEWFILE"
printe "Stopping old ejabberd..."
exec_other_command_node $ERLANG_NODE_OLD "stop"
wait_status_node $ERLANG_NODE_OLD 3 30 2 && stop_epmd
printe "Moving old mnesia spool files to backup subdirectory $SPOOL_DIR_BACKUP ..."
mv $SPOOL_DIR/*.DAT $SPOOL_DIR_BACKUP
mv $SPOOL_DIR/*.DCD $SPOOL_DIR_BACKUP
mv $SPOOL_DIR/*.LOG $SPOOL_DIR_BACKUP
printe "Starting ejabberd with new node name $ERLANG_NODE ..."
exec_erl "$ERLANG_NODE" $EJABBERD_OPTS -detached
wait_status 0 30 2
exec_other_command "status"
printe "Installing fallback of new mnesia..."
exec_other_command install_fallback "$NEWFILE"
printe "Stopping new ejabberd..."
exec_other_command "stop"
wait_status 3 30 2 && stop_epmd
printe "Finished, now you can start ejabberd normally"
}
# main
case $1 in
start)
@@ -289,41 +551,50 @@ case $1 in
;;
debug)
debugwarning
set_dist_client
exec_erl "$(uid debug)" -hidden -remsh "$ERLANG_NODE"
;;
etop)
exec_erl "$(uid top)" -hidden -node "$ERLANG_NODE" -s etop \
-s erlang halt -output text
set_dist_client
exec_erl "$(uid top)" -hidden -remsh "$ERLANG_NODE" -s etop \
-output text
check_etop_result
;;
iexdebug)
debugwarning
set_dist_client
exec_iex "$(uid debug)" --remsh "$ERLANG_NODE"
check_iex_result
;;
iexlive)
livewarning
exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS" --app ejabberd
exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS"
check_iex_result
;;
ping)
PEER=${2:-$ERLANG_NODE}
[ "$PEER" = "${PEER%.*}" ] && PS="-s"
set_dist_client
exec_cmd "$ERL" ${PS:--}name "$(uid ping "$(hostname $PS)")" $ERLANG_OPTS \
-noinput -hidden -eval 'io:format("~p~n",[net_adm:ping('"'$PEER'"')])' \
-s erlang halt -output text
-noinput -hidden \
-eval 'net_kernel:connect_node('"'$PEER'"')' \
-eval 'io:format("~p~n",[net_adm:ping('"'$PEER'"')])' \
-eval 'halt(case net_adm:ping('"'$PEER'"') of pong -> 0; pang -> 1 end).' \
-output text
;;
started)
set_dist_client
wait_status 0 30 2 # wait 30x2s before timeout
;;
stopped)
set_dist_client
wait_status 3 30 2 && stop_epmd # wait 30x2s before timeout
;;
mnesia_change)
mnesia_change $2
;;
*)
exec_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \
-extra "$ERLANG_NODE" $NO_TIMEOUT "$@"
result=$?
case $result in
2|3) help;;
*) :;;
esac
exit $result
set_dist_client
exec_other_command "$@"
;;
esac
+59
View File
@@ -0,0 +1,59 @@
[
{
elvis,
[
{config,
[#{dirs => ["src"],
filter => "*.erl",
ignore => ['ELDAPv3', eldap_filter_yecc],
ruleset => erl_files,
rules => [{elvis_text_style, line_length, #{limit => 1000, skip_comments => false}},
{elvis_text_style, no_tabs, disable},
{elvis_style, atom_naming_convention, disable},
{elvis_style, consistent_variable_casing, disable},
{elvis_style, dont_repeat_yourself, #{min_complexity => 70}},
{elvis_style, export_used_types, disable},
{elvis_style, function_naming_convention, disable},
{elvis_style, god_modules, #{limit => 300}},
{elvis_style, invalid_dynamic_call, disable},
{elvis_style, macro_names, disable},
{elvis_style, max_function_arity, disable}, % #{max_arity => 15}},
{elvis_style, nesting_level, disable},
{elvis_style, no_author, disable},
{elvis_style, no_boolean_in_comparison, disable},
{elvis_style, no_catch_expressions, disable},
{elvis_style, no_debug_call, disable},
{elvis_style, no_if_expression, disable},
{elvis_style, no_import, disable},
{elvis_style, no_nested_try_catch, disable},
{elvis_style, no_operation_on_same_value, disable},
{elvis_style, no_receive_without_timeout, disable},
{elvis_style, no_single_clause_case, disable},
{elvis_style, no_spec_with_records, disable},
{elvis_style, no_throw, disable},
{elvis_style, operator_spaces, disable},
{elvis_style, param_pattern_matching, disable},
{elvis_style, private_data_types, disable},
{elvis_style, variable_naming_convention, disable}
]
},
%#{dirs => ["include"],
% filter => "*.hrl",
% ruleset => hrl_files},
#{dirs => ["."],
filter => "Makefile.in",
ruleset => makefiles,
rules => [{elvis_text_style, line_length, #{limit => 400,
skip_comments => false}},
{elvis_style, dont_repeat_yourself, #{min_complexity => 20}}
]
}
]
}
]
}
].
%% vim: set filetype=erlang tabstop=8:
+29
View File
@@ -0,0 +1,29 @@
#otp_path: "/usr/lib/erlang"
#plt_path: "_build/default/rebar3_24.3.3_plt"
#code_reload:
# node: ejabberd@localhost
apps_dirs:
- "_build/default/lib/*"
deps_dirs:
- "_build/default/lib/*"
include_dirs:
- "_build/default/lib"
- "_build/default/lib/*/include"
- "include"
macros:
- name: OTP_BELOW_27
- name: SIP
- name: STUN
diagnostics:
enabled:
- crossref
disabled:
# - dialyzer
- unused_includes # Otherwise it complains about unused logger.hrl
lenses:
disabled:
- ct-run-test
- function-references
- server-info
- show-behaviour-usages
- suggest-spec
-66
View File
@@ -1,66 +0,0 @@
#!/usr/bin/perl
use Unix::Syslog qw(:macros :subs);
my $domain = $ARGV[0] || "example.com";
while(1)
{
# my $rin = '',$rout;
# vec($rin,fileno(STDIN),1) = 1;
# $ein = $rin;
# my $nfound = select($rout=$rin,undef,undef,undef);
my $buf = "";
syslog LOG_INFO,"waiting for packet";
my $nread = sysread STDIN,$buf,2;
do { syslog LOG_INFO,"port closed"; exit; } unless $nread == 2;
my $len = unpack "n",$buf;
my $nread = sysread STDIN,$buf,$len;
my ($op,$user,$host,$password) = split /:/,$buf;
#$user =~ s/\./\//og;
my $jid = "$user\@$domain";
my $result;
syslog(LOG_INFO,"request (%s)", $op);
SWITCH:
{
$op eq 'auth' and do
{
$result = 1;
},last SWITCH;
$op eq 'setpass' and do
{
$result = 1;
},last SWITCH;
$op eq 'isuser' and do
{
# password is null. Return 1 if the user $user\@$domain exitst.
$result = 1;
},last SWITCH;
$op eq 'tryregister' and do
{
$result = 1;
},last SWITCH;
$op eq 'removeuser' and do
{
# password is null. Return 1 if the user $user\@$domain exitst.
$result = 1;
},last SWITCH;
$op eq 'removeuser3' and do
{
$result = 1;
},last SWITCH;
};
my $out = pack "nn",2,$result ? 1 : 0;
syswrite STDOUT,$out;
}
closelog;
-75
View File
@@ -1,75 +0,0 @@
#!/bin/sh
#
# PROVIDE: ejabberd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
HOME=/usr/pkg/jabber D=/usr/pkg/jabber/ejabberd export HOME
name="ejabberd"
rcvar=$name
if [ -r /etc/rc.conf ]
then
. /etc/rc.conf
else
eval ${rcvar}=YES
fi
# $flags from environment overrides ${rcvar}_flags
if [ -n "${flags}" ]
then
eval ${rcvar}_flags="${flags}"
fi
checkyesno()
{
eval _value=\$${1}
case $_value in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;;
*)
echo "\$${1} is not set properly."
return 1
;;
esac
}
cmd=${1:-start}
case ${cmd} in
force*)
cmd=${cmd#force}
eval ${rcvar}=YES
;;
esac
if checkyesno ${rcvar}
then
else
exit 0
fi
case ${cmd} in
start)
if [ -x $D/src ]; then
echo "Starting ${name}."
cd $D/src
ERL_MAX_PORTS=32000 export ERL_MAX_PORTS
ulimit -n $ERL_MAX_PORTS
su jabber -c "/usr/pkg/bin/erl -sname ejabberd -s ejabberd -heart -detached -sasl sasl_error_logger '{file, \"ejabberd-sasl.log\"}' &" \
1>/dev/null 2>&1
fi
;;
stop)
echo "rpc:call('ejabberd@`hostname -s`', init, stop, [])." | \
su jabber -c "/usr/pkg/bin/erl -sname ejabberdstop"
;;
restart)
echo "rpc:call('ejabberd@`hostname -s`', init, restart, [])." | \
su jabber -c "/usr/pkg/bin/erl -sname ejabberdrestart"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
-81
View File
@@ -1,81 +0,0 @@
#!/bin/sh
echo '1. fetch, compile, and install erlang'
if [ ! pkg_info erlang 1>/dev/null 2>&1 ]; then
cd /usr/pkgsrc/lang/erlang
make fetch-list|sh
make
make install
fi
if pkg_info erlang | grep -q erlang-9.1nb1; then
else
echo "erlang-9.1nb1 not installed" 1>&2
exit 1
fi
echo '2. install crypt_drv.so'
if [ ! -d /usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib ] ; then
mkdir -p /usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib
fi
if [ ! -f /usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib/crypto_drv.so ]; then
cp work/otp*/lib/crypto/priv/*/*/crypto_drv.so \
/usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib
fi
echo '3. compile and install elibcrypto.so'
if [ ! -f /usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib/elibcrypto.so ]; then
cd /usr/pkgsrc/lang/erlang/work/otp_src_R9B-1/lib/crypto/c_src
ld -r -u CRYPTO_set_mem_functions -u MD5 -u MD5_Init -u MD5_Update \
-u MD5_Final -u SHA1 -u SHA1_Init -u SHA1_Update -u SHA1_Final \
-u des_set_key -u des_ncbc_encrypt -u des_ede3_cbc_encrypt \
-L/usr/lib -lcrypto -o ../priv/obj/i386--netbsdelf/elibcrypto.o
cc -shared \
-L/usr/pkgsrc/lang/erlang/work/otp_src_R9B-1/lib/erl_interface/obj/i386--netbsdelf \
-o ../priv/obj/i386--netbsdelf/elibcrypto.so \
../priv/obj/i386--netbsdelf/elibcrypto.o -L/usr/lib -lcrypto
cp ../priv/obj/i386--netbsdelf/elibcrypto.so \
/usr/pkg/lib/erlang/lib/crypto-1.1.2.1/priv/lib
fi
echo '4. compile and install ssl_esock'
if [ ! -f /usr/pkg/lib/erlang/lib/ssl-2.3.5/priv/bin/ssl_esock ]; then
cd /usr/pkg/lib/erlang/lib/ssl-2.3.5/priv/obj/
make
fi
echo '5. initial ejabberd configuration'
cd /usr/pkg/jabber/ejabberd/src
./configure
echo '6. edit ejabberd Makefiles'
for M in Makefile mod_*/Makefile; do
if [ ! -f $M.orig ]; then
mv $M $M.orig
sed -e s%/usr/local%/usr/pkg%g < $M.orig > $M
fi
done
echo '7. compile ejabberd'
gmake
for A in mod_muc mod_pubsub; do
(cd $A; gmake)
done
echo ''
echo 'now edit ejabberd.cfg'
echo ''
echo 'to start ejabberd: erl -sname ejabberd -s ejabberd'
-65
View File
@@ -1,65 +0,0 @@
% jabber.dbc.mtview.ca.us
override_acls.
{acl, admin, {user, "mrose", "jabber.dbc.mtview.ca.us"}}.
{access, announce, [{allow, admin},
{deny, all}]}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, configure, [{allow, admin},
{deny, all}]}.
{access, disco_admin, [{allow, admin},
{deny, all}]}.
{access, muc_admin, [{allow, admin},
{deny, all}]}.
{access, register, [{deny, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{auth_method, internal}.
{host, "jabber.dbc.mtview.ca.us"}.
{outgoing_s2s_port, 5269}.
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{welcome_message, none}.
{listen, [{5222, ejabberd_c2s,
[{access, c2s},
{shaper, c2s_shaper}]},
{5223, ejabberd_c2s,
[{access, c2s},
{shaper, c2s_shaper},
{ssl, [{certfile, "/etc/openssl/certs/ejabberd.pem"}]}]},
{5269, ejabberd_s2s_in,
[{shaper, s2s_shaper}]}]}.
{modules, [
{mod_register, []},
{mod_roster, []},
{mod_privacy, []},
{mod_configure, []},
{mod_disco, []},
{mod_stats, []},
{mod_vcard, []},
{mod_offline, []},
{mod_echo, [{host, "echo.jabber.dbc.mtview.ca.us"}]},
{mod_private, []},
{mod_muc, []},
{mod_pubsub, []},
{mod_time, []},
{mod_last, []},
{mod_version, []}
]}.
% Local Variables:
% mode: erlang
% End:
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+2 -2
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -18,5 +18,5 @@
%%%
%%%----------------------------------------------------------------------
-record(passwd, {us = {<<"">>, <<"">>} :: {binary(), binary()} | '$1',
-record(passwd, {us = {<<"">>, <<"">>} :: {binary(), binary()} | {binary(), binary(), atom()} | '$1',
password = <<"">> :: binary() | scram() | '_'}).
+44 -41
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -19,13 +19,34 @@
%%%----------------------------------------------------------------------
-type aterm() :: {atom(), atype()}.
-type atype() :: integer | string | binary |
-type atype() :: integer | string | binary | any | atom |
{tuple, [aterm()]} | {list, aterm()}.
-type rterm() :: {atom(), rtype()}.
-type rtype() :: integer | string | atom |
-type rtype() :: integer | string | atom | any |
{tuple, [rterm()]} | {list, rterm()} |
rescode | restuple.
%% The 'any' and 'atom' argument types and 'any' result type
%% should only be used by commands with tag 'internal',
%% which are meant to be used only internally in ejabberd,
%% and not called using external frontends.
%% When a command with tag 'async' is called by mod_adhoc_api,
%% it is spawned in a new process for the command execution,
%% and the command immediately returns success.
%% The purpose of a command can either be:
%% - informative: its purpose is to obtain information
%% - modifier: its purpose is to produce some change in the server
%%
%% A modifier command should be designed just to produce its desired side-effect,
%% and its result term should just be success or failure: rescode or restuple.
%%
%% ejabberd_web_admin:make_command/2 considers that commands
%% with result type different than rescode or restuple
%% are commands that can be safely executed automatically
%% to get information and build the web page.
-type oauth_scope() :: atom().
%% ejabberd_commands OAuth ReST ACL definition:
@@ -67,42 +88,24 @@
args_example = none :: none | [any()] | '_',
result_example = none :: any()}).
%% TODO Fix me: Type is not up to date
-type ejabberd_commands() :: #ejabberd_commands{name :: atom(),
tags :: [atom()],
desc :: string(),
longdesc :: string(),
version :: integer(),
module :: atom(),
function :: atom(),
args :: [aterm()],
policy :: open | restricted | admin | user,
access :: [{atom(),atom(),atom()}|atom()],
result :: rterm()}.
-type ejabberd_commands() :: #ejabberd_commands{name :: atom(),
tags :: [atom()],
desc :: string(),
longdesc :: string(),
version :: integer(),
note :: string(),
weight :: integer(),
module :: atom(),
function :: atom(),
args :: [aterm()],
policy :: open | restricted | admin | user,
access :: [{atom(),atom(),atom()}|atom()],
definer :: atom(),
result :: rterm(),
args_rename :: [{atom(),atom()}],
args_desc :: none | [string()] | '_',
result_desc :: none | string() | '_',
args_example :: none | [any()] | '_',
result_example :: any()
}.
%% @type ejabberd_commands() = #ejabberd_commands{
%% name = atom(),
%% tags = [atom()],
%% desc = string(),
%% longdesc = string(),
%% module = atom(),
%% function = atom(),
%% args = [aterm()],
%% result = rterm()
%% }.
%% desc: Description of the command
%% args: Describe the accepted arguments.
%% This way the function that calls the command can format the
%% arguments before calling.
%% @type atype() = integer | string | {tuple, [aterm()]} | {list, aterm()}.
%% Allowed types for arguments are integer, string, tuple and list.
%% @type rtype() = integer | string | atom | {tuple, [rterm()]} | {list, rterm()} | rescode | restuple.
%% A rtype is either an atom or a tuple with two elements.
%% @type aterm() = {Name::atom(), Type::atype()}.
%% An argument term is a tuple with the term name and the term type.
%% @type rterm() = {Name::atom(), Type::rtype()}.
%% A result term is a tuple with the term name and the term type.
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+70
View File
@@ -0,0 +1,70 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License along
%%% with this program; if not, write to the Free Software Foundation, Inc.,
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
-record(serialize_mam_v1, {
serverhost :: binary(),
username :: binary(),
timestamp :: integer(),
peer :: binary(),
type :: chat | groupchat,
nick :: binary(),
origin_id :: binary(),
packet :: binary()
}).
-record(serialize_mam_prefs_v1, {
serverhost :: binary(),
username :: binary(),
default :: atom(),
always :: term(),
never :: term()
}).
-record(serialize_roster_v1, {
serverhost :: binary(),
username :: binary(),
version :: binary() | undefined,
entries :: [{binary(),
binary(),
[binary()],
both | from | to | none,
boolean(),
subscribe | unsubscribe | both | in | out | none,
binary()}]
}).
-record(serialize_auth_v1, {
serverhost :: binary(),
username :: binary(),
passwords :: [binary() | {sha | sha256 | sha512, binary(), binary(), binary(), integer()}]
}).
-record(serialize_muc_room_v1, {
serverhost :: binary(),
name :: binary(),
host :: binary(),
options:: [{atom(), term()}]
}).
-record(serialize_muc_registrations_v1, {
serverhost :: binary(),
host :: binary(),
jid :: binary(),
nick :: binary()
}).
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+34 -14
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -29,22 +29,42 @@
-define(SQL_INSERT_MARK, sql_insert__mark_).
-define(SQL_INSERT(Table, Fields), ?SQL_INSERT_MARK(Table, Fields)).
-ifdef(COMPILER_REPORTS_ONLY_LINES).
-record(sql_query, {hash :: binary(),
format_query :: fun(),
format_res :: fun(),
args :: fun(),
loc :: {module(), pos_integer()}}).
-else.
-record(sql_query, {hash :: binary(),
format_query :: fun(),
format_res :: fun(),
args :: fun(),
flags :: non_neg_integer(),
loc :: {module(), {pos_integer(), pos_integer()}}}).
-endif.
-record(sql_escape, {string :: fun((binary()) -> binary()),
integer :: fun((integer()) -> binary()),
boolean :: fun((boolean()) -> binary()),
in_array_string :: fun((binary()) -> binary()),
like_escape :: fun(() -> binary())}).
-record(sql_escape, {
string :: fun((binary()) -> binary() | atom()),
integer :: fun((integer()) -> binary() | atom()),
boolean :: fun((boolean()) -> binary() | atom()),
timestamp :: fun((calendar:datetime()) -> binary() | atom()),
in_array_string :: fun((binary()) -> binary() | atom()),
like_escape :: fun(() -> binary() | atom())
}).
-record(sql_index, {columns,
unique = false :: boolean(),
meta = #{}}).
-record(sql_column, {name :: binary(),
type,
nullable = false,
default = false,
opts = []}).
-record(sql_table, {name :: binary(),
columns :: [#sql_column{}],
indices = [] :: [#sql_index{}],
post_create}).
-record(sql_schema, {version :: integer(),
tables :: [#sql_table{}],
update = []}).
-record(sql_references, {table :: binary(),
column :: binary()}).
-record(sql_schema_info,
{db_type :: pgsql | mysql | sqlite,
db_version :: any(),
multihost_schema = true :: boolean()}).
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
-27
View File
@@ -1,27 +0,0 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License along
%%% with this program; if not, write to the Free Software Foundation, Inc.,
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
-ifdef(DEPRECATED_GET_STACKTRACE).
-define(EX_RULE(Class, Reason, Stack), Class:Reason:Stack).
-define(EX_STACK(Stack), Stack).
-else.
-define(EX_RULE(Class, Reason, _), Class:Reason).
-define(EX_STACK(_), erlang:get_stacktrace()).
-endif.
+20 -4
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -62,6 +62,11 @@
[{<<"type">>, Type}, {<<"name">>, Name},
{<<"value">>, Value}])).
-define(INPUTPH(Type, Name, Value, PlaceHolder),
?XA(<<"input">>,
[{<<"type">>, Type}, {<<"name">>, Name},
{<<"value">>, Value}, {<<"placeholder">>, PlaceHolder}])).
-define(INPUTT(Type, Name, Value),
?INPUT(Type, Name, (translate:translate(Lang, Value)))).
@@ -95,16 +100,27 @@
-define(XRES(Text),
?XAC(<<"p">>, [{<<"class">>, <<"result">>}], Text)).
-define(DIVRES(Elements),
?XAE(<<"div">>, [{<<"class">>, <<"result">>}], Elements)).
%% Guide Link
-define(XREST(Text), ?XRES((translate:translate(Lang, Text)))).
-define(GL(Ref, Title),
?XAE(<<"div">>, [{<<"class">>, <<"guidelink">>}],
[?XAE(<<"a">>,
[{<<"href">>, <<"https://docs.ejabberd.im/admin/configuration/", Ref/binary>>},
[{<<"href">>, <<"https://docs.ejabberd.im/", Ref/binary>>},
{<<"target">>, <<"_blank">>}],
[?C(<<"docs: ", Title/binary>>)])])).
%% h1 with a Guide Link
-define(H1GL(Name, Ref, Title),
[?XC(<<"h1">>, Name), ?GL(Ref, Title)]).
-define(H1GLraw(Name, Ref, Title),
[?XC(<<"h1">>, Name), ?GL(Ref, Title), ?BR, ?BR]).
-define(H1GL(Name, RefConf, Title),
?H1GLraw(Name, <<"admin/configuration/", RefConf/binary>>, Title)).
-define(ANCHORL(Ref),
?XAE(<<"div">>, [{<<"class">>, <<"anchorlink">>}],
[?XAE(<<"a">>,
[{<<"href">>, <<"#", Ref/binary>>}],
[?C(unicode:characters_to_binary(""))])])).
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+32 -25
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -19,41 +19,48 @@
%%%----------------------------------------------------------------------
-define(PRINT(Format, Args), io:format(Format, Args)).
-ifdef(LAGER).
-compile([{parse_transform, lager_transform}]).
-define(DEBUG(Format, Args),
begin lager:debug(Format, Args), ok end).
-define(INFO_MSG(Format, Args),
begin lager:info(Format, Args), ok end).
-define(WARNING_MSG(Format, Args),
begin lager:warning(Format, Args), ok end).
-define(ERROR_MSG(Format, Args),
begin lager:error(Format, Args), ok end).
-define(CRITICAL_MSG(Format, Args),
begin lager:critical(Format, Args), ok end).
-else.
-include_lib("kernel/include/logger.hrl").
-define(CLEAD, "\e[1"). % bold
-define(CMID, "\e[0"). % normal
-define(CCLEAN, "\e[0m"). % clean
-define(CDEFAULT, ";49;95m"). % light magenta
-define(CDEBUG, ";49;90m"). % dark gray
-define(CINFO, ";49;92m"). % green
-define(CWARNING, ";49;93m"). % light yellow
-define(CERROR, ";49;91m"). % light magenta
-define(CCRITICAL,";49;31m"). % light red
-define(DEBUG(Format, Args),
begin ?LOG_DEBUG(Format, Args), ok end).
begin ?LOG_DEBUG(Format, Args,
#{clevel => ?CLEAD ++ ?CDEBUG,
ctext => ?CMID ++ ?CDEBUG}),
ok end).
-define(INFO_MSG(Format, Args),
begin ?LOG_INFO(Format, Args), ok end).
begin ?LOG_INFO(Format, Args,
#{clevel => ?CLEAD ++ ?CINFO,
ctext => ?CCLEAN}),
ok end).
-define(WARNING_MSG(Format, Args),
begin ?LOG_WARNING(Format, Args), ok end).
begin ?LOG_WARNING(Format, Args,
#{clevel => ?CLEAD ++ ?CWARNING,
ctext => ?CMID ++ ?CWARNING}),
ok end).
-define(ERROR_MSG(Format, Args),
begin ?LOG_ERROR(Format, Args), ok end).
begin ?LOG_ERROR(Format, Args,
#{clevel => ?CLEAD ++ ?CERROR,
ctext => ?CMID ++ ?CERROR}),
ok end).
-define(CRITICAL_MSG(Format, Args),
begin ?LOG_CRITICAL(Format, Args), ok end).
-endif.
begin ?LOG_CRITICAL(Format, Args,
#{clevel => ?CLEAD++ ?CCRITICAL,
ctext => ?CMID ++ ?CCRITICAL}),
ok end).
%% Use only when trying to troubleshoot test problem with ExUnit
-define(EXUNIT_LOG(Format, Args),
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -18,13 +18,19 @@
%%%
%%%----------------------------------------------------------------------
-record(local_config, {key :: any(), value :: any()}).
-define(MODULE_ANTISPAM, mod_antispam).
-type local_config() :: #local_config{}.
-type url() :: binary().
-type filename() :: binary() | none | false.
-type jid_set() :: sets:set(ljid()).
-type url_set() :: sets:set(url()).
-record(state,
{opts = [] :: [acl:acl() | local_config()],
hosts = [] :: [binary()],
override_local = false :: boolean(),
override_global = false :: boolean(),
override_acls = false :: boolean()}).
-define(DEFAULT_RTBL_DOMAINS_NODE, <<"spam_source_domains">>).
-record(rtbl_service,
{host = none :: binary() | none,
node = ?DEFAULT_RTBL_DOMAINS_NODE :: binary(),
subscribed = false :: boolean(),
retry_timer = undefined :: reference() | undefined}).
-type rtbl_service() :: #rtbl_service{}.
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+23
View File
@@ -0,0 +1,23 @@
-define(INVITE_TOKEN_EXPIRE_SECONDS_DEFAULT, 5*86400).
-define(INVITE_TOKEN_LENGTH_DEFAULT, 24).
-define(NS_INVITE_INVITE, <<"urn:xmpp:invite#invite">>).
-define(NS_INVITE_CREATE_ACCOUNT, <<"urn:xmpp:invite#create-account">>).
-define(OVERUSE_LIMIT, 1000).
-define(SPEEDY_GOAT_LEVELS, 2).
-define(SPEEDY_GOAT_SECONDS, 300).
-record(invite_token, {token :: binary(),
inviter :: {binary(), binary()},
%% A non-empty value if `invitee` indicates the invite has been used.
invitee = <<>> :: binary(),
created_at = calendar:now_to_datetime(erlang:timestamp()) :: calendar:datetime(),
expires = calendar:gregorian_seconds_to_datetime(calendar:datetime_to_gregorian_seconds(calendar:now_to_datetime(erlang:timestamp())) + ?INVITE_TOKEN_EXPIRE_SECONDS_DEFAULT) :: calendar:datetime(),
type = roster_only :: roster_only | account_only | account_subscription,
%% If type is 'roster_only' then we indicate a token has been used to create
%% an account (if allowed) by setting `account_name` to the name of the user
%% (which should match `invitee`).
account_name = <<>> :: binary()
}).
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+3 -2
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -26,7 +26,8 @@
bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid(),
packet = #xmlel{} :: xmlel() | message(),
nick = <<"">> :: binary(),
type = chat :: chat | groupchat}).
type = chat :: chat | groupchat,
origin_id = <<"">> :: binary()}).
-record(archive_prefs,
{us = {<<"">>, <<"">>} :: {binary(), binary()},
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -18,5 +18,19 @@
%%%
%%%----------------------------------------------------------------------
-record(vcard_xupdate, {us = {<<>>, <<>>} :: {binary(), binary()},
hash = <<>> :: binary()}).
-record(room_version,
{id :: binary(),
%% use the same field names as in Synapse
enforce_key_validity :: boolean(),
special_case_aliases_auth :: boolean(),
strict_canonicaljson :: boolean(),
limit_notifications_power_levels :: boolean(),
knock_join_rule :: boolean(),
restricted_join_rule :: boolean(),
restricted_join_rule_fix :: boolean(),
knock_restricted_join_rule :: boolean(),
enforce_int_power_levels :: boolean(),
implicit_room_creator :: boolean(),
updated_redaction_rules :: boolean(),
hydra :: boolean()
}).
+4 -3
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -23,8 +23,9 @@
opts = [] :: list() | '_'}).
-record(muc_registered,
{us_host = {{<<"">>, <<"">>}, <<"">>} :: {{binary(), binary()}, binary()} | '$1',
nick = <<"">> :: binary()}).
{us_host = {{<<"">>, <<"">>}, <<"">>} :: {{binary() | '$1', binary() | '$2'},
binary() | '_'} | '$1',
nick = <<"">> :: binary() | '$3'}).
-record(muc_online_room,
{name_host :: {binary(), binary()} | '$1' | {'_', binary()} | '_',
+13 -8
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -38,13 +38,13 @@
description = <<"">> :: binary(),
allow_change_subj = true :: boolean(),
allow_query_users = true :: boolean(),
allow_private_messages = true :: boolean(),
allowpm = anyone :: anyone | participants | moderators | none,
allow_private_messages_from_visitors = anyone :: anyone | moderators | nobody ,
allow_visitor_status = true :: boolean(),
allow_visitor_nickchange = true :: boolean(),
public = true :: boolean(),
public_list = true :: boolean(),
persistent = false :: boolean(),
persistent = false :: boolean() | {destroying, boolean()},
moderated = true :: boolean(),
captcha_protected = false :: boolean(),
members_by_default = true :: boolean(),
@@ -65,7 +65,7 @@
captcha_whitelist = (?SETS):empty() :: gb_sets:set(),
mam = false :: boolean(),
pubsub = <<"">> :: binary(),
enable_hats = false :: boolean(),
enable_hats = true :: boolean(),
lang = ejabberd_option:language() :: binary()
}).
@@ -81,7 +81,8 @@
role :: role(),
%%is_subscriber = false :: boolean(),
%%subscriptions = [] :: [binary()],
last_presence :: presence() | undefined
last_presence :: presence() | undefined,
occupant_id :: binary()
}).
-record(subscriber, {jid :: jid(),
@@ -122,18 +123,22 @@
robots = #{} :: robots(),
nicks = #{} :: nicks(),
affiliations = #{} :: affiliations(),
roles = #{} :: roles(),
history = #lqueue{} :: lqueue(),
subject = [] :: [text()],
subject_author = <<"">> :: binary(),
hats_users = #{} :: map(), % FIXME on OTP 21+: #{ljid() => #{binary() => binary()}},
subject_author = {<<"">>, #jid{}} :: {binary(), jid()},
hats_defs = #{} :: #{binary() => {binary(), binary()}},
hats_users = #{} :: #{ljid() => [binary()]},
just_created = erlang:system_time(microsecond) :: true | integer(),
activity = treap:empty() :: treap:treap(),
room_shaper = none :: ejabberd_shaper:shaper(),
room_queue :: p1_queue:queue({message | presence, jid()}) | undefined,
hibernate_timer = none :: reference() | none | hibernating
hibernate_timer = none :: reference() | none | hibernating,
salt = <<>> :: binary()
}).
-type users() :: #{ljid() => #user{}}.
-type robots() :: #{jid() => {binary(), stanza()}}.
-type nicks() :: #{binary() => [ljid()]}.
-type affiliations() :: #{ljid() => affiliation() | {affiliation(), binary()}}.
-type roles() :: #{ljid() => role() | {role(), binary()}}.
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+2 -2
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -19,6 +19,6 @@
%%%----------------------------------------------------------------------
-record(private_storage,
{usns = {<<"">>, <<"">>, <<"">>} :: {binary(), binary(), binary() |
{usns = {<<"">>, <<"">>, <<"">>} :: {binary() | '$1' | '_', binary(), binary() |
'$1' | '_'},
xml = #xmlel{} :: xmlel() | '_' | '$1'}).
+1 -1
View File
@@ -2,7 +2,7 @@
%%% RFC 1928 constants.
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,5 +1,5 @@
%%%----------------------------------------------------------------------
%%% ejabberd, Copyright (C) 2017-2022 ProcessOne
%%% ejabberd, Copyright (C) 2017-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+2 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -25,6 +25,7 @@
jid = {<<>>, <<>>, <<>>} :: jid:ljid(),
name = <<>> :: binary() | '_',
subscription = none :: subscription() | '_',
approved = false :: boolean() | '_',
ask = none :: ask() | '_',
groups = [] :: [binary()] | '_',
askmessage = <<"">> :: binary() | '_',
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%-------------------------------------------------------------------
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
%%% @copyright (C) 2002-2022 ProcessOne, SARL. All Rights Reserved.
%%% @copyright (C) 2002-2026 ProcessOne, SARL. All Rights Reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2022 ProcessOne
%%% ejabberd, Copyright (C) 2002-2026 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
Regular → Executable
View File
+1 -1
View File
@@ -41,7 +41,7 @@ defmodule Ejabberd.Config.Attr do
"""
@spec validate([attr]) :: [{:ok, attr}] | [{:error, attr, atom()}]
def validate(attrs) when is_list(attrs), do: Enum.map(attrs, &valid_attr?/1)
def validate(attr), do: validate([attr]) |> List.first
def validate(attr), do: validate([attr])
@doc """
Returns the type of an attribute, given its name.
+4 -7
View File
@@ -36,8 +36,8 @@ defmodule Ejabberd.Config do
case force do
true ->
Ejabberd.Config.Store.stop
Ejabberd.Config.Store.start_link
Ejabberd.Config.Store.stop()
Ejabberd.Config.Store.start_link()
do_init(file_path)
false ->
if not init_already_executed, do: do_init(file_path)
@@ -105,11 +105,8 @@ defmodule Ejabberd.Config do
Code.eval_file(file_path) |> extract_and_store_module_name()
# Getting start/0 config
Ejabberd.Config.Store.get(:module_name)
|> case do
nil -> IO.puts "[ ERR ] Configuration module not found."
[module] -> call_start_func_and_store_data(module)
end
[module] = Ejabberd.Config.Store.get(:module_name)
call_start_func_and_store_data(module)
# Fetching git modules and install them
get_modules_parsed_in_order()
-1
View File
@@ -13,7 +13,6 @@ defmodule Ejabberd.Config.EjabberdHook do
@doc """
Register a hook to ejabberd.
"""
@spec start(EjabberdHook.t) :: none
def start(%EjabberdHook{hook: hook, opts: opts, fun: fun}) do
host = Keyword.get(opts, :host, :global)
priority = Keyword.get(opts, :priority, 50)
+6 -6
View File
@@ -7,12 +7,13 @@ defmodule Ejabberd.Config.EjabberdModule do
the already existing Elixir.Module.
"""
@type t :: %{module: atom, attrs: [Attr.t]}
defstruct [:module, :attrs]
alias Ejabberd.Config.EjabberdModule
alias Ejabberd.Config.Validation
alias Ejabberd.Config.Attr
@type t :: %{module: atom, attrs: [Attr.attr]}
defstruct [:module, :attrs]
@doc """
Given a list of modules / single module
@@ -29,7 +30,6 @@ defmodule Ejabberd.Config.EjabberdModule do
a git attribute and tries to fetch the repo,
then, it install them through :ext_mod.install/1
"""
@spec fetch_git_repos([EjabberdModule.t]) :: none()
def fetch_git_repos(modules) do
modules
|> Enum.filter(&is_git_module?/1)
@@ -60,7 +60,7 @@ defmodule Ejabberd.Config.EjabberdModule do
defp fetch_and_store_repo_source_if_not_exists(path, repo) do
unless File.exists?(path) do
IO.puts "[info] Fetching: #{repo}"
:os.cmd('git clone #{repo} #{path}')
:os.cmd(~c"git clone #{repo} #{path}")
end
end
@@ -17,9 +17,9 @@ defmodule Ejabberd.Config.EjabberdLogger do
end
defp do_log_errors({:ok, _mod}), do: nil
defp do_log_errors({:error, _mod, errors}), do: Enum.each errors, &do_log_errors/1
defp do_log_errors({:attribute, errors}), do: Enum.each errors, &log_attribute_error/1
defp do_log_errors({:dependency, errors}), do: Enum.each errors, &log_dependency_error/1
defp do_log_errors({:error, _mod, errors}), do: (Enum.each errors, &do_log_errors/1)
defp do_log_errors({:attribute, errors}), do: (Enum.each errors, &log_attribute_error/1)
defp do_log_errors({:dependency, errors}), do: (Enum.each errors, &log_dependency_error/1)
defp log_attribute_error({{attr_name, _val}, :attr_not_supported}), do:
IO.puts "[ WARN ] Annotation @#{attr_name} is not supported."
+4 -4
View File
@@ -14,15 +14,12 @@ defmodule Ejabberd.Config.OptsFormatter do
Look at how Config.get_ejabberd_opts/0 is constructed for
more informations.
"""
@spec format_opts_for_ejabberd([{atom(), any()}]) :: list()
@spec format_opts_for_ejabberd(map) :: list()
def format_opts_for_ejabberd(opts) do
opts
|> format_attrs_for_ejabberd
end
defp format_attrs_for_ejabberd(opts) when is_list(opts),
do: Enum.map opts, &format_attrs_for_ejabberd/1
defp format_attrs_for_ejabberd({:listeners, mods}),
do: {:listen, format_listeners_for_ejabberd(mods)}
@@ -32,6 +29,9 @@ defmodule Ejabberd.Config.OptsFormatter do
defp format_attrs_for_ejabberd({key, opts}) when is_atom(key),
do: {key, opts}
defp format_attrs_for_ejabberd(opts),
do: (Enum.map opts, &format_attrs_for_ejabberd/1)
defp format_mods_for_ejabberd(mods) do
Enum.map mods, fn %EjabberdModule{module: mod, attrs: attrs} ->
{mod, attrs[:opts]}
+3 -3
View File
@@ -3,12 +3,12 @@ defmodule Ejabberd.Config.Validation do
Module used to validate a list of modules.
"""
@type mod_validation :: {[EjabberdModule.t], EjabberdModule.t, map}
@type mod_validation_result :: {:ok, EjabberdModule.t} | {:error, EjabberdModule.t, map}
alias Ejabberd.Config.EjabberdModule
alias Ejabberd.Config.Validator
@type mod_validation :: {[EjabberdModule.t], EjabberdModule.t, map}
@type mod_validation_result :: {:ok, EjabberdModule.t} | {:error, EjabberdModule.t, map}
@doc """
Given a module or a list of modules it runs validators on them
and returns {:ok, mod} or {:error, mod, errors}, for each
@@ -3,11 +3,12 @@ defmodule Ejabberd.Config.Validator.Attrs do
Validator module used to validate attributes.
"""
# TODO: Duplicated from validator.ex !!!
@type mod_validation :: {[EjabberdModule.t], EjabberdModule.t, map}
import Ejabberd.Config.ValidatorUtility
alias Ejabberd.Config.Attr
alias Ejabberd.Config.EjabberdModule
# TODO: Duplicated from validator.ex !!!
@type mod_validation :: {[EjabberdModule.t], EjabberdModule.t, map}
@doc """
Given a module (with the form used for validation)
@@ -17,9 +18,9 @@ defmodule Ejabberd.Config.Validator.Attrs do
@spec validate(mod_validation) :: mod_validation
def validate({modules, mod, errors}) do
errors = Enum.reduce mod.attrs, errors, fn(attr, err) ->
case Attr.validate(attr) do
{:ok, _attr} -> err
{:error, attr, cause} -> put_error(err, :attribute, {attr, cause})
case Attr.validate([attr]) do
[{:ok, _attr}] -> err
[{:error, attr, cause}] -> put_error(err, :attribute, {attr, cause})
end
end
@@ -4,6 +4,8 @@ defmodule Ejabberd.Config.Validator.Dependencies do
with the @dependency annotation.
"""
alias Ejabberd.Config.EjabberdModule
# TODO: Duplicated from validator.ex !!!
@type mod_validation :: {[EjabberdModule.t], EjabberdModule.t, map}
import Ejabberd.Config.ValidatorUtility
@@ -4,8 +4,6 @@ defmodule Ejabberd.Config.ValidatorUtility do
Imports utility functions for working with validation structures.
"""
alias Ejabberd.Config.EjabberdModule
@doc """
Inserts an error inside the errors collection, for the given key.
If the key doesn't exists then it creates an empty collection
@@ -22,7 +20,6 @@ defmodule Ejabberd.Config.ValidatorUtility do
Given a list of modules it extracts and returns a list
of the module names (which are Elixir.Module).
"""
@spec extract_module_names(EjabberdModule.t) :: [atom]
def extract_module_names(modules) when is_list(modules) do
modules
|> Enum.map(&Map.get(&1, :module))
+1 -1
View File
@@ -7,7 +7,7 @@ defmodule Ejabberd.ConfigUtil do
@doc """
Returns true when the config file is based on elixir.
"""
@spec is_elixir_config(list) :: boolean
@spec is_elixir_config(binary) :: boolean
def is_elixir_config(filename) when is_list(filename) do
is_elixir_config(to_string(filename))
end
-19
View File
@@ -1,19 +0,0 @@
defmodule Ejabberd.Module do
defmacro __using__(opts) do
logger_enabled = Keyword.get(opts, :logger, true)
quote do
@behaviour :gen_mod
import Ejabberd.Module
unquote(if logger_enabled do
quote do: import Ejabberd.Logger
end)
end
end
# gen_mod callbacks
def depends(_host, _opts), do: []
def mod_opt_type(_), do: []
end
+44
View File
@@ -0,0 +1,44 @@
defmodule Ejabberd.Auth.Example do
@moduledoc """
Example ejabberd auth method written in Elixir.
This is an example to demonstrate the usage of Elixir to
create ejabberd auth methods.
Example configuration:
auth_method: 'Ejabberd.Auth.Example'
"""
@behaviour :ejabberd_auth
import Ejabberd.Logger
@impl true
def start(host) do
info("Starting Ejabberd.Auth.Example to authenticate '#{host}' users")
nil
end
@impl true
def stop(host) do
info("Stopping Ejabberd.Auth.Example to authenticate '#{host}' users")
nil
end
@impl true
def check_password("alice", _authz_id, _host, "secret"), do: {:nocache, true}
def check_password(_username, _authz_id, _host, _secret), do: {:nocache, false}
@impl true
def user_exists("alice", _host), do: {:nocache, true}
def user_exists(_username, _host), do: {:nocache, false}
@impl true
def plain_password_required(_binary), do: true
@impl true
def store_type(_host), do: :external
@impl true
def use_cache(_host), do: false
end
+3 -3
View File
@@ -14,15 +14,15 @@ defmodule Mix.Tasks.Ejabberd.Deps.Tree do
def run(_argv) do
# First we need to start manually the store to be available
# during the compilation of the config file.
Ejabberd.Config.Store.start_link
Ejabberd.Config.Store.start_link()
Ejabberd.Config.init(:ejabberd_config.path())
Mix.shell.info "ejabberd modules"
Mix.shell().info "ejabberd modules"
Ejabberd.Config.Store.get(:modules)
|> Enum.reverse # Because of how mods are stored inside the store
|> format_mods
|> Mix.shell.info
|> Mix.shell().info
end
defp format_mods(mods) when is_list(mods) do
+46
View File
@@ -0,0 +1,46 @@
defmodule Ejabberd.Module.Example do
@moduledoc """
Example ejabberd module written in Elixir.
This is an example to demonstrate the usage of Elixir to
create ejabberd modules.
Example configuration:
modules:
'Ejabberd.Module.Example': {}
"""
@behaviour :gen_mod
import Ejabberd.Logger
def start(host, _opts) do
info("Starting Ejabberd.Module.Example for host '#{host}'")
Ejabberd.Hooks.add(:set_presence_hook, host, __MODULE__, :on_presence, 50)
:ok
end
def stop(host) do
info("Stopping Ejabberd.Module.Example for host '#{host}'")
Ejabberd.Hooks.delete(:set_presence_hook, host, __MODULE__, :on_presence, 50)
:ok
end
def on_presence(user, _server, _resource, _packet) do
info("Receive presence for #{user}")
:none
end
def depends(_host, _opts) do
[]
end
def mod_options(_host) do
[]
end
def mod_doc() do
%{:desc => "This is just a demonstration."}
end
end
-33
View File
@@ -1,33 +0,0 @@
defmodule ModPresenceDemo do
use Ejabberd.Module
def start(host, _opts) do
info('Starting ejabberd module Presence Demo')
Ejabberd.Hooks.add(:set_presence_hook, host, __MODULE__, :on_presence, 50)
:ok
end
def stop(host) do
info('Stopping ejabberd module Presence Demo')
Ejabberd.Hooks.delete(:set_presence_hook, host, __MODULE__, :on_presence, 50)
:ok
end
def on_presence(user, _server, _resource, _packet) do
info('Receive presence for #{user}')
:none
end
def depends(_host, _opts) do
[]
end
def mod_options(_host) do
[]
end
def mod_doc() do
%{:desc => 'This is just a demonstration.'}
end
end
+1 -1
View File
@@ -75,7 +75,7 @@ EOF
if test "x`cat conftest.out`" != "xok"; then
AC_MSG_RESULT([failed])
X="`cat conftest.out`"
if test "[$3]" == "warn"; then
if test "[$3]" = "warn"; then
AC_MSG_WARN([$X])
else
AC_MSG_FAILURE([$X])
+2227 -501
View File
File diff suppressed because it is too large Load Diff
+117 -98
View File
@@ -3,31 +3,34 @@ defmodule Ejabberd.MixProject do
def project do
[app: :ejabberd,
source_url: "https://github.com/processone/ejabberd",
version: version(),
description: description(),
elixir: elixir_required_version(),
elixir: "~> 1.14",
elixirc_paths: ["lib"],
compile_path: ".",
compilers: [:asn1] ++ Mix.compilers,
compilers: [:asn1, :yecc] ++ Mix.compilers(),
erlc_options: erlc_options(),
erlc_paths: ["asn1", "src"],
# Elixir tests are starting the part of ejabberd they need
aliases: [test: "test --no-start"],
start_permanent: Mix.env() == :prod,
language: :erlang,
dialyzer: dialyzer(),
releases: releases(),
package: package(),
docs: docs(),
deps: deps()]
end
def version do
case config(:vsn) do
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
'0.0' -> "0.0.0" # the full git repository wasn't downloaded
'latest.0' -> "0.0.0" # running 'docker-ejabberd/ecs/build.sh latest'
~c"0.0" -> "0.0.0" # the full git repository wasn't downloaded
~c"latest.0" -> "0.0.0" # running 'docker-ejabberd/ecs/build.sh latest'
[_, _, ?., _, _] = x ->
head = String.replace(:erlang.list_to_binary(x), ~r/\.0+([0-9])/, ".\\1")
<<head::binary, ".0">>
"#{head}.0"
vsn -> String.replace(:erlang.list_to_binary(vsn), ~r/\.0+([0-9])/, ".\\1")
end
end
@@ -40,14 +43,24 @@ defmodule Ejabberd.MixProject do
def application do
[mod: {:ejabberd_app, []},
extra_applications: [:mix],
applications: [:idna, :inets, :kernel, :sasl, :ssl, :stdlib,
:base64url, :fast_tls, :fast_xml, :fast_yaml, :jiffy, :jose,
:p1_utils, :stringprep, :yconf],
extra_applications: [:inets, :kernel, :sasl, :ssl, :stdlib, :syntax_tools,
:logger, :mix]
++ cond_apps(),
included_applications: [:mnesia, :os_mon,
:cache_tab, :eimp, :mqtree, :p1_acme,
:p1_oauth2, :pkix, :xmpp]
++ cond_apps()]
:p1_oauth2, :pkix]
++ cond_included_apps()]
end
defp dialyzer do
[
plt_add_apps: [
:mnesia, :odbc, :os_mon, :stdlib,
:eredis, :luerl,
:cache_tab, :eimp, :epam, :esip, :ezlib, :mqtree,
:p1_acme, :p1_mysql, :p1_oauth2, :p1_pgsql, :pkix,
:sqlite3, :stun, :xmpp],
]
end
defp if_version_above(ver, okResult) do
@@ -68,20 +81,15 @@ defmodule Ejabberd.MixProject do
defp erlc_options do
# Use our own includes + includes from all dependencies
includes = ["include"] ++ deps_include(["fast_xml", "xmpp", "p1_utils"])
includes = ["include", deps_include()]
result = [{:d, :ELIXIR_ENABLED}] ++
cond_options() ++
if Mix.env == :test do [{:d, :TEST}] else [] end ++
Enum.map(includes, fn (path) -> {:i, path} end) ++
if_version_above('20', [{:d, :DEPRECATED_GET_STACKTRACE}]) ++
if_version_above('20', [{:d, :HAVE_URI_STRING}]) ++
if_version_above('20', [{:d, :HAVE_ERL_ERROR}]) ++
if_version_below('21', [{:d, :USE_OLD_HTTP_URI}]) ++
if_version_below('22', [{:d, :LAGER}]) ++
if_version_below('21', [{:d, :NO_CUSTOMIZE_HOSTNAME_CHECK}]) ++
if_version_below('23', [{:d, :USE_OLD_CRYPTO_HMAC}]) ++
if_version_below('23', [{:d, :USE_OLD_PG2}]) ++
if_version_below('24', [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++
if_version_below('24', [{:d, :SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL}])
if_version_below(~c"26", [{:d, :OTP_BELOW_26}]) ++
if_version_below(~c"27", [{:d, :OTP_BELOW_27}]) ++
if_version_below(~c"27", [{:feature, :maybe_expr, :enable}]) ++
if_version_below(~c"28", [{:d, :OTP_BELOW_28}])
defines = for {:d, value} <- result, do: {:d, value}
result ++ [{:d, :ALL_DEFS, defines}]
end
@@ -92,34 +100,34 @@ defmodule Ejabberd.MixProject do
{config(:debug), :debug_info},
{not config(:debug), {:debug_info, false}},
{config(:roster_gateway_workaround), {:d, :ROSTER_GATEWAY_WORKAROUND}},
{config(:new_sql_schema), {:d, :NEW_SQL_SCHEMA}}
{config(:multihost_sql_schema), {:d, :MULTIHOST_SQL_SCHEMA}}
], do:
option
end
defp deps do
[{:base64url, "~> 1.0"},
{:cache_tab, "~> 1.0"},
[{:cache_tab, "~> 1.0"},
{:dialyxir, "~> 1.2", only: [:test], runtime: false},
{:eimp, "~> 1.0"},
{:fast_tls, "~> 1.1"},
{:fast_xml, "~> 1.1"},
{:erlydtl, "~> 0.14.0"},
{:ex_doc, "~> 0.31", only: [:edoc], runtime: false},
{:fast_tls, "~> 1.1.24"},
{:fast_xml, "~> 1.1.56"},
{:fast_yaml, "~> 1.0"},
{:idna, "~> 6.0"},
{:jiffy, "~> 1.1.1"},
{:jose, "~> 1.11.1"},
{:idna, "~> 7.1"},
{:mqtree, "~> 1.0"},
{:p1_acme, "~> 1.0"},
{:p1_acme, ">= 1.0.28"},
{:p1_oauth2, "~> 0.6"},
{:p1_utils, "~> 1.0"},
{:pkix, "~> 1.0"},
{:stringprep, ">= 1.0.26"},
{:xmpp, "~> 1.5"},
{:yconf, "~> 1.0"}]
{:xmpp, ">= 1.13.1"},
{:yconf, ">= 1.0.22"}]
++ cond_deps()
end
defp deps_include(deps) do
base = if Mix.Project.umbrella?() do
defp deps_include() do
if Mix.Project.umbrella?() do
"../../deps"
else
case Mix.Project.deps_paths()[:ejabberd] do
@@ -127,28 +135,43 @@ defmodule Ejabberd.MixProject do
_ -> ".."
end
end
Enum.map(deps, fn dep -> base<>"/#{dep}/include" end)
end
defp cond_deps do
for {:true, dep} <- [{config(:pam), {:epam, "~> 1.0"}},
{config(:redis), {:eredis, "~> 1.2.0"}},
{Mix.env() == :translations,
{:ejabberd_po, git: "https://github.com/processone/ejabberd-po.git"}},
{Mix.env() == :dev,
{:exsync, "~> 0.2", optional: true, runtime: false}},
{config(:redis), {:eredis, "~> 1.7.1"}},
{config(:sip), {:esip, "~> 1.0"}},
{config(:zlib), {:ezlib, "~> 1.0"}},
{if_version_below('22', true), {:lager, "~> 3.9.1"}},
{config(:lua), {:luerl, "~> 1.0"}},
{config(:mysql), {:p1_mysql, "~> 1.0"}},
{config(:pgsql), {:p1_pgsql, "~> 1.1"}},
{if_version_below(~c"27", true), {:jiffy, "~> 1.1.1"}},
{if_version_below(~c"26", true), {:jose, "1.11.10", override: true}},
{if_version_above(~c"25", true), {:jose, "~> 1.11.12"}},
{config(:lua), {:luerl, "~> 1.2.0"}},
{config(:mysql), {:p1_mysql, ">= 1.0.28"}},
{config(:pgsql), {:p1_pgsql, ">= 1.1.38"}},
{config(:sqlite), {:sqlite3, "~> 1.1"}},
{config(:stun), {:stun, "~> 1.0"}}], do:
dep
end
defp cond_apps do
for {:true, app} <- [{config(:stun), :stun},
{if_version_below(~c"27", true), :jiffy},
{config(:tools), :debugger},
{config(:tools), :observer},
{config(:tools), :wx}], do:
app
end
defp cond_included_apps do
for {:true, app} <- [{config(:pam), :epam},
{config(:lua), :luerl},
{config(:redis), :eredis},
{if_version_below('22', true), :lager},
{Mix.env() == :edoc, :ex_doc},
{Mix.env() == :test, :dialyxir},
{config(:mysql), :p1_mysql},
{config(:sip), :esip},
{config(:odbc), :odbc},
@@ -161,19 +184,30 @@ defmodule Ejabberd.MixProject do
[# These are the default files included in the package
files: ["include", "lib", "priv", "sql", "src",
"COPYING", "README.md",
"ejabberd.yml.example", "config/runtime.exs",
"mix.exs", "rebar.config", "rebar.config.script", "vars.config"],
maintainers: ["ProcessOne"],
licenses: ["GPLv2"],
links: %{"Site" => "https://www.ejabberd.im",
"Documentation" => "http://docs.ejabberd.im",
"Source" => "https://github.com/processone/ejabberd",
"ProcessOne" => "http://www.process-one.net/"}]
licenses: ["GPL-2.0-or-later"],
links: %{"ejabberd.im" => "https://www.ejabberd.im",
"ejabberd Docs" => "https://docs.ejabberd.im",
"GitHub" => "https://github.com/processone/ejabberd",
"ProcessOne" => "https://www.process-one.net/"}]
end
defp vars do
case :file.consult("vars.config") do
filepath = case Application.fetch_env(:ejabberd, :vars_config_path) do
:error ->
"vars.config"
{:ok, path} ->
path
end
config2 = case :file.consult(filepath) do
{:ok,config} -> config
_ -> [zlib: true]
_ -> [stun: true, zlib: true]
end
case Mix.env() do
:dev -> List.keystore(config2, :tools, 0, {:tools, true})
_ -> config2
end
end
@@ -184,35 +218,6 @@ defmodule Ejabberd.MixProject do
end
end
defp elixir_required_version do
case {Map.get(System.get_env(), "RELIVE", "false"),
MapSet.member?(MapSet.new(System.argv()), "release")}
do
{"true", _} ->
case Version.match?(System.version(), "~> 1.11") do
false ->
IO.puts("ERROR: To use 'make relive', Elixir 1.11.0 or higher is required.")
_ -> :ok
end
"~> 1.11"
{_, true} ->
case Version.match?(System.version(), "~> 1.10") do
false ->
IO.puts("ERROR: To build releases, Elixir 1.10.0 or higher is required.")
_ -> :ok
end
case Version.match?(System.version(), "< 1.11.4")
and :erlang.system_info(:otp_release) > '23' do
true ->
IO.puts("ERROR: To build releases with Elixir lower than 1.11.4, Erlang/OTP lower than 24 is required.")
_ -> :ok
end
"~> 1.10"
_ ->
"~> 1.4"
end
end
defp releases do
maybe_tar = case Mix.env() do
:prod -> [:tar]
@@ -222,6 +227,7 @@ defmodule Ejabberd.MixProject do
ejabberd: [
include_executables_for: [:unix],
# applications: [runtime_tools: :permanent]
strip_beams: Mix.env() != :dev,
steps: [&copy_extra_files/1, :assemble | maybe_tar]
]
]
@@ -238,6 +244,8 @@ defmodule Ejabberd.MixProject do
config_dir: config(:config_dir),
logs_dir: config(:logs_dir),
spool_dir: config(:spool_dir),
vsn: version(),
iexpath: config(:iexpath),
erl: config(:erl),
epmd: config(:epmd),
bindir: Path.join([config(:release_dir), "releases", version()]),
@@ -248,30 +256,15 @@ defmodule Ejabberd.MixProject do
ro = "rel/overlays"
File.rm_rf(ro)
# Elixir lower than 1.12.0 don't have System.shell
execute = fn(command) ->
case function_exported?(System, :shell, 1) do
true ->
System.shell(command)
false ->
:os.cmd(to_charlist(command))
end
end
# Mix/Elixir lower than 1.11.0 use config/releases.exs instead of runtime.exs
case Version.match?(System.version, "~> 1.11") do
true ->
:ok
false ->
execute.("cp config/runtime.exs config/releases.exs")
System.shell(command, into: IO.stream())
end
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.template > ejabberdctl.example1")
Mix.Generator.copy_template("ejabberdctl.example1", "ejabberdctl.example2", assigns)
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2> ejabberdctl.example2a")
Mix.Generator.copy_template("ejabberdctl.example2a", "ejabberdctl.example2b", assigns)
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2b > ejabberdctl.example3")
execute.("sed -e 's|^ERLANG_NODE=ejabberd@localhost|ERLANG_NODE=ejabberd|g' ejabberdctl.example3 > ejabberdctl.example4")
execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2b > ejabberdctl.example4")
execute.("sed -e 's|^ERLANG_OPTS=\"|ERLANG_OPTS=\"-boot ../releases/#{release.version}/start_clean -boot_var RELEASE_LIB ../lib |' ejabberdctl.example4 > ejabberdctl.example5")
execute.("sed -e 's|^INSTALLUSER=|ERL_OPTIONS=\"-setcookie \\$\\(cat \"\\${SCRIPT_DIR%/*}/releases/COOKIE\")\"\\nINSTALLUSER=|g' ejabberdctl.example5 > ejabberdctl.example6")
Mix.Generator.copy_template("ejabberdctl.example6", "#{ro}/bin/ejabberdctl", assigns)
@@ -319,13 +312,39 @@ defmodule Ejabberd.MixProject do
end
case Mix.env() do
:dev -> execute.("REL_DIR_TEMP=$PWD/rel/overlays/ rel/setup-dev.sh")
:dev -> execute.("REL_DIR_TEMP=$PWD/rel/overlays/ rel/setup-dev.sh mix")
_ -> :ok
end
release
end
defp docs do
[
main: "readme",
logo: "_build/edoc/logo.png",
source_ref: "master",
extra_section: "", # No need for Pages section name, it's the only one
api_reference: false, # API section has just Elixir, hide it
filter_modules: "aaaaa", # Module section has just Elixir modules, hide them
extras: [
"README.md": [title: "Readme"],
"COMPILE.md": [title: "Compile and Install"],
"CONTAINER.md": [title: "Container Image"],
"CONTRIBUTING.md": [title: "Contributing"],
"CONTRIBUTORS.md": [title: "Contributors"],
"CODE_OF_CONDUCT.md": [title: "Code of Conduct"],
"CHANGELOG.md": [title: "ChangeLog"],
"SECURITY.md": [title: "Security Policy"],
"COPYING": [title: "Copying License"],
"_build/edoc/docs.md": [title: "&xrArr; ejabberd Docs"]
],
groups_for_extras: [
"": Path.wildcard("*.md") ++ ["COPYING"],
"For more documentation": "_build/edoc/docs.md"
]
]
end
end
defmodule Mix.Tasks.Compile.Asn1 do
@@ -338,7 +357,7 @@ defmodule Mix.Tasks.Compile.Asn1 do
def run(args) do
{opts, _, _} = OptionParser.parse(args, switches: [force: :boolean])
project = Mix.Project.config
project = Mix.Project.config()
source_paths = project[:asn1_paths] || ["asn1"]
dest_paths = project[:asn1_target] || ["src"]
mappings = Enum.zip(source_paths, dest_paths)
@@ -360,7 +379,7 @@ defmodule Mix.Tasks.Compile.Asn1 do
end
def manifests, do: [manifest()]
defp manifest, do: Path.join(Mix.Project.manifest_path, @manifest)
defp manifest, do: Path.join(Mix.Project.manifest_path(), @manifest)
def clean, do: Erlang.clean(manifest())
end

Some files were not shown because too many files have changed in this diff Show More