Restic rest-server authentication with environment variables not working

I setup a brand new rest-server with docker today (version 0.13.0) and tried to use restic (version 0.14.0) to create a new repository.

I setup a user with docker exec -ti create user myuser and set a password.

Then i set in my shell

export RESTIC_REPOSITORY=rest:http://hostname:8000/backup
export RESTIC_PASSWORD=<verySecr3t>
export RESTIC_REST_USERNAME=myuser
export RESTIC_REST_PASSWORD=<passwordFromAbove>

as it is written in documentation.

Then i tried:

restic init

and got

Fatal: create repository at rest:http://hostname:8000/server-backup/ failed: Fatal: server response unexpected: 401 Unauthorized (401)

But when i run in shell

curl http://${RESTIC_REST_USERNAME}:${RESTIC_REST_PASSWORD}@hostname:8000/server-backup/
Method Not Allowed

and

curl http://${RESTIC_REST_USERNAME}:blafoo@hostname:8000/server-backup/
Unauthorized

So the RESTIC_REST_USERNAME and RESTIC_REST_PASSWORD work in curl, but not in restic.

Whats’s wrong?

1 Like

Those were only added in restic 0.16.1.

1 Like

Oh… i thougt it’s also in 0.14…

Then it’s clear, why it won’t work
Thank you.

1 Like

You can just fetch an up-to-date restic binary from github. Restic is just a single binary which makes installing rather simple.