From f715e137755552eda28100f102fd686d8db67888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=BCnig?= Date: Wed, 18 Sep 2024 09:56:35 +0200 Subject: [PATCH 1/2] create 6.7 folder --- shopware/core/6.7/bin/.htaccess | 11 ++ shopware/core/6.7/bin/build-js.sh | 14 ++ shopware/core/6.7/bin/ci | 55 ++++++++ shopware/core/6.7/bin/console | 60 ++++++++ shopware/core/6.7/bin/functions.sh | 39 ++++++ shopware/core/6.7/config/jwt/.gitignore | 3 + .../core/6.7/config/packages/shopware.yaml | 9 ++ shopware/core/6.7/custom/.htaccess | 11 ++ shopware/core/6.7/custom/apps/.gitignore | 0 shopware/core/6.7/custom/plugins/.gitignore | 0 .../core/6.7/custom/static-plugins/.gitignore | 0 shopware/core/6.7/files/.htaccess | 11 ++ shopware/core/6.7/manifest.json | 96 +++++++++++++ shopware/core/6.7/post-install.txt | 21 +++ shopware/core/6.7/public/.htaccess.dist | 44 ++++++ shopware/core/6.7/public/index.php | 49 +++++++ shopware/core/6.7/public/maintenance.html | 131 ++++++++++++++++++ shopware/core/6.7/root/.htaccess | 14 ++ shopware/core/6.7/var/.htaccess | 11 ++ 19 files changed, 579 insertions(+) create mode 100644 shopware/core/6.7/bin/.htaccess create mode 100644 shopware/core/6.7/bin/build-js.sh create mode 100644 shopware/core/6.7/bin/ci create mode 100644 shopware/core/6.7/bin/console create mode 100644 shopware/core/6.7/bin/functions.sh create mode 100644 shopware/core/6.7/config/jwt/.gitignore create mode 100644 shopware/core/6.7/config/packages/shopware.yaml create mode 100644 shopware/core/6.7/custom/.htaccess create mode 100644 shopware/core/6.7/custom/apps/.gitignore create mode 100644 shopware/core/6.7/custom/plugins/.gitignore create mode 100644 shopware/core/6.7/custom/static-plugins/.gitignore create mode 100644 shopware/core/6.7/files/.htaccess create mode 100644 shopware/core/6.7/manifest.json create mode 100644 shopware/core/6.7/post-install.txt create mode 100644 shopware/core/6.7/public/.htaccess.dist create mode 100644 shopware/core/6.7/public/index.php create mode 100644 shopware/core/6.7/public/maintenance.html create mode 100644 shopware/core/6.7/root/.htaccess create mode 100644 shopware/core/6.7/var/.htaccess diff --git a/shopware/core/6.7/bin/.htaccess b/shopware/core/6.7/bin/.htaccess new file mode 100644 index 00000000..09dfa0c9 --- /dev/null +++ b/shopware/core/6.7/bin/.htaccess @@ -0,0 +1,11 @@ + + # Deny all requests from Apache 2.4+. + + Require all denied + + + # Deny all requests from Apache 2.0-2.2. + + Deny from all + + diff --git a/shopware/core/6.7/bin/build-js.sh b/shopware/core/6.7/bin/build-js.sh new file mode 100644 index 00000000..535b0270 --- /dev/null +++ b/shopware/core/6.7/bin/build-js.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +BIN_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" + +set -euo pipefail + + +if [[ -e "${BIN_DIR}/build-administration.sh" ]]; then + "${BIN_DIR}/build-administration.sh" +fi + +if [[ -e "${BIN_DIR}/build-storefront.sh" ]]; then + "${BIN_DIR}/build-storefront.sh" +fi \ No newline at end of file diff --git a/shopware/core/6.7/bin/ci b/shopware/core/6.7/bin/ci new file mode 100644 index 00000000..661c0fa8 --- /dev/null +++ b/shopware/core/6.7/bin/ci @@ -0,0 +1,55 @@ +#!/usr/bin/env php +getParameterOption(['--env', '-e'], $context['APP_ENV'] ?? 'prod', true); + $debug = ($context['APP_DEBUG'] ?? ($env !== 'prod')) && !$input->hasParameterOption('--no-debug', true); + + if ($input->getFirstArgument() === 'system:install') { + $context['INSTALL'] = true; + } + + if (trim($context['DATABASE_URL'] ?? '') === '') { + // fake DATABASE_URL + $_SERVER['DATABASE_URL'] = 'mysql://_placeholder.test'; + } + + $kernel = KernelFactory::create( + environment: $env, + debug: $debug, + classLoader: $classLoader, + pluginLoader: new ComposerPluginLoader($classLoader, null), + ); + + $application = new Application($kernel); + $kernel->boot(); + + $application->setName('Shopware'); + $application->setVersion($kernel->getContainer()->getParameter('kernel.shopware_version')); + + return $application; +}; diff --git a/shopware/core/6.7/bin/console b/shopware/core/6.7/bin/console new file mode 100644 index 00000000..5d89fb32 --- /dev/null +++ b/shopware/core/6.7/bin/console @@ -0,0 +1,60 @@ +#!/usr/bin/env php +getParameterOption(['--env', '-e'], $context['APP_ENV'] ?? 'prod', true); + $debug = ($context['APP_DEBUG'] ?? ($env !== 'prod')) && !$input->hasParameterOption('--no-debug', true); + + $pluginLoader = new StaticKernelPluginLoader($classLoader, null); + + if ($input->getFirstArgument() === 'system:install') { + $context['INSTALL'] = true; + } + + if (trim($context['DATABASE_URL'] ?? '') !== '' && !isset($context['INSTALL'])) { + $pluginLoader = new DbalKernelPluginLoader($classLoader, null, Kernel::getConnection()); + } + + $kernel = KernelFactory::create( + environment: $env, + debug: $debug, + classLoader: $classLoader, + pluginLoader: $pluginLoader + ); + + $application = new Application($kernel); + $kernel->boot(); + + $application->setName('Shopware'); + $application->setVersion($kernel->getContainer()->getParameter('kernel.shopware_version')); + + return $application; +}; diff --git a/shopware/core/6.7/bin/functions.sh b/shopware/core/6.7/bin/functions.sh new file mode 100644 index 00000000..4e7cff25 --- /dev/null +++ b/shopware/core/6.7/bin/functions.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +load_dotenv() { + LOAD_DOTENV=${LOAD_DOTENV:-"1"} + + if [[ "$LOAD_DOTENV" == "0" ]]; then + return + fi + + CURRENT_ENV=${APP_ENV:-"dev"} + env_file="$1" + + # If we have an actual .env file load it + if [[ -e "$env_file" ]]; then + # shellcheck source=/dev/null + source "$env_file" + elif [[ -e "$env_file.dist" ]]; then + # shellcheck source=/dev/null + source "$env_file.dist" + fi + + # If we have an local env file load it + if [[ -e "$env_file.local" ]]; then + # shellcheck source=/dev/null + source "$env_file.local" + fi + + # If we have an env file for the current env load it + if [[ -e "$env_file.$CURRENT_ENV" ]]; then + # shellcheck source=/dev/null + source "$env_file.$CURRENT_ENV" + fi + + # If we have an env file for the current env load it' + if [[ -e "$env_file.$CURRENT_ENV.local" ]]; then + # shellcheck source=/dev/null + source "$env_file.$CURRENT_ENV.local" + fi +} diff --git a/shopware/core/6.7/config/jwt/.gitignore b/shopware/core/6.7/config/jwt/.gitignore new file mode 100644 index 00000000..cec9082b --- /dev/null +++ b/shopware/core/6.7/config/jwt/.gitignore @@ -0,0 +1,3 @@ +* + +!.gitignore diff --git a/shopware/core/6.7/config/packages/shopware.yaml b/shopware/core/6.7/config/packages/shopware.yaml new file mode 100644 index 00000000..0ecf72d1 --- /dev/null +++ b/shopware/core/6.7/config/packages/shopware.yaml @@ -0,0 +1,9 @@ +# Using the webupdater will overwrite this file. Create a second file z-shopware.yaml to override the config + +shopware: + auto_update: + # Disables the auto updater in the UI +# enabled: false + admin_worker: +# The Admin worker should be disabled on production server. +# enable_admin_worker: false diff --git a/shopware/core/6.7/custom/.htaccess b/shopware/core/6.7/custom/.htaccess new file mode 100644 index 00000000..09dfa0c9 --- /dev/null +++ b/shopware/core/6.7/custom/.htaccess @@ -0,0 +1,11 @@ + + # Deny all requests from Apache 2.4+. + + Require all denied + + + # Deny all requests from Apache 2.0-2.2. + + Deny from all + + diff --git a/shopware/core/6.7/custom/apps/.gitignore b/shopware/core/6.7/custom/apps/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/shopware/core/6.7/custom/plugins/.gitignore b/shopware/core/6.7/custom/plugins/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/shopware/core/6.7/custom/static-plugins/.gitignore b/shopware/core/6.7/custom/static-plugins/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/shopware/core/6.7/files/.htaccess b/shopware/core/6.7/files/.htaccess new file mode 100644 index 00000000..09dfa0c9 --- /dev/null +++ b/shopware/core/6.7/files/.htaccess @@ -0,0 +1,11 @@ + + # Deny all requests from Apache 2.4+. + + Require all denied + + + # Deny all requests from Apache 2.0-2.2. + + Deny from all + + diff --git a/shopware/core/6.7/manifest.json b/shopware/core/6.7/manifest.json new file mode 100644 index 00000000..6902307e --- /dev/null +++ b/shopware/core/6.7/manifest.json @@ -0,0 +1,96 @@ +{ + "copy-from-recipe": { + "bin/": "%BIN_DIR%/", + "config/": "%CONFIG_DIR%/", + "custom/": "custom/", + "files/": "files/", + "public/": "%PUBLIC_DIR%/", + "var/": "var/", + "src/": "src/", + "root/": "" + }, + "bundles": { + "Shopware\\Core\\Framework\\Framework": [ + "all" + ], + "Shopware\\Core\\System\\System": [ + "all" + ], + "Shopware\\Core\\Content\\Content": [ + "all" + ], + "Shopware\\Core\\Checkout\\Checkout": [ + "all" + ], + "Shopware\\Core\\Maintenance\\Maintenance": [ + "all" + ], + "Shopware\\Core\\DevOps\\DevOps": [ + "e2e" + ], + "Shopware\\Core\\Profiling\\Profiling": [ + "all" + ] + }, + "container": { + "shopware.store.frw": true, + "default_cdn_strategy": "physical_filename", + "shopware.cdn.strategy": "%env(default:default_cdn_strategy:SHOPWARE_CDN_STRATEGY_DEFAULT)%" + }, + "env": { + "APP_ENV": "prod", + "APP_URL": "http://127.0.0.1:8000", + "APP_SECRET": "%generate(secret)%", + "INSTANCE_ID": "%generate(secret)%", + "BLUE_GREEN_DEPLOYMENT": "0", + "DATABASE_URL": "mysql://root:root@localhost/shopware", + "#1": "With Shopware 6.4.17.0 the MAILER_DSN variable will be used in this template instead of MAILER_URL", + "MAILER_URL": "null://null" + }, + "gitignore": [ + ".env.local", + ".env.local.php", + ".env.*.local", + "/public/bundles/*", + "/public/media/*", + "/public/theme/*", + "/public/thumbnail/*", + "/public/sitemap/*", + "/files/*", + "!/files/.htaccess", + "/var/*", + "!/var/.htaccess", + "/auth.json", + "/install.lock", + "public/asset-manifest.json" + ], + "composer-scripts": { + "assets:install": "symfony-cmd" + }, + "docker-compose": { + "docker-compose.yml": { + "services": [ + "database:", + " image: mysql:${MYSQL_VERSION:-8}-oracle", + " environment:", + " MYSQL_DATABASE: ${MYSQL_DATABASE:-shopware}", + " # You should definitely change the password in production", + " MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-!ChangeMe!}", + " MYSQL_USER: ${MYSQL_USER:-shopware}", + " MYSQL_PASSWORD: ${MYSQL_PASSWORD:-!ChangeMe!}", + " volumes:", + " - db-data:/var/lib/mysql:rw", + " # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!", + " # - ./docker/db/data:/var/lib/mysql:rw" + ], + "volumes": ["db-data:"] + }, + "docker-compose.override.yml": { + "services": [ + "database:", + " ports:", + " - \"3306\"" + ] + } + } +} diff --git a/shopware/core/6.7/post-install.txt b/shopware/core/6.7/post-install.txt new file mode 100644 index 00000000..18d1b8f9 --- /dev/null +++ b/shopware/core/6.7/post-install.txt @@ -0,0 +1,21 @@ + * Setup your repository: + + 1. Go to the project directory + 2. Create your code repository with the git init command and push it to your favourite Git service + + * Run Shopware locally: + + 1. Adjust the .env file to your database + 2. Run ./bin/console system:install --basic-setup + 3. Optional: If you use Symfony CLI start the webserver symfony server:start -d + 3. The default credentials for administration are admin with password shopware + + * Run Shopware with Docker & Symfony CLI: + + 1. Start the docker containers with docker compose up -d + 2. Run symfony console system:install --basic-setup + 3. Start the webserver symfony server:start -d + 4. The default credentials for administration are admin with password shopware + 5. Optional: Open the Mail catcher with symfony open:local:webmail + + * Read the documentation at https://developer.shopware.com/ diff --git a/shopware/core/6.7/public/.htaccess.dist b/shopware/core/6.7/public/.htaccess.dist new file mode 100644 index 00000000..62601e58 --- /dev/null +++ b/shopware/core/6.7/public/.htaccess.dist @@ -0,0 +1,44 @@ +# BEGIN Shopware +# The directives (lines) between "# BEGIN Shopware" and "# END Shopware" are dynamically generated. Any changes to the directives between these markers will be overwritten. + +DirectoryIndex index.php + + + Options -MultiViews + + + + RewriteEngine On + + RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ + RewriteRule ^(.*) - [E=BASE:%1] + + # Sets the HTTP_AUTHORIZATION header removed by Apache + RewriteCond %{HTTP:Authorization} . + RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + RewriteCond %{ENV:REDIRECT_STATUS} ^$ + RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] + + # If the requested filename exists, simply serve it. + # We only want to let Apache serve files and not directories. + RewriteCond %{REQUEST_FILENAME} -f + RewriteRule ^ - [L] + + # Rewrite all other queries to the front controller. + RewriteRule ^ %{ENV:BASE}/index.php [L] + + + + + RedirectMatch 302 ^/$ /index.php/ + + + + + + Header set Content-Security-Policy "script-src 'none'" + + + +# END Shopware diff --git a/shopware/core/6.7/public/index.php b/shopware/core/6.7/public/index.php new file mode 100644 index 00000000..61c8694d --- /dev/null +++ b/shopware/core/6.7/public/index.php @@ -0,0 +1,49 @@ + + + + + Wartungsmodus + + + + +
+

