From 1243721a7e6a11d1dd34e5388d45e3d0d609e81b Mon Sep 17 00:00:00 2001 From: Ben Jones Date: Thu, 23 Jul 2020 15:21:55 +1200 Subject: [PATCH 1/2] add support for rest server backends Backend configuration would be; ``` rest_repo: type: rest path: http://backup:8001/repo_name ``` Would result in the following env var; ``` RESTIC_REPOSITORY=rest:http://backup:8001/repo_name ``` --- src/backend.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend.ts b/src/backend.ts index 3b9e81b..566f89e 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -17,9 +17,8 @@ export const getPathFromBackend = (backend: Backend): string => { case 'gs': case 's3': case 'sftp': - return `${backend.type}:${backend.path}` case 'rest': - throw new Error(`Unsupported backend type: "${backend.type}"`) + return `${backend.type}:${backend.path}` default: throw new Error(`Unknown backend type.`) } From 309073fe4de243348ef4bd7a394e462c9e5ad005 Mon Sep 17 00:00:00 2001 From: Ben Jones Date: Thu, 23 Jul 2020 23:26:31 +1200 Subject: [PATCH 2/2] Update available.md --- docs/md/backend/available.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/md/backend/available.md b/docs/md/backend/available.md index f911f15..1b4a1ce 100644 --- a/docs/md/backend/available.md +++ b/docs/md/backend/available.md @@ -48,4 +48,15 @@ backends: path: my-host:/remote/path/on/the/server ``` +## Rest Server + +See [here](https://github.com/restic/rest-server) for how to install a rest server backend and [here](https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) for further documentation. + +```yaml +backends: + name-of-backend: + type: rest + path: http://localhost:8000/repo_name +``` + > :ToCPrevNext