Skip to content

Commit 541e07b

Browse files
committed
Copied CONTAINER.md from ejabberd 26.01
1 parent 5984f5a commit 541e07b

File tree

1 file changed

+74
-33
lines changed

1 file changed

+74
-33
lines changed

β€Žecs/README.mdβ€Ž

Lines changed: 74 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Next steps
105105

106106
### Register admin account
107107

108-
#### [![ejabberd Container](https://img.shields.io/badge/ejabberd-grey?logo=opencontainersinitiative&logoColor=2094f3)](https://github.com/processone/ejabberd/pkgs/container/ejabberd) [:orange_circle:](#images-comparison)
108+
#### [![ejabberd Container](https://img.shields.io/badge/ejabberd-grey?logo=opencontainersinitiative&logoColor=2094f3)](https://github.com/processone/ejabberd/pkgs/container/ejabberd) [πŸ”…](#images-comparison)
109109

110110
If you set the `REGISTER_ADMIN_PASSWORD` environment variable,
111111
an account is automatically registered with that password,
@@ -118,11 +118,20 @@ The account created depends on what variables you have set:
118118

119119
The account registration is shown in the container log:
120120

121-
```
122-
:> ejabberdctl register admin example.org somePassw0rd
123-
User admin@example.org successfully registered
121+
```bash
122+
$ podman run -it \
123+
--env EJABBERD_MACRO_HOST=example.org \
124+
--env EJABBERD_MACRO_ADMIN=juliet@example.org \
125+
--env REGISTER_ADMIN_PASSWORD=somePassw0rd \
126+
docker.io/ejabberd/ecs
127+
128+
:> ejabberdctl register juliet example.org somePassw0rd
129+
User juliet@example.org successfully registered
124130
```
125131

132+
This is implemented internally by using
133+
[Commands on start](#commands-on-start).
134+
126135
Alternatively, you can register the account manually yourself
127136
and edit `conf/ejabberd.yml` and add the ACL as explained in
128137
[ejabberd Docs: Administration Account](https://docs.ejabberd.im/admin/install/next-steps/#administration-account).
@@ -207,20 +216,21 @@ documentation section.
207216
Advanced
208217
--------
209218
210-
### Ports
211-
219+
### Ports 🟠
212220
The container image exposes several ports
213221
(check also [Docs: Firewall Settings](https://docs.ejabberd.im/admin/guide/security/#firewall-settings)):
214222
215223
- `5222`: The default port for XMPP clients.
216224
- `5269`: For XMPP federation. Only needed if you want to communicate with users on other servers.
217225
- `5280`: For admin interface (URL is `admin/`).
218-
- `1880`: For admin interface (URL is `/`, useful for [podman-desktop](https://podman-desktop.io/) and [docker-desktop](https://www.docker.com/products/docker-desktop/)) [:orange_circle:](#images-comparison)
219226
- `5443`: With encryption, used for admin interface, API, CAPTCHA, OAuth, Websockets and XMPP BOSH.
227+
- `1880`: For admin interface (URL is `/`, useful for [podman-desktop](https://podman-desktop.io/) and [docker-desktop](https://www.docker.com/products/docker-desktop/)) [πŸ”…](#images-comparison)
220228
- `1883`: Used for MQTT
229+
- `5478` UDP: STUN service 🟠
230+
- `50000-50099` UDP: TURN service 🟠
231+
- `7777`: SOCKS5 file transfer proxy 🟠
232+
- `5210`: Erlang connectivity when `ERL_DIST_PORT` is set, alternative to EPMD [πŸ”…](#images-comparison)
221233
- `4369-4399`: EPMD and Erlang connectivity, used for `ejabberdctl` and clustering
222-
- `5210`: Erlang connectivity when `ERL_DIST_PORT` is set, alternative to EPMD [:orange_circle:](#images-comparison)
223-
224234

225235
### Volumes
226236

@@ -270,7 +280,10 @@ If any of those commands returns a failure, the container starting gets aborted.
270280
If there is a command with a result that can be ignored,
271281
prefix that command with `!`
272282

273-
This example, registers an `admin@localhost` account when the container is first created.
283+
All this works when starting ejabberd with the default method `foreground`,
284+
not when using `live`, `iexlive`, ...
285+
286+
This example registers an `admin@localhost` account when the container is first created.
274287
Everytime the container starts, it shows the list of registered accounts,
275288
checks that the admin account exists and password is valid,
276289
changes the password of an account if it exists (ignoring any failure),
@@ -284,8 +297,37 @@ and shows the ejabberd starts (check also the [full example](#customized-example
284297
status
285298
```
286299

