Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(infra): describe the storage export path as a server-side path

Yudhi Armyndharis34649208e1e6
diff --git a/docs/14-migration-guide.md b/docs/14-migration-guide.md
index d68105657..955d8ea42 100644
--- a/docs/14-migration-guide.md
+++ b/docs/14-migration-guide.md
@@ -214,7 +214,7 @@ curl -s 'http://localhost:2785/api/infra/storage/files/count' \
# Step 2: Export all files as tar.gz
curl -s 'http://localhost:2785/api/infra/storage/export' \
-H 'X-API-Key: YOUR_KEY'
-# Response: { "message": "Storage export completed", "download": "/app/data/exports/storage-export-xxx.tar.gz" }
+# Response: { "message": "Storage export completed", "download": "data/exports/storage-export-xxx.tar.gz" }
# The archive is auto-removed after STORAGE_EXPORT_TTL_MS (default 1h), so re-import it before then.
# It is written under data/ so it survives the restart in Step 4 and stays import-able.
@@ -237,7 +237,7 @@ docker compose --profile minio up -d
curl -X POST 'http://localhost:2785/api/infra/storage/import' \
-H 'X-API-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
- -d '{"filePath": "/app/data/exports/storage-export-xxx.tar.gz"}'
+ -d '{"filePath": "data/exports/storage-export-xxx.tar.gz"}'
```
| Scenario | Support | Method |
diff --git a/openapi.json b/openapi.json
index b826120dd..e2d85c650 100644
--- a/openapi.json
+++ b/openapi.json
@@ -4488,7 +4488,7 @@
"parameters": [],
"responses": {
"200": {
- "description": "JSON pointing at the archive that was written under data/exports/. This route does NOT stream the tar.gz itself — fetch it from the returned `download` path.",
+ "description": "JSON pointing at the archive that was written under data/exports/. This route does NOT stream the tar.gz, and no route serves it: `download` is a server-side path to pass as `filePath` to POST /api/infra/storage/import.",
"content": {
"application/json": {
"schema": {
@@ -14683,8 +14683,8 @@
},
"download": {
"type": "string",
- "description": "Path to download the archive from.",
- "example": "/api/infra/storage/download/xyz.tar"
+ "description": "Server-side path of the archive, relative to the gateway working directory. Not a download URL: pass it as `filePath` to POST /api/infra/storage/import.",
+ "example": "data/exports/storage-export-1750000000000-abc.tar.gz"
}
},
"required": [
diff --git a/src/modules/infra/dto/infra-response.dto.ts b/src/modules/infra/dto/infra-response.dto.ts
index 859aa8e46..9fb66e5f1 100644
--- a/src/modules/infra/dto/infra-response.dto.ts
+++ b/src/modules/infra/dto/infra-response.dto.ts
@@ -534,7 +534,12 @@ export class StorageExportResponseDto {
@ApiProperty({ example: 'Storage archive created.' })
message!: string;
- @ApiProperty({ description: 'Path to download the archive from.', example: '/api/infra/storage/download/xyz.tar' })
+ @ApiProperty({
+ description:
+ 'Server-side path of the archive, relative to the gateway working directory. Not a download URL: ' +
+ 'pass it as `filePath` to POST /api/infra/storage/import.',
+ example: 'data/exports/storage-export-1750000000000-abc.tar.gz',
+ })
download!: string;
}
diff --git a/src/modules/infra/infra-storage.controller.ts b/src/modules/infra/infra-storage.controller.ts
index 9f8596807..3cbc3476b 100644
--- a/src/modules/infra/infra-storage.controller.ts
+++ b/src/modules/infra/infra-storage.controller.ts
@@ -133,7 +133,8 @@ export class InfraStorageController implements OnApplicationBootstrap {
status: 200,
description:
'JSON pointing at the archive that was written under data/exports/. This route does NOT stream ' +
- 'the tar.gz itself — fetch it from the returned `download` path.',
+ 'the tar.gz, and no route serves it: `download` is a server-side path to pass as `filePath` to ' +
+ 'POST /api/infra/storage/import.',
type: StorageExportResponseDto,
})
async exportStorage(): Promise<{ message: string; download: string }> {