RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

Mapping Phabricator port 80 to an external port of a different value like 8088 breaks on redirection to auth page. #39

Closed rung2kf closed 8 years ago

rung2kf commented 8 years ago

I got an issue which looks to be a redirection issue. Since I mapped the internal port 80 to the external port 8088, I got a 'page not found' with a URL of 'http://phabricator.somecompany.com/auth/register/'. When I remapped port 80 to 80, it worked, and I got Phabricator's admin setup page as expected.

Phab is located at 'phabricator.somecompany.com:8088', but the response to the root URI & '/index.php' is 'page not found' and an auth page at port 80.

Thanks in advance for your prompt reply.

alex3d commented 8 years ago

try PHABRICATOR_HOST=phabricator.somecompany.com:8088 It works for everything except aphlict notification server (ports hardcoded at https://github.com/hach-que-docker/phabricator/blob/master/10-boot-conf#L214). You can change aphlict port later in Phabricator config (notification.servers)

rung2kf commented 8 years ago

Thank you very much, Alex! Those suggestions work. I made a couple small changes to my run.sh & the 10-boot-conf scripts to pass in the port for Aphlict. Changes & additions in bold:

Contents of run.sh:

EXT_PHABRICATOR_PORT=8088 docker run \ --name=hphab\ --rm -p ${EXT_PHABRICATOR_PORT}:80 -p 443:443 -p 8022:22 \ --env PHABRICATOR_HOST=somecompany.com \ --env EXT_APHLICT_PORT=${EXT_PHABRICATOR_PORT} \ --link phab_test:mysql \ --env MYSQL_LINKED_CONTAINER=MYSQL \ --env MYSQL_PORT=3306 \ --env MYSQL_USER=phab \ --env MYSQL_PASS='mysqlpassword' \ --env PHABRICATOR_REPOSITORY_PATH='/repos' \ -v ${HOME}/myRepos/phab_repo:/repos \ hachque/phabricator

Changes made to 10-boot-conf: ... if [ "$AWS_S3_SECRET_KEY" != "" ]; then sudo -u git ./bin/config set amazon-s3.secret-key "$AWS_S3_SECRET_KEY" fi APHLICT_PORT=80 if [ "$SSL_TYPE" == "none" ]; then APHLICT_PROTOCOL="http" [ -n "${EXT_APHLICT_PORT}" ] && APHLICT_PORT=${EXT_APHLICT_PORT} else APHLICT_PROTOCOL="https" APHLICT_PORT=443 fi sudo -u git ./bin/config set notification.servers '[{"type": "client","host": "'$PHABRICATOR_HOST'","port": '$APHLICT_PORT',"protocol": "'$APHLICT_PROTOCOL'","path": "/ws/"},{"type": "admin","host": "127.0.0.1","port": 22281,"protocol": "http"}]' ...