300+
Same example using Podman:
301+
```bash
302+
$ podman run -it \
303+
--env CTL_ON_CREATE="register admin localhost asd" \
304+
--env CTL_ON_START="stats registeredusers ; \
305+
check_password admin localhost asd ; \
306+
! change_password bot123 localhost qqq ; \
307+
status" \
308+
docker.io/ejabberd/ecs
309+
310+
...
311+
312+
:> ejabberdctl register admin localhost asd
313+
User admin@localhost successfully registered
314+
315+
:> ejabberdctl stats registeredusers
316+
1
317+
318+
:> ejabberdctl check_password admin localhost asd
319+
320+
:> ejabberdctl change_password bot123 localhost qqq
321+
{not_found,"unknown_user"}
322+
:> FAILURE in command 'change_password bot123 localhost qqq' !!! Ignoring result
323+
324+
:> ejabberdctl status
325+
The node ejabberd@localhost is started. Status: started
326+
ejabberd 25.10.0 is running in that node
327+
```
328+
287329

288-
### Macros in environment [:high_brightness:](#images-comparison)
330+
### Macros in environment
289331

290332
ejabberd reads `EJABBERD_MACRO_*` environment variables
291333
and uses them to define the corresponding
@@ -721,11 +763,10 @@ docker buildx build \
721763

722764
#### Podman build
723765

724-
To build the image using Podman, please notice:
766+
Some minor remarks:
725767

726-
- `EXPOSE 4369-4399` port range is not supported, remove that in Dockerfile
727-
- It mentions that `healthcheck` is not supported by the Open Container Initiative image format
728-
- to start with command `live`, you may want to add environment variable `EJABBERD_BYPASS_WARNINGS=true`
768+
- When building, it mentions that `healthcheck` is not supported by the Open Container Initiative image format
769+
- To start with command `live`, you may want to add environment variable `EJABBERD_BYPASS_WARNINGS=true`
729770

