Browse Source

added option to have custom config files

dominik 1 year ago
parent
commit
a35471cf7a
5 changed files with 14 additions and 0 deletions
  1. 4 0
      README.md
  2. 2 0
      data/conf.custom/.gitignore
  3. 1 0
      data/conf/ejabberd.yml
  4. 1 0
      docker-compose.yml
  5. 6 0
      entrypoint.sh

+ 4 - 0
README.md

@@ -25,6 +25,7 @@ It is assumed that on the docker host we're already running
   - ejabberd
     - The ejabberd image starts with a modified `entrypoint.sh` which generates some host-specific files based on variables set in `.env`:
       - `~/env.yml` with variables (macros) used in the remaining configuration
+      - `~/custom.yml` concatenating `~/conf.custom/*.yml`
       - `~/.well-known/host-meta` and `~/.well-known/host-meta` required for XEP-0156 compliance
     - ejabberd starts with `~/conf/ejabberd.yml` which includes the configurations from `~/conf/conf.d/` and `~/ env.yml` from above
   - Certificates
@@ -55,6 +56,7 @@ ejabber runs under user `ejabberd` with uid/guid `9000`. All data is stored in `
  - `./data/biboumi/database/` โ€” sqlite DB for Biboumi. The Biboumi configuration is defined via environment variables in `docker-compose.yml`.
  - `./data/conf/ejabberd.yml` โ€” configuration file referring to conf.d
  - `./data/conf.d/` โ€” actual configuration files
+ - `./data/conf.custom/` โ€” acaddtional custom  configuration files
  - `.data/database/` โ€” Erlang DB used to store all application data
  - `.data/uploads/` โ€” files transferred between users
  - `.data/www/` โ€” static web content
@@ -111,6 +113,8 @@ To check the records: https://kingant.net/check_xmpp_dns/
         
     
  8. (Optional) Update the static website in `data/www/` 
+
+ 9. (Optional) Place additional configuration files in `data/conf.custom/`
     
 ## Maintenance
 

+ 2 - 0
data/conf.custom/.gitignore

@@ -0,0 +1,2 @@
+*
+!.gitignore

+ 1 - 0
data/conf/ejabberd.yml

@@ -20,3 +20,4 @@ include_config_file:
   - /home/ejabberd/conf/conf.d/44-irc.yml
   - /home/ejabberd/conf/conf.d/50-stun-turn.yml
   - /home/ejabberd/conf/conf.d/60-modules.yml
+  - /home/ejabberd/custom.yml

+ 1 - 0
docker-compose.yml

@@ -34,6 +34,7 @@ services:
       - ./entrypoint.sh:/home/ejabberd/entrypoint.sh:ro
       - ./data/backup/:/home/ejabberd/backup/
       - ./data/conf/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml:ro
+      - ./data/conf.custom/:/home/ejabberd/conf.custom/:ro
       - ./data/conf.d/:/home/ejabberd/conf/conf.d/:ro
       - ./data/database/:/home/ejabberd/database/
       - ./data/upload/:/home/ejabberd/upload/

+ 6 - 0
entrypoint.sh

@@ -14,6 +14,12 @@ define_macro:
 EOF
 cat ~/env.yml
 
+# Generate additional custom configuration
+touch ~/custom.yml
+for config in ~/conf.custom/*.yml;
+  do cat $config >> ~/custom.yml
+done
+
 # Generate discovery file for XEP-0156 in XML format
 cat << EOF > ~/www/.well-known/host-meta
 <?xml version='1.0' encoding='utf-8'?>