#!/bin/sh # Generate configuration file with host-specific parameters cat << EOF > ~/env.yml define_macro: HOSTNAME: $HOSTNAME IP_ADDRESS: $IP_ADDRESS IRCDOMAIN: irc.$HOSTNAME: password: $IRCPASS WS_URL: "wss://$HOSTNAME:5443/ws" ACL_ORIGIN: "https://$HOSTNAME" PUT_URL: "https://$HOSTNAME:5443/upload" EOF cat ~/env.yml # Generate additional custom configuration echo > ~/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 EOF # Generate discovery file for XEP-0156 in JSON format cat << EOF > ~/www/.well-known/host-meta.json { "links": [ { "rel": "urn:xmpp:alt-connections:xbosh", "href": "https://$HOSTNAME:5443/bosh" }, { "rel": "urn:xmpp:alt-connections:websocket", "href": "wss://$HOSTNAME:5443/ws" } ] } EOF # Run ejabberdctl as done in the original entrypoint from the dockerfile /home/ejabberd/bin/ejabberdctl "$@"