ugoviti / izpbx

izPBX is a Turnkey Cloud Native Telephony System powered by Asterisk Engine and FreePBX Management GUI
GNU General Public License v3.0
179 stars 74 forks source link

Error when setting APP_PORT_HTTP to an integer starting with "80" #22

Closed avm99963 closed 3 years ago

avm99963 commented 3 years ago

When setting APP_PORT_HTTP=8081 in the .env file, from the second time that the container is started the container doesn't work (it fails to start the HTTPD service). This is because each start triggers the following command:

https://github.com/ugoviti/izdock-izpbx/blob/master/izpbx-asterisk/rootfs/entrypoint-hooks.sh#L543

This means the original "Listen 80" line is modified as follows:

# Original line:
Listen 80

# After first start:
Listen 8081

# After second start (expected: |Listen 8081|):
Listen 808081

# After third start:
Listen 80808081

# Etc.

In the meantime I've changed my port to another integer that doesn't start with 80 :)

BTW, thanks for putting together this Docker image, I really appreciate it!

ugoviti commented 3 years ago

opssss! :) thank you for the good report that helped me to quickly find the bug :)

changed:

sed "s/Listen 80/Listen ${APP_PORT_HTTP}/" -i "${HTTPD_CONF_DIR}/conf/httpd.conf"

to:

sed "s/^Listen .*/Listen ${APP_PORT_HTTP}/" -i "${HTTPD_CONF_DIR}/conf/httpd.conf"

fixed in 675cda1533a47a5eb4b141faae669eeb222cb867, will be included into 18.15.16 release.

Thankyou!