Multiple repos in a single folder for rest-server

Hi,

In this comment in github issues I just talked about my use case, I’m trying to use a repo per customer app, so one customer can haver many apps and each one with its backups.

I’m also wondering if it’s possible to have a .htpasswd per folder, to have a base folder and inside a folder with the customer name and inside the credentials for that particular customer and use a single rest-server instance, because IFAIK we can setup 1 instance 1 customer this means in my particular case 16 rest-server instances.

Reading a litthe the code I noticed it expected to have the last parameter as the repo:

middleware.Pattern(r.Context())), "/:repo")

So having multiple repositories may indicate a huge change, right?

In the github comment I talk a little more about why we want such configuration.

Thanks in advance for any help, suggestion and comment.

The REST server implementation is mostly a proof of concept for the protocol, and we don’t have the time to work on the REST server much.

If you have specific needs, maybe just implement a server for the protocol yourself? It’s not that hard to do…

Maybe you’re able to find the development time, as a business (with customers) it’s probably much easier than us, who mostly work on restic in our free time for fun (at least that’s what I’m doing). :slight_smile:

1 Like

Hi @fd0, thanks for the answer.

I see, so the rest-server is not part of the restic ecosystem as a tool. Actually it is the reason I decided to use restic.

Not an issue, I can check the code and change it a little bit to fit my needs, even when it don’t have all the features I need, it have the most importants as it is now.

Two questions:

  • if something important change in restic, the rest-server will be changed too? This is a concern now that you mention it
  • any general advice about where to start looking to do the changes I mentioned? (I’m a python guy, be gentle :rofl: )

Thanks again for the help

In case anyone find it useful I just made some changes to enable multiple repo in a single folder with the rest-server, compatible with private repos, probably a crappy code and not fully tested yet. The basics seems to work just fine.

Hm, it’s a bit hard to classify this exactly. Originally, we had someone who maintained the REST server, so that I could focus on restic itself. Unfortunately, they don’t have the time any more, and I don’t have enough time to do it. Some people also switched to using rclone as a backend for restic.

We’ll probably also update the REST server, yes. In the event something like this happens, keep an eye on the changelog for each new version. We try to keep it terse, the intended audience are our users. But by now the REST protocol is pretty stable, I don’t have any big changes in mind at the moment.

No, sorry. You need to find your way around it yourself. Go is pretty easy to read, and I’ve heard that it’s not that hard for Python programmers to get started. If you have any specific questions, let us know :slight_smile:

For future Google-searchers, I’ll note here the major symptom of trying to use sub-directories / sub-folders in rest-server: Reads will give HTTP 500, and Inits will give HTTP 404. I spent some time thinking I had conflicts with my use of symbolic links until I stumbled onto Issue 76.

I may just use the “%2F” work-around for now, but @ruiztulio’s patch looks sane to my non-Go eyes. Thanks for the work on this!