Browse Source

fixed irc transport

dominik 1 year ago
parent
commit
2ac3d40dd4
5 changed files with 31 additions and 21 deletions
  1. 3 1
      .env.example
  2. 9 6
      TASKS.md
  3. 4 3
      data/conf.d/44-irc.yml
  4. 6 6
      docker-compose.yml
  5. 9 5
      entrypoint.sh

+ 3 - 1
.env.example

@@ -1 +1,3 @@
-HOSTNAME=im.example.net
+HOSTNAME=im.example.com
+IP_ADDRESS=203.0.113.113
+IRCPASS=PasswordForInternalCommunicationBetweenBiboumiUndEjabberd

+ 9 - 6
TASKS.md

@@ -9,20 +9,23 @@ done
 - .env dynamic configuration
 - check the reference config from https://hub.docker.com/r/rroemhild/ejabberd/
 - add abuse address
+- re-enable irc
 
 open
 --------------------------
-- re-enable irc
 - add conversejs
 - compliance test
-- automatic update with watchtower
 
 deferred
 --------------------------
-- add container to run: docker exec ejabberd bin/ejabberdctl backup /home/ejabberd/backup/backup
-- fix certificate expiration by adding a config-reload via acme.sh trigger-file
-  - newer versions apparently reload when the date of the pem file changes
-  - if the issue persists, let's try to not use a wildcard in the config but the exact filename
+- consistent backup of the mnesa DB
+  - add container to run: docker exec ejabberd bin/ejabberdctl backup /home/ejabberd/backup/backup
+- fix certificate expiration
+  - idea: add a config-reload via acme.sh trigger-file
+  - info: newer versions apparently reload when the date of the pem file changes
+  - next: if the issue persists, let's try to not use a wildcard in the config but the exact filename
+- automatic update with watchtower
+  - there have been breaking changes in the past, so this might be no good idea ;-)
 
 wishlist
 --------------------------

+ 4 - 3
data/conf.d/44-irc.yml

@@ -4,7 +4,8 @@ listen:
    ip: "::"
    module: ejabberd_service
    access: all
+   password: "secret"
    hosts:
-     #"irc.%HOSTNAME%":
-     "irc.vc.s-up.net":
-       password: "secret"
+     IRCDOMAIN
+     #"irc.im.example.com":
+     #  password: "SecretPasswortBetweenEjabberdAndBiboumi"

+ 6 - 6
docker-compose.yml

@@ -1,4 +1,4 @@
-version: '3'
+version: '3.4'
 services:
   ejabberd:
     image: ejabberd/ecs:21.12
@@ -22,11 +22,9 @@ services:
 
     healthcheck:
       test: ["CMD", "nc", "-z", "ejabberd:5347"]
-      interval: 1m30s
+      interval: 15s #interval for the first and subsequent checks
       timeout: 10s
       retries: 3
-      start_period: 30s
-
     
     volumes:
       - ./entrypoint.sh:/home/ejabberd/entrypoint.sh:ro
@@ -39,6 +37,7 @@ services:
 
     environment:
       IP_ADDRESS: ${IP_ADDRESS}
+      IRCPASS: ${IRCPASS}
       VIRTUAL_HOST: >
                     ${HOSTNAME},
                     conference.${HOSTNAME},
@@ -71,7 +70,8 @@ services:
       - 113:8113  #identd, used by irc servers to differentiate user coming from one host#
 
     depends_on:
-      - ejabberd
+      ejabberd:
+        condition: service_healthy
 
     volumes:
       - ./data/biboumi/database/:/var/lib/biboumi/
@@ -80,7 +80,7 @@ services:
     environment:
       BIBOUMI_HOSTNAME: irc.${HOSTNAME}
       BIBOUMI_PORT: 5347
-      BIBOUMI_PASSWORD: secret
+      BIBOUMI_PASSWORD: ${IRCPASS} 
       BIBOUMI_XMPP_SERVER_IP: ejabberd 
       BIBOUMI_ADMIN: admin@${HOSTNAME}
       BIBOUMI_IDENTD_PORT: 8113 ## the biboumi has not the privilege to open port 113 directly

+ 9 - 5
entrypoint.sh

@@ -1,9 +1,13 @@
 #!/bin/sh
-
-echo "define_macro:" > ~/env.yml
-echo "  HOSTNAME: $HOSTNAME" >> ~/env.yml
-echo "  IP_ADDRESS: $IP_ADDRESS" >> ~/env.yml
-cat ~/env.yml 
+cat << EOF > ~/env.yml
+define_macro:
+  HOSTNAME: $HOSTNAME
+  IP_ADDRESS: $IP_ADDRESS
+  IRCDOMAIN:
+    irc.$HOSTNAME:
+       password: $IRCPASS
+EOF
+cat ~/env.yml
 
 # Run ejabberdctl as done in the original entrypoint from the dockerfile
 /home/ejabberd/bin/ejabberdctl "$@"