Skip to content

Commit 893822a

Browse files
authored
Merge pull request #55 from OpenConext/feature/sf_upgrade_44
Symfony upgrade EB: PHP 8.2 SF 5.4
2 parents c70eadc + c5b3fd5 commit 893822a

File tree

6 files changed

+31
-16
lines changed

6 files changed

+31
-16
lines changed

core/.env.ci.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
APP_ENV=ci
2-
SYMFONY_ENV=ci
2+
APP_DEBUG=true
3+
APP_SECRET=secret

core/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,18 @@ To mount the code in multiple containers:
8585
`start-dev-env.sh profile:../../OpenConext-profile userlifecycle:../../OpenConext-user-lifecycle`
8686
You can add as many services+local code paths that you need.
8787
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.
88+
89+
# Tips
90+
91+
To start engine in local development environment use from this directory;
92+
93+
Ensure a file `.env` exists with:
94+
```shell
95+
APP_ENV=dev
96+
APP_DEBUG=true
97+
APP_SECRET=secret
98+
```
99+
```shell
100+
./start-dev-env.sh engine:../../OpenConext-engineblock/
101+
```
102+
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.

core/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ services:
118118
condition: service_healthy
119119
environment:
120120
- APP_ENV=${APP_ENV:-prod}
121-
- SYMFONY_ENV=${APP_ENV:-prod}
121+
- APP_DEBUG=${APP_ENV:-false}
122+
- APP_SECRET=${APP_SECRET:?APP_SECRET is not set}
122123

123124
profile:
124125
image: ghcr.io/openconext/openconext-profile/profile:prod

core/engine/appconf.conf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
DocumentRoot /var/www/html/web
1+
DocumentRoot /var/www/html/public
22
ServerName engine
33
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
44

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

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

1616
SetEnv HTTPS on
17-
#SetEnv ENGINEBLOCK_ENV dev
18-
#SetEnv SYMFONY_ENV dev
1917

2018
RewriteEngine On
2119
# We support only GET/POST

core/engine/docker-compose.override.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# the container. It will destroy the sub-mount!!
55
services:
66
engine:
7-
image: ghcr.io/openconext/openconext-basecontainers/${ENGINE_PHP_IMAGE:-php72-apache2-node14-composer2:latest}
7+
image: ghcr.io/openconext/openconext-basecontainers/${ENGINE_PHP_IMAGE:-php82-apache2-node20-composer2:latest}
88
volumes:
99
- ${ENGINE_CODE_PATH}:/var/www/html
1010
- ./engine/appconf.conf:/etc/apache2/sites-enabled/appconf.conf
1111
environment:
1212
- APP_ENV=${APP_ENV:-dev}
13-
- SYMFONY_ENV=${APP_ENV:-dev}
14-
- APP_DEBUG=1
13+
- APP_DEBUG=${APP_DEBUG:-true}
14+
- APP_SECRET=${APP_SECRET:-secret}
1515
healthcheck:
1616
test: ["CMD", "true"]
1717
interval: 10s

core/scripts/init.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ docker compose exec engine timeout 300 bash -c 'while [[ "$(curl -k -s -o /dev/n
1818

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

3232
# Now it's time to bootstrap manage
3333
# Bring up containers needed for bootstrapping manage

0 commit comments

Comments
 (0)