Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Add OpenSSL ini config for PHP with custom cafile path #44

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# The v4 API
This repository holds the code for the Goteo **v4** API.

> **NOTE**: Review the trusted certificates by OpenSSL. See: https://github.com/GoteoFoundation/v4/issues/43

## Installation
This application requires [Docker](https://docs.docker.com/get-docker/) and the [Docker Compose](https://docs.docker.com/compose/install/) plugin.

Expand Down Expand Up @@ -31,7 +33,7 @@ UID=1001
GID=1001

APP_HTTP_PORT=8080
APP_HTTPS_PORT=8433
APP_HTTPS_PORT=8443
```

Then feed your custom env vars to Compose:
Expand All @@ -41,7 +43,7 @@ docker compose --env-file .env.local up -d --build

- Option B. Passing the variables through the shell.
```shell
export APP_HTTP_PORT=8080 && export APP_HTTPS_PORT=8433
export APP_HTTP_PORT=8080 && export APP_HTTPS_PORT=8443

# Dynamic user and group id
export UID=$(id -u) && export GID=$(id -g)
Expand Down Expand Up @@ -73,7 +75,7 @@ bin/docker php bin/console app:gateways:setup

## Usage

The app should be live at [http://localhost:8091](http://localhost:8091) (or your specified ports). Keep in mind that the API address is [/v4](http://localhost:8091/v4).
The app should be live at [http://localhost:8090](http://localhost:8090) (or your specified ports). Keep in mind that the API address is [/v4](http://localhost:8090/v4).

You can access a real-time build of the OpenAPI spec file for v4 at [http://localhost:8090/v4/docs.json](http://localhost:8090/v4/docs.json), to be used, for example, with API development suites such as Hoppscotch. This file will be up to date with most of your latest changes.

Expand All @@ -83,6 +85,7 @@ For quick Docker access you can use the `bin/docker` shortcut to quickly `exec`

- Login to mysql CLI: `bin/docker mariadb mysql -u goteo -pgoteo goteo`
- Debug the symfony services: `bin/docker php bin/console debug:container`
- List app custom commands: `bin/docker php bin/console list app`

## Testing

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
container_name: goteo-v4-php
volumes:
- .:/app
- ./docker/php/ssl/ca-bundle.crt:/etc/ssl/ca-bundle.crt:ro
- ./docker/php/conf.d/openssl.ini:/usr/local/etc/php/conf.d/openssl.ini:ro
- ./docker/php/conf.d/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro

nginx:
Expand Down
2 changes: 2 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RUN docker-php-ext-install \

COPY --from=composer:lts /usr/bin/composer /usr/local/bin/composer

RUN curl --remote-name https://curl.se/ca/cacert.pem \
&& mv cacert.pem /etc/ssl/certs/ca-certificates.crt

FROM base AS dev

Expand Down
2 changes: 2 additions & 0 deletions docker/php/conf.d/openssl.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[openssl]
openssl.cafile=/etc/ssl/certs/ca-certificates.crt
1 change: 1 addition & 0 deletions docker/php/ssl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ca-bundle.crt
Loading