From 1a99d7c967ad3108902d8aa3cf3ee193dd3460fa Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Thu, 5 Sep 2024 15:41:30 +0200 Subject: [PATCH 1/3] Rename s3-credentials and add rotate-secrets --- pages/edge/learn/volumes.mdx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pages/edge/learn/volumes.mdx b/pages/edge/learn/volumes.mdx index e448170..e22c34a 100644 --- a/pages/edge/learn/volumes.mdx +++ b/pages/edge/learn/volumes.mdx @@ -86,13 +86,13 @@ You can inspect volumes in two ways: Volumes are not only available to your apps, but can also be remotely accessed through the standard S3 API, or through a builtin web UI. -You can use the CLI to retrieve S3 credentials: +You can use the CLI to retrieve the credentials: ```bash -wasmer app volumes s3-credentials +wasmer app volumes credentials --format=json ``` -This will print the S3 API URL, access key and secret key. +This will print the S3 API URL, access key and secret key in the JSON format. @@ -107,7 +107,7 @@ to your volumes. It even allows mounting a volume to your local machine! You can get an rclone configuration snippet through the CLI: ```bash -wasmer app volumes s3-credentials --rclone-print +wasmer app volumes credentials --format=rclone ``` This will print out a configuration snippet that can be added to the rclone @@ -137,3 +137,13 @@ rclone copy ./local-filename :/remote-filename mkdir my-volume rclone mount : ./my-volume ``` + +### Rotating credentials +In order to rotate (i.e. automatically assign a different value) the credentials tied to your volumes, +you can simply run this command with the CLI: + +```bash +wasmer app volumes rotate-secrets +``` + +This command will rotate their values and show the new ones directly in the CLI. From 6619d83817b112162aa5c30d2148c62a6d6ff838 Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Mon, 9 Sep 2024 09:25:03 +0200 Subject: [PATCH 2/3] Minor changes to volumes' docs --- pages/edge/learn/volumes.mdx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pages/edge/learn/volumes.mdx b/pages/edge/learn/volumes.mdx index e22c34a..5aa1fe7 100644 --- a/pages/edge/learn/volumes.mdx +++ b/pages/edge/learn/volumes.mdx @@ -12,7 +12,7 @@ In the current initial implementation, volumes are restricted to a single [Edge region](/edge/learn/regions). Volumes also at the moment only provide *read-write-many* semantics. -Due the automatic auto-scaling for apps, this means that volumes are not currently +Due to the automatic auto-scaling for apps, this means that volumes are not currently well-suited for databases or other more complex use cases that require a single writer. Keep in mind that volumes can be accessed concurrently, and even from different @@ -22,7 +22,7 @@ These restrictions (including the single-region restriction) will be lifted in the future. -## Using Volumes With rclone +## Create and Use Volumes * Every app may have multiple volumes. * Each volume has a name, which must be unique for the application. @@ -39,19 +39,17 @@ volumes: # A name for your volume. # Must be unique for the given app. - name: data - # Where to mount the volume into the filesystem. - # You can specify multiple mounts with optional subpaths. - mounts: - # Mount the volume to `/data`. - - mount_path: /data - # Optional: the subdirectory of the volume to mount. - # subpath: /subpath + # Create a persistent volume named "data" in `/data`. + mount: /data + + - name: more_data + # Create a persistent volume named "more_data" in `/other_mntpoint`. + mount: /other_mntpoint ``` -This will create a new "data" volume, which will be mounted at `/data`. +This will create two new volumes: "data", which will be mounted at `/data` and "more_data" which will be mounted at `/other_mntpoint`. -Now just re-deploy your app with `wasmer deploy`. -The volume will be automatically created. +Now just re-deploy your app with `wasmer deploy`, and the volume will be automatically created. Your application can now use the mount path and treat it as persistent storage. From a707bc95c5f56804eac2b8858b128e107c1c8edb Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Mon, 9 Sep 2024 09:27:38 +0200 Subject: [PATCH 3/3] tabs -> spaces --- pages/edge/learn/volumes.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/edge/learn/volumes.mdx b/pages/edge/learn/volumes.mdx index 5aa1fe7..8a53ac3 100644 --- a/pages/edge/learn/volumes.mdx +++ b/pages/edge/learn/volumes.mdx @@ -40,11 +40,11 @@ volumes: # Must be unique for the given app. - name: data # Create a persistent volume named "data" in `/data`. - mount: /data + mount: /data - name: more_data # Create a persistent volume named "more_data" in `/other_mntpoint`. - mount: /other_mntpoint + mount: /other_mntpoint ``` This will create two new volumes: "data", which will be mounted at `/data` and "more_data" which will be mounted at `/other_mntpoint`.