--- tags: Leadflo --- # Environment Setup ## OpenVPN client You can access the OpenVPN client by logging into this page and following the instructions: https://vpn.thefreshuk.com:943/ If using MacOS, OpenVPN provides a preconfigured OpenVPN client. ## PHPBrew We use PHPBrew to manage versions of PHP locally between projects (outside of Docker): https://github.com/phpbrew/phpbrew#getting-started This may also been installed from Leadflo's `./bin` folder: ```bash cd ./bin make phpbrew-install ``` ## PHP *These instructions assume PHPBrew* The most current version of PHP we use is 8.1.9. To install this, with most of the required PHP extensions, use this: ```bash phpbrew install -j 12 8.2.9 \ +sodium \ +mbstring \ +curl \ +openssl \ +pdo \ +mysql \ +pgsql \ +iconv \ +filter \ +fileinfo \ +pcntl \ +posix \ +intl \ -- --with-iconv=<iconv prefix> ``` The iconv prefix depends on how iconv was installed. This differs based on platform **and** package manager. For example, with homebrew it is likely `/usr/local` but, with ports, `/opt/local` The Redis extension is also required: ```bash phpbrew ext install redis ``` BCMath: ```bash phpbrew ext install bcmath ``` And xhprof: ```bash phpbrew ext install xhprof ``` It's also recommended to enable opcache in general and on CLI, along with JIT. Here are my settings but adjust based on available resources: ``` zend_extension=opcache.so opcache.enable=1 opcache.enable_cli=1 opcache.memory_consumption=2048 opcache.interned_strings_buffer=64 opcache.max_accelerated_files=100000 opcache.optimization_level=0xffffffff opcache.jit=1205 opcache.jit_buffer_size=512 ``` This doubles the speed of typechecking on my machine. Older projects may require different versions of PHP and extension sets but maintained projects *should* run on the latest PHP version. ## Terraform We use Terraform on new projects: https://www.terraform.io/downloads ## Taskfile Leadflo uses Taskfile as a task runner (some of it uses GNU make, but this became unwieldy): https://taskfile.dev/installation/ Leadflo also provides an installer in the `./bin` dir. This can be installed by: ```bash cd ./bin make install-taskfile ``` ## NVM NVM is a node version manager, similar to PHPBrew: https://github.com/nvm-sh/nvm#installing-and-updating ## Node v16.17.0 *These instructions assume NVM* To install Node 16.17.0, simply run: ```bash nvm install lts/gallium ``` To make it your default: ```bash nvm alias default lts/gallium ``` Alternatively, you can download the current LTS from https://nodejs.org/en/ ## GnuGP We use GnuGP for encryption, both to generate key pairs and as a dependency of git-secret. You can download it here: https://gnupg.org/download/ Or install it via your package manager. ## git-secret We yse GnuGP to encrypt secrets so they are not stored in version control as plaintext. Leadflo provides an installer in the `./bin` directory: ```bash cd ./bin make git-secret-install ``` You will also need to generate a keypair and provide your public key - another IC will provide access to secrets. ## jq jq is used by some bash scripts to parse and manipulate JSON. Leadflo provides an installer: ```bash cd ./bin make jq-install ``` ## Docker The latest version of Docker, Docker Compose is required by all projects we currently maintained. ## AWS CLI v2 We use AWS as our infrastructure provider for bespoke software projects (e.g Leadflo, IAS). Some scripts on LF assume presence of AWS and it is also required by Ansible in other projects that use it: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html