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

Problem adding new users and setting up mailer #87

Closed akaustel closed 6 years ago

akaustel commented 6 years ago

I can add a new user from the Phabricator web ui, but how can the user log in? Cannot set password, and as the mailer is not working the new user is just unmanageable and unusable.

If I try to setup the mailer, the from the command line using

> docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                                                    NAMES
c752cca11435        redpointgames/phabricator   "/bin/bash /app/in..."   4 minutes ago       Up 4 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:10022->22/tcp, 0.0.0.0:10024->24/tcp   ph_phabricator_1
1c4cbb096b95        mysql:5.7.14                "docker-entrypoint..."   4 minutes ago       Up 4 minutes        3306/tcp                                                                                 ph_mysql_1

> docker exec -i -t <docker-id-c752cca11435>  /bin/bash
> cd /srv/phabricator/phabricator/bin
> ./config set phpmailer.smtp-protocol tls
...

The settings are gone when restarting the docker, and are not applied before phabricator is restarted, if I am not mistaking. Seems a bit odd that these basics are not covered in "Basic Configuration", or am I way off here?

hach-que commented 6 years ago

I think by default the Docker image uses Postfix to just send emails directly to the target email address. That is; your firewall needs to permit SMTP traffic outbound.

You can configure a different mailer (like MailGun or SendGrid) once you've created your first admin account and then change the settings in the Config app inside Phabricator itself.

Also remember this image is not restartable; you need to "stop" and "rm" the Docker image before you run it again.

akaustel commented 6 years ago

The docker image has outbound traffic enabled for port 25, but it does not seem to work. That is why I tried to configure sendmail as the mailer.

I have the initial admin account, and it is working, but when creating new accounts there is no way of accessing them, as I cannot set an initial password and the "welcome" mail is never received by the new user.

I do not understand what this "not restartable" is all about. I have restarted using docker-compose down and the docker-compose up without problems. Persistance is achieved by shared folders, but that seems to work only for the database.

If it is of any importance my docker-compose configuration is as follows:

version: '2'
services:
  phabricator:
    restart: always
    ports:
     - "443:443"
     - "80:80"
     - "10022:22"
    volumes:
     - /srv/docker/phabricator/repos:/repos
     - /srv/docker/phabricator/extensions:/srv/phabricator/phabricator/src/extensions
     - /srv/docker/phabricator/ssl:/ssl
     - /srv/docker/phabricator/hostkeys:/hostkeys
    depends_on:
     - mysql
    links:
     - mysql
    environment:
     - MYSQL_HOST=mysql
     - MYSQL_USER=root
     - MYSQL_PASS=***********
     - PHABRICATOR_REPOSITORY_PATH=/repos/data
     - PHABRICATOR_HOST=mydomain.com
     - PHABRICATOR_HOST_KEYS_PATH=/hostkeys/persisted
     - SSL_TYPE=manual
     - SSL_CERTIFICATE=/ssl/cert.pem
     - SSL_PRIVATE_KEY=/ssl/key.pem
    image: redpointgames/phabricator
  mysql:
    restart: always
    volumes:
     - /srv/docker/phabricator/mysql:/var/lib/mysql
    image: mysql:5.7.14
    environment:
     - MYSQL_ROOT_PASSWORD=**********

Disclaimer: I am new to Docker as well as Phabricator, but have worked with servers and apps like this before.

hach-que commented 6 years ago

It seems like docker-compose up --force-recreate might be what you want? Either way, the actual container for Phabricator needs to be recreated each time it's launched, you can't start an existing container because otherwise Docker will persist changes to the container filesystem that the startup scripts make on first run (and are not expecting to see when they run again on second launch).

There is nothing to action here, so I'm going to close this issue.