How to setup new develop enviroment

Hello everyone,
my company has adopted Passbolt, and I wanted to customize some aspects of the community project to better integrate it into the company’s ecosystem.

So, I wanted to set up a suitable development environment for the work. Below are the activities I’ve completed:

  • Installed Ubuntu machine
  • Installed MySQL
  • Installed VSCode
  • Forked the Passbolt API repository
  • Runned compose and installed all php dependencies

At this point, the idea was to start the project and run the guided setup. Unfortunately, I am completely unfamiliar with PHP, so I went ahead by trial and error:

  • Running with php -S: the pages are served but without CSS, and the process gets stuck at the PGP key generation.
  • Linking an Apache2 virtual host directly to the webroot folder of the sources: CSS is present, the database connection passes, but in the requirements checklist, I get errors, including folder permissions issues in the tmp directory.

I searched this forum, in others provided resources, and even the repository’s READMEs for a comprehensive guide on how to set up a development environment without success.

Can anyone kindly give me some suggestions to proceed? :sweat_smile:

Thank you in advance for any help you can provide, I really appreciate your time and assistance.

Hello @ScaoDevTeam, welcome to our community :slight_smile:

If you’d like to set up a development environment, I would recommend using Docker following our dedicated GitHub repository.

Don’t forger to fork the API since you have to provide the path in the .env file as well as updating the passbolt and dbms environment files.

1 Like

Hi Antony,
thanks for your tips.
I followed the instructions you gave me and made great progress.

Now I have a development environment running with Docker and connected to the fork of the passbolt_api repository. I verified that it’s using those files by modifying index.php and adding xdebug_info(), and all works fine.

This is my docker.ps

scao@ubuntu-scao:~/repo/passbolt_docker$ sudo docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED      STATUS          PORTS                                                                                    NAMES
e17462d31913   dev-passbolt             "docker-php-entrypoi…"   2 days ago   Up 34 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 9000/tcp       passbolt
68f0b42e64b7   adminer                  "entrypoint.sh php -…"   2 days ago   Up 55 minutes   0.0.0.0:9501->8080/tcp, [::]:9501->8080/tcp                                              adminer
3a972769b6cd   postgres:12.2-alpine     "docker-entrypoint.s…"   2 days ago   Up 34 minutes   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                                dev-pgsql-1
2cbf15a6ba67   mariadb:10.3             "docker-entrypoint.s…"   2 days ago   Up 34 minutes   0.0.0.0:3306->3306/tcp, :::3306->3306/tcp                                                db
3a4c4910ca54   mailhog/mailhog:latest   "MailHog"                2 days ago   Up 55 minutes   0.0.0.0:1025->1025/tcp, :::1025->1025/tcp, 0.0.0.0:9502->8025/tcp, [::]:9502->8025/tcp   mailhog

Browsing to the passbolt.local address, I get this page

But the development environment doesn’t have any users configured. So, I restored the production MySQL database in the development environment. Now it recognizes the user, but then prompts me to check my email, which never arrives.

The user already exists, so I don’t understand why it won’t let me log in.

Thank you in advance for any help you can provide

Hello,
Glad to hear that you’ve been able to make progress with the development environment.

If you restored the production database onto the development environment this is totally expected to not receive the emails. Indeed, the SMTP settings are stored encrypted in the database in the organization_settings table with the server public keys which in reference means the production server key due to the database restoration as I assume you didn’t restore the keys too in the passbolt container.

What I would recommend here in order to avoid any conflicts with the production server keys would be to nuke the database on this development environment, and from the passbolt container create N users with:

su -s /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt register_user -i" www-data

When it comes to recovering an user without SMTP, you can also use:

su -s /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt recover_user -c -u YOUR_EMAIL" www-data

If you are using the passbolt_docker repository, I recommend using mailhog. You can configure it in Administration > Email server

These settings should work but you can test the settings in case. Then you can access the mailhog UI at http://localhost:8025. Kind remember that emails are sent every minute thanks to the cronjob so it may take some times to receive the email.

Regarding resources creation and so on, you can take one of our csv example in order to import lots of data in a single import.

I hope it helps :wink: