From f8d600ef1246346e4dda53b9cc16aed5dcbe4eb0 Mon Sep 17 00:00:00 2001 From: Dominik Matic Date: Tue, 11 Mar 2025 16:22:24 +0100 Subject: [PATCH 1/5] How to configure remote storage for shopware 6.x --- ...nfigure-remote-storage-for-shopware-6-x.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md new file mode 100644 index 00000000..87989293 --- /dev/null +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md @@ -0,0 +1,108 @@ +--- +myst: + html_meta: + description: Configure remote storage for Shopware 6.x. Learn how to configure + Shopware 6 to start storing files in your bucket. + title: How to Configure Remote Storage for Shopware 6.x | Hypernode +--- + +# How to Configure Remote Storage for Shopware 6.x + + +Shopware 6.x supports remote storage for different types of files, allowing you to store assets such as product images, documents, and other media in an external storage service instead of the local server. + +Using remote object storage in Shopware 6 provides several benefits, including: + +- Offloading storage from your server, reducing the load on your server, and improving performance. +- Allows you to make use of [horizontal scaling](../../hypernode-platform/autoscaling/how-does-horizontal-autoscaling-work), as you can easily add more servers without having to worry about syncing files between them. +- Allows for effortless storage capacity scaling, as you can easily increase the storage capacity of your remote storage location. +- Serving assets from a CDN, which can improve the performance of your website. + +## Configuring the application + +Configuring Shopware 6 to start storing files in your bucket is done by modifying the the general bundle configuration file located at `config/packages/shopware.yml` in your shopware root directory. + +**Hypernode Object Storage and other S3 compatible providers** + +If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following: + +```yml +shopware: + filesystem: + public: + type: 'amazon-s3' + config: + bucket: 'main' + region: 'EU' + endpoint: 'management url' + use_path_style_endpoint: true + credentials: + key: 'access key' + secret: 'secret key' + +``` + +You can get the required management URL, access key, and secret key by running `hypernode-object-storage info` with the `--with-credentials` flag: + +```console +app@testapp ~ # hypernode-object-storage info --with-credentials ++--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ +| UUID | Name | Plan | Hypernodes | Management URL | Access Key | Secret Key | ++--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ +| 12345678-9012-3456-b7e3-19ab43df4a23 | testappbucket1 | OS200GB | testapp | https://example.ams.objectstore.eu | abcd1234 | abcd1234 | ++--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+ +``` + +**AWS S3** + +If you're using Amazon's S3 bucket, your configuration file should include the following: + +```yml +shopware: + filesystem: + public: + type: 'amazon-s3' + config: + bucket: 'your bucket name' + region: 'your aws region' + credentials: + key: 'your aws access key' + secret: 'your aws secret key' + +``` + +## Syncing the files + +You can use the following to sync the files between your local and remote storage: + +```bash +hypernode-object-storage objects sync pub/media/ s3://my_bucket_name/media/ +hypernode-object-storage objects sync var/import_export s3://my_bucket_name/import_export +``` + +The `hypernode-object-storage objects sync` command runs the sync process in the background +and provides the Process ID (PID). You can monitor the sync progress using: + +```bash +hypernode-object-storage objects show PID +``` + +Alternatively, you can use the AWS CLI directly: + +```bash +aws s3 sync pub/media/ s3://my_bucket_name/media/ +aws s3 sync var/import_export s3://my_bucket_name/import_export +``` + +## Serving assets from your S3 bucket + +To serve media assets directly from your S3 bucket, you need to adjust your nginx configuration. +Fortunately, `hypernode-manage-vhosts` [simplifies this process for you](../../hypernode-platform/nginx/hypernode-managed-vhosts.md#object-storage-and-hypernode-managed-vhosts). + +### Configuring Amazon S3 bucket policies + +If you’re using Amazon S3, ensure that your S3 bucket has ACLs enabled. + +## Shopware remote storage documentation + +- [Filesystem](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html) From 6541ec52ad570c76249f996a79fa5675ff2776b4 Mon Sep 17 00:00:00 2001 From: Dominik Matic Date: Tue, 11 Mar 2025 16:26:19 +0100 Subject: [PATCH 2/5] change yml->yaml --- .../how-to-configure-remote-storage-for-shopware-6-x.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md index 87989293..01b9fd15 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md @@ -26,7 +26,7 @@ Configuring Shopware 6 to start storing files in your bucket is done by modifyin If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following: -```yml +```yaml shopware: filesystem: public: @@ -57,7 +57,7 @@ app@testapp ~ # hypernode-object-storage info --with-credentials If you're using Amazon's S3 bucket, your configuration file should include the following: -```yml +```yaml shopware: filesystem: public: From 9735ad0aaa1ba92eda8c3e932e6b8f27655f059f Mon Sep 17 00:00:00 2001 From: Dominik Matic Date: Tue, 11 Mar 2025 16:31:21 +0100 Subject: [PATCH 3/5] apply mdformat --- .../how-to-configure-remote-storage-for-shopware-6-x.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md index 01b9fd15..509738d1 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md @@ -8,7 +8,6 @@ myst: # How to Configure Remote Storage for Shopware 6.x - Shopware 6.x supports remote storage for different types of files, allowing you to store assets such as product images, documents, and other media in an external storage service instead of the local server. Using remote object storage in Shopware 6 provides several benefits, including: From 09d76e5bd67ff1fd367ea4cd03a2ea128e7b2013 Mon Sep 17 00:00:00 2001 From: Dominik Matic Date: Wed, 12 Mar 2025 10:56:04 +0100 Subject: [PATCH 4/5] make paths make sense with shopware, add sentence making note of the bucket name for Hypernode Object Storage --- ...how-to-configure-remote-storage-for-shopware-6-x.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md index 509738d1..b5dd1998 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md @@ -21,7 +21,7 @@ Using remote object storage in Shopware 6 provides several benefits, including: Configuring Shopware 6 to start storing files in your bucket is done by modifying the the general bundle configuration file located at `config/packages/shopware.yml` in your shopware root directory. -**Hypernode Object Storage and other S3 compatible providers** +**Hypernode Object Storage** If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following: @@ -75,10 +75,11 @@ shopware: You can use the following to sync the files between your local and remote storage: ```bash -hypernode-object-storage objects sync pub/media/ s3://my_bucket_name/media/ -hypernode-object-storage objects sync var/import_export s3://my_bucket_name/import_export +hypernode-object-storage objects sync public/media/ s3://bucket_name/media/ ``` +In the case of Hypernode Object Storage, the bucket name will always be `main`. + The `hypernode-object-storage objects sync` command runs the sync process in the background and provides the Process ID (PID). You can monitor the sync progress using: @@ -89,8 +90,7 @@ hypernode-object-storage objects show PID Alternatively, you can use the AWS CLI directly: ```bash -aws s3 sync pub/media/ s3://my_bucket_name/media/ -aws s3 sync var/import_export s3://my_bucket_name/import_export +aws s3 sync public/media/ s3://bucket_name/media/ ``` ## Serving assets from your S3 bucket From 8e304853a7e28f3e1d5034ee7c350a146143c783 Mon Sep 17 00:00:00 2001 From: Dominik Matic Date: Tue, 18 Mar 2025 10:55:18 +0100 Subject: [PATCH 5/5] move Shopware 6 OS section, fix a sentence, and remove trailing whitespace --- ...w-to-configure-remote-storage-for-shopware-6-x.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md index b5dd1998..16094165 100644 --- a/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md +++ b/docs/ecommerce-applications/shopware-6/how-to-configure-remote-storage-for-shopware-6-x.md @@ -38,7 +38,6 @@ shopware: credentials: key: 'access key' secret: 'secret key' - ``` You can get the required management URL, access key, and secret key by running `hypernode-object-storage info` with the `--with-credentials` flag: @@ -54,7 +53,7 @@ app@testapp ~ # hypernode-object-storage info --with-credentials **AWS S3** -If you're using Amazon's S3 bucket, your configuration file should include the following: +If you're using the AWS S3 service, your configuration file should include the following: ```yaml shopware: @@ -67,9 +66,12 @@ shopware: credentials: key: 'your aws access key' secret: 'your aws secret key' - ``` +### Shopware remote storage documentation + +For more details on configuring remote storage in Shopware, you can refer to the official [Shopware Filesystem documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html) + ## Syncing the files You can use the following to sync the files between your local and remote storage: @@ -101,7 +103,3 @@ Fortunately, `hypernode-manage-vhosts` [simplifies this process for you](../../h ### Configuring Amazon S3 bucket policies If you’re using Amazon S3, ensure that your S3 bucket has ACLs enabled. - -## Shopware remote storage documentation - -- [Filesystem](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html)