From 7474b9ddbddd52a87e92f3cada1b597519988d19 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 15 Oct 2024 11:40:32 +0200 Subject: [PATCH 1/4] deduplicate server configuration --- guides/installation/requirements.md | 185 +++--------------- .../config-reference/server/caddy.md | 26 +++ 2 files changed, 53 insertions(+), 158 deletions(-) create mode 100644 resources/references/config-reference/server/caddy.md diff --git a/guides/installation/requirements.md b/guides/installation/requirements.md index adccf49b1..9f7afa5e2 100644 --- a/guides/installation/requirements.md +++ b/guides/installation/requirements.md @@ -31,24 +31,24 @@ You can use these commands to check your actual environment: * `memory_limit` : 512M minimum * `max_execution_time` : 30 seconds minimum * Extensions: - * ext-curl - * ext-dom - * ext-fileinfo - * ext-gd - * ext-iconv - * ext-intl - * ext-json - * ext-libxml - * ext-mbstring - * ext-openssl (there is an [issue](https://github.com/shopware/shopware/issues/3543) with OpenSSL 3.0.7) - * ext-pcre - * ext-pdo - * ext-pdo\_mysql - * ext-phar - * ext-simplexml - * ext-xml - * ext-zip - * ext-zlib + * `ext-curl` + * `ext-dom` + * `ext-fileinfo` + * `ext-gd` + * `ext-iconv` + * `ext-intl` + * `ext-json` + * `ext-libxml` + * `ext-mbstring` + * `ext-openssl` (there is an [issue](https://github.com/shopware/shopware/issues/3543) with OpenSSL 3.0.7) + * `ext-pcre` + * `ext-pdo` + * `ext-pdo_mysql` + * `ext-phar` + * `ext-simplexml` + * `ext-xml` + * `ext-zip` + * `ext-zlib` * Composer recommended version: 2.0 or higher ### SQL @@ -76,6 +76,7 @@ For optimal MySQL performance, it is advisable to set `max_allowed_packet` to a Shopware uses the Redis Protocol and, therefore, supports the following key/value stores: - [Redis v7 or higher](https://redis.io) +- [Valkey](https://valkey.io/) - [Redict](https://redict.io) - [KeyDB](https://docs.keydb.dev) - [Dragonfly](https://www.dragonflydb.io) @@ -86,153 +87,21 @@ Shopware uses the Redis Protocol and, therefore, supports the following key/valu To run Shopware in a development context, the [Symfony CLI](https://symfony.com/doc/current/setup/symfony_server.html) will work nicely. -Below, you will find the default configuration using either Caddy, Nginx or Apache as a webserver. - - - - -```text -mydomain.com { - header { - X-Frame-Options DENY - Referrer-Policy no-referrer-when-downgrade - } - - @svg { - file - path *.svg - } - - header @svg Content-Security-Policy "script-src 'none'" - - @default { - not path /theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /recovery/* /sitemap/* - } - - root * public - php_fastcgi 127.0.0.1:9000 - encode zstd gzip - file_server -} -``` - - - - - -```text -server { - listen 80; - - index index.php index.html; - server_name localhost; - - client_max_body_size 32M; - - root __DOCUMENT_ROOT__/public; - - location /recovery/update/ { - index index.php; - try_files $uri /recovery/install/index.php$is_args$args; - } - - location ~ ^/(recovery\/update\/index|index|shopware-installer\.phar)\.php(/|$) { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - include fastcgi.conf; - fastcgi_param HTTP_PROXY ""; - fastcgi_buffers 8 16k; - fastcgi_buffer_size 32k; - proxy_connect_timeout 300s; - proxy_send_timeout 300s; - proxy_read_timeout 300s; - send_timeout 300s; - client_body_buffer_size 128k; - fastcgi_pass unix:/run/php/php8.2-fpm.sock; - } - - location = /sitemap.xml { - log_not_found off; - access_log off; - try_files $uri /; - } - - location = /robots.txt { - log_not_found off; - access_log off; - try_files $uri /; - } - - location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|avif|html|woff|woff2|xml)$ { - expires 1y; - add_header Cache-Control "public, must-revalidate, proxy-revalidate"; - - access_log off; - - # The directive enables or disables messages in error_log about files not found on disk. - log_not_found off; - - tcp_nodelay off; - - ## Set the OS file cache. - open_file_cache max=3000 inactive=120s; - open_file_cache_valid 45s; - open_file_cache_min_uses 2; - open_file_cache_errors off; - - location ~* ^.+\.svg$ { - add_header Content-Security-Policy "script-src 'none'"; - } - } - - location / { - try_files $uri /index.php$is_args$args; - } -} -``` - - - - - -::: info -The following modules are required: - -* mod_negotiation -* mod_rewrite -* mod_headers -* mod_deflate - -::: - -```text - - ServerName "HOST_NAME" - DocumentRoot _SHOPWARE_LOCATION_/public - - Options -Indexes +FollowSymLinks +MultiViews - AllowOverride All - Order allow,deny - allow from all - - ErrorLog ${APACHE_LOG_DIR}/shopware.error.log - CustomLog ${APACHE_LOG_DIR}/shopware.access.log combined - -``` - - - + + + ## Recommended stack We recommend the following stack: -* Webserver: Caddy -* PHP: 8.2 -* SQL: MySQL 8 or Percona MySQL 8 +* Webserver: Nginx +* PHP: 8.3 +* SQL: MySQL 8.4 or Percona MySQL 8.4 * Node: 20 -* Search: OpenSearch 2.8.0 +* Search: OpenSearch 2.17.1 * Queue: RabbitMQ -* Redis: 7.2 +* Cache: Valkey 8.0 Recommended PHP ini: diff --git a/resources/references/config-reference/server/caddy.md b/resources/references/config-reference/server/caddy.md new file mode 100644 index 000000000..6acbe551a --- /dev/null +++ b/resources/references/config-reference/server/caddy.md @@ -0,0 +1,26 @@ +# Caddy + +``` +mydomain.com { + header { + X-Frame-Options DENY + Referrer-Policy no-referrer-when-downgrade + } + + @svg { + file + path *.svg + } + + header @svg Content-Security-Policy "script-src 'none'" + + @default { + not path /theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /recovery/* /sitemap/* + } + + root * public + php_fastcgi 127.0.0.1:9000 + encode zstd gzip + file_server +} +``` \ No newline at end of file From bc6776aeabcb2bb7d6734c14010cf312a307099a Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Thu, 17 Oct 2024 10:01:34 +0200 Subject: [PATCH 2/4] chore: update spellcheck action to version 0.43.0 --- .github/workflows/spellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 168585c5f..ee2e2eb77 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: rojopolis/spellcheck-github-actions@0.41.0 + - uses: rojopolis/spellcheck-github-actions@0.43.0 name: Spellcheck with: config_path: .spellcheck.yml From b0ea260c6cf65f47704a440408f1d6938634168d Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Thu, 17 Oct 2024 10:40:19 +0200 Subject: [PATCH 3/4] feat: allow running it locally --- .gitignore | 3 ++- .wordlist.txt | 1 + Makefile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d48c759d6..daca60d87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -.vscode \ No newline at end of file +.vscode +/dictionary.dic \ No newline at end of file diff --git a/.wordlist.txt b/.wordlist.txt index ec1a5b3e5..43d6fbb88 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -1707,6 +1707,7 @@ WriteProtected WSL www xasjkyld +Valkey Xdebug XDebug xhost's diff --git a/Makefile b/Makefile index c1a041378..797b2b126 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ help: ## Show this help @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) lint: ## Runs the linting tool - docker run --rm -u ${user} -v "$(shell pwd):/docs:ro" -e INPUT_IGNORE=${ignored} avtodev/markdown-lint:v1.5 \ + docker run --rm -u ${user} -v "$(shell pwd):/docs" -w /docs -e INPUT_IGNORE=${ignored} ghcr.io/shyim/spellcheck-github-actions:add-arm64 \ --config /docs/markdown-style-config.yml /docs fix: ## Runs the linting tool and fixes simple mistakes From 0dc9c7a6194fe14bbbfbdaa9935183f177838ee5 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Thu, 17 Oct 2024 11:09:30 +0200 Subject: [PATCH 4/4] make image configureable --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 797b2b126..577943993 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ user := "$(shell id -u):$(shell id -g)" ignored = '/docs/resources/references/* /docs/adr/*' +image = jonasbn/github-action-spellcheck:0.43.0 .PHONY : help lint fix .DEFAULT_GOAL : help @@ -12,7 +13,7 @@ help: ## Show this help @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) lint: ## Runs the linting tool - docker run --rm -u ${user} -v "$(shell pwd):/docs" -w /docs -e INPUT_IGNORE=${ignored} ghcr.io/shyim/spellcheck-github-actions:add-arm64 \ + docker run --rm -u ${user} -v "$(shell pwd):/docs" -w /docs -e INPUT_IGNORE=${ignored} ${image} \ --config /docs/markdown-style-config.yml /docs fix: ## Runs the linting tool and fixes simple mistakes