12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #!/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
- <?xml version='1.0' encoding='utf-8'?>
- <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
- <Link rel="urn:xmpp:alt-connections:xbosh"
- href="https://$HOSTNAME:5443/bosh" />
- <Link rel="urn:xmpp:alt-connections:websocket"
- href="wss://$HOSTNAME:5443/ws" />
- </XRD>
- 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 "$@"
|