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

Feature/maintenance update #139

Merged
merged 6 commits into from
Oct 28, 2024
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
5 changes: 5 additions & 0 deletions .docker/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!Readme.md
26 changes: 26 additions & 0 deletions .docker/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .docker/data

Please map persistent volumes to this directory on the servers.

If a container needs to persist data between restarts you can map the relevant files in the container to ``docker/data/<container-name>`.

## RabbitMQ example
If you are using RabbitMQ running in a container as a message broker you need to configure a persistent volume for RabbitMQs data directory to avoid losing message on container restarts.

```yaml
# docker-compose.server.override.yml

services:
rabbit:
image: rabbitmq:3.9-management-alpine
hostname: "${COMPOSE_PROJECT_NAME}"
networks:
- app
- frontend
environment:
- "RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}"
- "RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}"
- "RABBITMQ_ERLANG_COOKIE=${RABBITMQ_ERLANG_COOKIE}"
volumes:
- ".docker/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
```
6 changes: 2 additions & 4 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
worker_processes auto;

error_log /var/log/nginx/error.log notice;
error_log /dev/stderr notice;
pid /tmp/nginx.pid;

events {
Expand All @@ -26,11 +26,9 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
access_log /dev/stdout main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

gzip on;
Expand Down
42 changes: 42 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
server {
listen ${NGINX_PORT};
server_name localhost;

root ${NGINX_WEB_ROOT};

client_max_body_size ${NGINX_MAX_BODY_SIZE};

location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}

# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
deny all;
return 404;
}

location ~ ^/index\.php(/|$) {
fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;

fastcgi_pass ${NGINX_FPM_SERVICE};
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

internal;
}

location ~ \.php$ {
return 404;
}

# Send log message to files symlinked to stdout/stderr.
error_log /dev/stderr;
access_log /dev/stdout main;
}
6 changes: 3 additions & 3 deletions .github/workflows/pr-php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1']
php: ['8.3']
name: Validate composer (${{ matrix.php}})
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1']
php: ['8.3']
name: Coding style fixer (${{ matrix.php }})
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1']
php: ['8.3']
name: Validate database schema (${{ matrix.php }})
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Add "other permanent location instruction" for books that should be sent to a di

### Changed

- Upgraded engine to node 18.
- Upgraded to PHP 8.1
- Upgraded engine to node 22.
- Upgraded to PHP 8.3
- Upgraded to latest github actions
- Change linting and files extensions, add changelog to actions check [#129](https://github.com/bibboxen/bibselv/pull/129)
- Performance improvements: usememo, usecallback [#129](https://github.com/bibboxen/bibselv/pull/129)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ The engine then changes the machines state and sends it back to the frontend.

## Tech stack

- Node.js 14.x
- Node.js 22.x
- Symfony 5.x
- PHP 7.4
- React 16.x
- PHP 8.3
- React 18.x

## Development setup

Expand All @@ -50,7 +50,7 @@ cp engine/example_config.json engine/config.json
Install dependencies for the engine.

```sh
docker compose run engine bash -c './scripts/install.sh --also=dev'
docker compose run --rm engine bash -c './scripts/install.sh --also=dev'
```

### Environment variables
Expand All @@ -70,7 +70,7 @@ CLI_REDIRECT=APP_CLI_REDIRECT_URI # Redirect route for CLI login
Install the frontend react dependencies.

```sh
docker-compose run frontend bash -c 'npm install'
docker-compose run --rm frontend bash -c 'npm install'
```

### Symfony
Expand Down Expand Up @@ -221,13 +221,13 @@ When PRs are created towards the develop branch all coding styles are checked by
To check for coding standards, run the following:

```sh
docker-compose run frontend bash -c 'npm run check-coding-standards'
docker-compose run --rm frontend bash -c 'npm run check-coding-standards'
```

To automatically apply coding standards, run:

```sh
docker-compose run frontend bash -c 'npm run apply-coding-standards'
docker-compose run --rm frontend bash -c 'npm run apply-coding-standards'
```

### Code linting Engine
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
"easycorp/easyadmin-bundle": "^4.2",
"itk-dev/openid-connect-bundle": "^1.0",
"itk-dev/openid-connect-bundle": "^3.1",
"symfony/console": "^5.4",
"symfony/dotenv": "^5.4",
"symfony/expression-language": "^5.4",
Expand Down
Loading
Loading