You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of Hypernode Object Storage you can get the relevant information by running `hypernode-object-storage info` with the `--with-credentials` flag:
40
+
41
+
```console
42
+
app@testapp ~ # hypernode-object-storage info --with-credentials
This is much faster than Magento's built-in sync, because `aws s3 sync` uploads files concurrently.
90
+
Both methods are significantly faster than Magento’s built-in sync, as aws s3 sync handles uploads concurrently.
66
91
67
92
## The storage flag file in the bucket
68
93
69
94
Magento's S3 implementation creates a test file called `storage.flag`, which is basically created to test if the connection works. So this is not a magic file to mark anything ([source](https://github.com/magento/magento2/blob/6f4805f82bb7511f72935daa493d48ebda3d9039/app/code/Magento/AwsS3/Driver/AwsS3.php#L104)).
70
95
71
96
## Serving assets from your S3 bucket
72
97
73
-
To start serving media assets from your S3 bucket, you need to make some adjustments to your nginx configuration. Create the following file at `/data/web/nginx/example.com/server.assets.conf` for each relevant vhost:
74
-
75
-
```nginx
76
-
set $backend "haproxy";
77
-
78
-
location @object_storage_fallback {
79
-
# Proxy to object storage
80
-
set $bucket "my_bucket_name";
81
-
proxy_cache_key "$bucket$uri";
82
-
proxy_cache_valid 200 302 7d;
83
-
proxy_cache_methods GET HEAD;
84
-
proxy_cache_background_update on;
85
-
proxy_cache_use_stale updating;
86
-
proxy_cache asset_cache;
87
-
resolver 8.8.8.8;
88
-
proxy_pass https://$bucket.s3.amazonaws.com$uri;
89
-
proxy_pass_request_body off;
90
-
proxy_pass_request_headers off;
91
-
proxy_intercept_errors on;
92
-
proxy_hide_header "x-amz-id-2";
93
-
proxy_hide_header "x-amz-request-id";
94
-
proxy_hide_header "x-amz-storage-class";
95
-
proxy_hide_header "x-amz-server-side-encryption";
96
-
proxy_hide_header "Set-Cookie";
97
-
proxy_ignore_headers "Set-Cookie";
98
-
add_header Cache-Control "public";
99
-
add_header X-Frame-Options "SAMEORIGIN";
100
-
add_header X-Cache-Status $upstream_cache_status;
101
-
expires +1y;
102
-
103
-
# If object storage fails, fallback to PHP handler
Make sure to change the string `my_bucket_name` to the name of your bucket and keep in mind that your bucket URL might be different depending on your AWS region. For example, you might need to change it from `https://$bucket.s3.amazonaws.com$uri` to `https://s3.amazonaws.com/$bucket$uri` instead.
175
-
Furthermore, ensure that your S3 bucket policies are configured correctly, so that only `/media` is publicly readable. For example:
122
+
### Configuring Amazon S3 bucket policies
123
+
124
+
If you’re using Amazon S3, ensure that your S3 bucket policies are properly configured so that only the `/media` directory is publicly accessible. For example:
Copy file name to clipboardExpand all lines: docs/hypernode-platform/object-storage/getting-started-with-object-storage.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,56 @@ app@testhypernode ~ # hypernode-object-storage info
63
63
64
64
You can use the credentials and the URL now to configure remote storage for your application with the help of [this document](../../ecommerce-applications/magento-2/how-to-configure-remote-storage-for-magento-2-x.md).
65
65
66
+
### Managing objects in object storage
67
+
68
+
You can manage your objects using the `hypernode-object-storage objects` subcommand.
69
+
It supports all common operations--listing, copying, moving, and deleting files--while also allowing you to sync files in the background and monitor the progress of an ongoing sync.
sync Synchronize files between a local directory and an object storage location
80
+
cp Copy a file or object from one location to another
81
+
ls List objects in an S3 bucket or folder
82
+
mv Move or rename a file or object
83
+
rm Delete an object from S3
84
+
show Display the current status of an ongoing sync process
85
+
86
+
options:
87
+
-h, --help show this help message and exit
88
+
```
89
+
90
+
It is important to note that `hypernode-object-storage objects` supports all optional flags available in `aws s3`, allowing you to customize its behavior for advanced configurations.
91
+
92
+
#### Syncing files and monitoring progress
93
+
94
+
Syncing files between your local directory and object storage is simple. Run the following command:
0 commit comments