Skip to content
Merged
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
3 changes: 2 additions & 1 deletion core/.env.ci.dist
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
APP_ENV=ci
SYMFONY_ENV=ci
APP_DEBUG=true
APP_SECRET=secret
15 changes: 15 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,18 @@ To mount the code in multiple containers:
`start-dev-env.sh profile:../../OpenConext-profile userlifecycle:../../OpenConext-user-lifecycle`
You can add as many services+local code paths that you need.
The recommended way is to use absolute paths and the script requires the name of the service and local code path to be separated by a `:`, for each service.

# Tips

To start engine in local development environment use from this directory;

Ensure a file `.env` exists with:
```shell
APP_ENV=dev
APP_DEBUG=true
APP_SECRET=secret
```
```shell
./start-dev-env.sh engine:../../OpenConext-engineblock/
```
To change the running env, just edit `APP_ENV=ci` for example and re-run `./start-dev-env.sh engine:../../OpenConext-engineblock/`. You do not have to recreate all services, only to reload engineblock.
3 changes: 2 additions & 1 deletion core/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ services:
condition: service_healthy
environment:
- APP_ENV=${APP_ENV:-prod}
- SYMFONY_ENV=${APP_ENV:-prod}
- APP_DEBUG=${APP_ENV:-false}
- APP_SECRET=${APP_SECRET:?APP_SECRET is not set}

profile:
image: ghcr.io/openconext/openconext-profile/profile:prod
Expand Down
8 changes: 3 additions & 5 deletions core/engine/appconf.conf
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
DocumentRoot /var/www/html/web
DocumentRoot /var/www/html/public
ServerName engine
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

<Directory "/var/www/html/web">
<Directory "/var/www/html/public">
Require all granted
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>

Header always set X-Content-Type-Options "nosniff"

SetEnv HTTPS on
#SetEnv ENGINEBLOCK_ENV dev
#SetEnv SYMFONY_ENV dev

RewriteEngine On
# We support only GET/POST
Expand Down
6 changes: 3 additions & 3 deletions core/engine/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# the container. It will destroy the sub-mount!!
services:
engine:
image: ghcr.io/openconext/openconext-basecontainers/${ENGINE_PHP_IMAGE:-php72-apache2-node14-composer2:latest}
image: ghcr.io/openconext/openconext-basecontainers/${ENGINE_PHP_IMAGE:-php82-apache2-node20-composer2:latest}
volumes:
- ${ENGINE_CODE_PATH}:/var/www/html
- ./engine/appconf.conf:/etc/apache2/sites-enabled/appconf.conf
environment:
- APP_ENV=${APP_ENV:-dev}
- SYMFONY_ENV=${APP_ENV:-dev}
- APP_DEBUG=1
- APP_DEBUG=${APP_DEBUG:-true}
- APP_SECRET=${APP_SECRET:-secret}
healthcheck:
test: ["CMD", "true"]
interval: 10s
12 changes: 6 additions & 6 deletions core/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ docker compose exec engine timeout 300 bash -c 'while [[ "$(curl -k -s -o /dev/n

echo -e "${ORANGE}First, we will initialise the EB database$NOCOLOR ${GREEN}\xE2\x9C\x94${NOCOLOR}"
echo "Checking if the database is already present"
if ! docker compose exec engine /var/www/html/app/console doctrine:schema:validate -q --skip-mapping --env=prod; then
if ! docker compose exec engine /var/www/html/bin/console doctrine:schema:validate -q --skip-mapping --env=prod; then
echo creating the database schema
echo "Executing docker compose exec engine /var/www/html/app/console doctrine:schema:create --env prod"
docker compose exec engine /var/www/html/app/console doctrine:schema:create --env prod
echo "Executing docker compose exec engine /var/www/html/bin/console doctrine:schema:create --env prod"
docker compose exec engine /var/www/html/bin/console doctrine:schema:create --env prod
# TODO: Use migrations instead of schema:create. Not both. @see https://github.com/OpenConext/OpenConext-engineblock/issues/1861
fi
echo "Clearing the cache"
echo "Executing docker compose exec engine /var/www/html/app/console cache:clear -n --env=prod"
docker compose exec engine /var/www/html/app/console cache:clear -n --env=prod
docker compose exec engine chown -R www-data:www-data /var/www/html/app/cache/
echo "Executing docker compose exec engine /var/www/html/bin/console cache:clear -n --env=prod"
docker compose exec engine /var/www/html/bin/console cache:clear -n --env=prod
docker compose exec engine chown -R www-data:www-data /var/www/html/var/cache/

# Now it's time to bootstrap manage
# Bring up containers needed for bootstrapping manage
Expand Down
Loading