Internal Server Error - rest-server with --private-repos

Hi, :grinning:

I tried to use rest server with the flag --private-repos and every restic operation fails with:

Fatal: unable to open config file: unexpected HTTP response (500): 500 Internal Server Error
Is there a repository at the following location?
rest:http://user:***@localhost:8001/user/repo/

version of restic: restic 0.12.1 compiled with go1.16.6 on linux/amd64
version of rest: 0.10.0

Here is a reprex:
server:
./rest-server --append-only --prometheus --private-repos --path /tmp/restic-rest/ --listen localhost:8001 --debug

client:
restic -r rest:http://user:test@localhost:8001/user/repo backup ~/

structure of /tmp/restic-rest/

.
└── user
    └── repo
        β”œβ”€β”€ config
        β”œβ”€β”€ data
        β”‚   β”œβ”€β”€ 00
        β”‚   β”œβ”€β”€ 01
        ...
        β”‚   β”œβ”€β”€ fe
        β”‚   └── ff
        β”œβ”€β”€ index
        β”œβ”€β”€ keys
        β”‚   └── ae4d7f6025aa859b33f12f06bdde50c7089b2fa5defdc1e38107cc5e6dc708b4
        β”œβ”€β”€ locks
        └── snapshots

Output of rest-backend with --debug

Data directory: /tmp/restic-rest/
Authentication enabled
Private repositories enabled
Starting server on localhost:8001
HEAD /user/repo/config
CheckBlob()

I can reproduce this on my local computer as well as on a cloud vm.

I think the problem is that the getFilePath-function interprets the word β€˜repo’ as the filetype and fails.

Can someone reproduce it, or is it my own stupidity?
What do you think?

Thank you in advance.

Subrepositories per user are not supported in rest-server 0.10.0, see β€œStricter path sanitization” in the release notes Release v0.10.0 Β· restic/rest-server Β· GitHub .

The current master branch of rest-server has added that feature though.

1 Like