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

deduplicate server configuration #1514

Merged
merged 4 commits into from
Oct 17, 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
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.vscode
.vscode
/dictionary.dic
1 change: 1 addition & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@
WSL
www
xasjkyld
Valkey

Check warning on line 1710 in .wordlist.txt

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] .wordlist.txt#L1710

Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE) Suggestions: `Xdebug` Rule: https://community.languagetool.org/rule/show/ENGLISH_WORD_REPEAT_RULE?lang=en-US Category: MISC
Raw output
.wordlist.txt:1710:7: Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
 Suggestions: `Xdebug`
 Rule: https://community.languagetool.org/rule/show/ENGLISH_WORD_REPEAT_RULE?lang=en-US
 Category: MISC
Xdebug
XDebug
xhost's
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: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} ${image} \
--config /docs/markdown-style-config.yml /docs

fix: ## Runs the linting tool and fixes simple mistakes
Expand Down
185 changes: 27 additions & 158 deletions guides/installation/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@
* `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
Expand Down Expand Up @@ -76,6 +76,7 @@

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)
Expand All @@ -86,153 +87,21 @@

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.

<Tabs>
<Tab title="Caddy">

```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
}
```

</Tab>

<Tab title="Nginx">

```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;
}
}
```

</Tab>

<Tab title="Apache">

::: info
The following modules are required:

* mod_negotiation
* mod_rewrite
* mod_headers
* mod_deflate

:::

```text
<VirtualHost *:80>
ServerName "HOST_NAME"
DocumentRoot _SHOPWARE_LOCATION_/public
<Directory _SHOPWARE_LOCATION_>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/shopware.error.log
CustomLog ${APACHE_LOG_DIR}/shopware.access.log combined
</VirtualHost>
```

</Tab>
</Tabs>
<PageRef page="../../resources/references/config-reference/server/apache" />

Check warning on line 90 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L90

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:90:14: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check warning on line 90 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L90

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:90:72: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
<PageRef page="../../resources/references/config-reference/server/caddy" />

Check warning on line 91 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L91

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:91:14: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check warning on line 91 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L91

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:91:71: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
<PageRef page="../../resources/references/config-reference/server/nginx" />

Check warning on line 92 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:92:14: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check warning on line 92 in guides/installation/requirements.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/installation/requirements.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/installation/requirements.md:92:71: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

## 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:
<PageRef page="../hosting/performance/performance-tweaks#php-config-tweaks" />
Expand Down
26 changes: 26 additions & 0 deletions resources/references/config-reference/server/caddy.md
Original file line number Diff line number Diff line change
@@ -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
}
```
Loading