Unsere Website befindet sich gerade in der Wartung.

+ +

+ Wir stehen Ihnen bald wieder zur Verfügung. Entschuldigen Sie etwaige Unannehmlichkeiten. +

+ +
+ +

Our website is currently undergoing maintenance.

+ +

+ We'll be back very soon. Sorry for any inconvenience. +

+ +
+
+ + diff --git a/shopware/core/6.7/root/.htaccess b/shopware/core/6.7/root/.htaccess new file mode 100644 index 00000000..6c961e71 --- /dev/null +++ b/shopware/core/6.7/root/.htaccess @@ -0,0 +1,14 @@ +DirectoryIndex index.html index.php + + + Options -MultiViews + + + + # Restrict access to VCS directories + RedirectMatch 404 /\\.(svn|git|hg|bzr|cvs)(/|$) + + # Restrict access to root folder files + RedirectMatch 404 /(composer\.(json|lock|phar)|README\.md|\.gitignore|.*\.dist|\.env.*)$ + + diff --git a/shopware/core/6.7/var/.htaccess b/shopware/core/6.7/var/.htaccess new file mode 100644 index 00000000..09dfa0c9 --- /dev/null +++ b/shopware/core/6.7/var/.htaccess @@ -0,0 +1,11 @@ + + # Deny all requests from Apache 2.4+. + + Require all denied + + + # Deny all requests from Apache 2.0-2.2. + + Deny from all + + From 97b8a04cec2c6efa276c4c88dd4893b757fa570b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=BCnig?= Date: Wed, 18 Sep 2024 09:57:19 +0200 Subject: [PATCH 2/2] don't use a media Fallback for static assets ( #1461 ) --- shopware/core/6.7/public/.htaccess.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/shopware/core/6.7/public/.htaccess.dist b/shopware/core/6.7/public/.htaccess.dist index 62601e58..dab5148f 100644 --- a/shopware/core/6.7/public/.htaccess.dist +++ b/shopware/core/6.7/public/.htaccess.dist @@ -26,6 +26,7 @@ DirectoryIndex index.php RewriteRule ^ - [L] # Rewrite all other queries to the front controller. + RewriteCond %{REQUEST_URI} !^/(theme|media|thumbnail|bundles|css|fonts|js|recovery|sitemap) [NC] RewriteRule ^ %{ENV:BASE}/index.php [L]