730771
```bash
731772
podman build \
@@ -1061,35 +1102,35 @@ Images Comparison
10611102

10621103
Let's summarize the differences between both container images. Legend:
10631104

1064-
- :sparkle: is the recommended alternative
1065-
- :orange_circle: added in the latest release (ejabberd 25.03)
1066-
- :high_brightness: added in the previous release (ejabberd 24.12)
1067-
- :low_brightness: added in the pre-previous release (ejabberd 24.10)
1105+
- ❇️: is the recommended alternative
1106+
- 🟠: changed in ejabberd 26.01
1107+
- πŸ”†: changed in ...
1108+
- πŸ”…: changed in ejabberd 25.03
10681109

10691110
| | [![ejabberd Container](https://img.shields.io/badge/ejabberd-grey?logo=opencontainersinitiative&logoColor=2094f3)](https://github.com/processone/ejabberd/pkgs/container/ejabberd) | [![ecs Container](https://img.shields.io/badge/ecs-grey?logo=docker&logoColor=2094f3)](https://hub.docker.com/r/ejabberd/ecs/) |
10701111
|:----------------------|:------------------|:-----------------------|
10711112
| Source code | [ejabberd/.github/container](https://github.com/processone/ejabberd/tree/master/.github/container) | [docker-ejabberd/ecs](https://github.com/processone/docker-ejabberd/tree/master/ecs) |
10721113
| Generated by | [container.yml](https://github.com/processone/ejabberd/blob/master/.github/workflows/container.yml) | [tests.yml](https://github.com/processone/docker-ejabberd/blob/master/.github/workflows/tests.yml) |
10731114
| Built for | stable releases <br /> `master` branch | stable releases <br /> [`master` branch zip](https://github.com/processone/docker-ejabberd/actions/workflows/tests.yml) |
10741115
| Architectures | `linux/amd64` <br /> `linux/arm64` | `linux/amd64` |
1075-
| Software | Erlang/OTP 27.3.4.3-alpine <br /> Elixir 1.18.4 | Alpine 3.22 <br /> Erlang/OTP 26.2 <br /> Elixir 1.18.3 |
1116+
| Software | Erlang/OTP 28.3.1.0-alpine 🟠 <br /> Elixir 1.19.5 🟠 | Alpine 3.22 <br /> Erlang/OTP 26.2 <br /> Elixir 1.18.3 |
10761117
| Published in | [ghcr.io/processone/ejabberd](https://github.com/processone/ejabberd/pkgs/container/ejabberd) | [docker.io/ejabberd/ecs](https://hub.docker.com/r/ejabberd/ecs/) <br /> [ghcr.io/processone/ecs](https://github.com/processone/docker-ejabberd/pkgs/container/ecs) |
10771118
| :black_square_button: **Additional content** |
10781119
| [ejabberd-contrib](#ejabberd-contrib) | included | not included |
1079-
| [ejabberdapi](#ejabberdapi) | included :orange_circle: | included |
1120+
| [ejabberdapi](#ejabberdapi) | included πŸ”… | included |
10801121
| :black_square_button: **Ports** |
1081-
| [1880](#ports) for WebAdmin | yes :orange_circle: | yes :orange_circle: |
1082-
| [5210](#ports) for `ERL_DIST_PORT` | supported | supported :orange_circle: |
1122+
| [1880](#ports) for WebAdmin | yes πŸ”… | yes πŸ”… |
1123+
| [5210](#ports) for `ERL_DIST_PORT` | supported | supported πŸ”… |
10831124
| :black_square_button: **Paths** |
10841125
| `$HOME` | `/opt/ejabberd/` | `/home/ejabberd/` |
1085-
| User data | `$HOME` :sparkle: <br /> `/home/ejabberd/` :orange_circle: | `$HOME` <br /> `/opt/ejabberd/` :sparkle: :low_brightness: |
1086-
| `ejabberdctl` | `ejabberdctl` :sparkle: <br /> `bin/ejabberdctl` :orange_circle: | `bin/ejabberdctl` <br /> `ejabberdctl` :sparkle: :low_brightness: |
1087-
| [`captcha.sh`](#captcha) | `$HOME/bin/captcha.sh` :orange_circle: | `$HOME/bin/captcha.sh` :orange_circle: |
1088-
| `*.sql` files | `$HOME/sql/*.sql` :sparkle: :orange_circle: <br /> `$HOME/database/*.sql` :orange_circle: | `$HOME/database/*.sql` <br /> `$HOME/sql/*.sql` :sparkle: :orange_circle: |
1089-
| Mnesia spool files | `$HOME/database/` :sparkle: <br /> `$HOME/database/NODENAME/` :orange_circle: | `$HOME/database/NODENAME/` <br /> `$HOME/database/` :sparkle: :orange_circle: |
1126+
| User data | `$HOME` ❇️ <br /> `/home/ejabberd/` πŸ”… | `$HOME` <br /> `/opt/ejabberd/` ❇️ |
1127+
| `ejabberdctl` | `ejabberdctl` ❇️ <br /> `bin/ejabberdctl` πŸ”… | `bin/ejabberdctl` <br /> `ejabberdctl` ❇️ |
1128+
| [`captcha.sh`](#captcha) | `$HOME/bin/captcha.sh` πŸ”… | `$HOME/bin/captcha.sh` πŸ”… |
1129+
| `*.sql` files | `$HOME/sql/*.sql` ❇️ πŸ”… <br /> `$HOME/database/*.sql` πŸ”… | `$HOME/database/*.sql` <br /> `$HOME/sql/*.sql` ❇️ πŸ”… |
1130+
| Mnesia spool files | `$HOME/database/` ❇️ <br /> `$HOME/database/NODENAME/` πŸ”… | `$HOME/database/NODENAME/` <br /> `$HOME/database/` ❇️ πŸ”… |
10901131
| :black_square_button: **Variables** |
1091-
| [`EJABBERD_MACRO_*`](#macros-in-environment) | supported :high_brightness: | supported :high_brightness: |
1092-
| Macros used in `ejabberd.yml` | yes :orange_circle: | yes :orange_circle: |
1093-
| [`EJABBERD_MACRO_ADMIN`](#register-admin-account) | Grant admin rights :orange_circle: <br /> (default `admin@localhost`) <br /> | Hardcoded `admin@localhost` |
1094-
| [`REGISTER_ADMIN_PASSWORD`](#register-admin-account) | Register admin account :orange_circle: | unsupported |
1095-
| `CTL_OVER_HTTP` | enabled :orange_circle: | unsupported |
1132+
| [`EJABBERD_MACRO_*`](#macros-in-environment) | supported | supported |
1133+
| Macros used in `ejabberd.yml` | yes πŸ”… | yes πŸ”… |
1134+
| [`EJABBERD_MACRO_ADMIN`](#register-admin-account) | Grant admin rights πŸ”… <br /> (default `admin@localhost`) <br /> | Hardcoded `admin@localhost` |
1135+
| [`REGISTER_ADMIN_PASSWORD`](#register-admin-account) | Register admin account πŸ”… | unsupported |
1136+
| `CTL_OVER_HTTP` | enabled πŸ”… | unsupported |

0 commit comments

Comments
Β (0)