Comments (6)
I was thinking about this today as well.
I think to keep it simple you just need to be able to supply multiple --path
arguments, one per path you want to have repositories in, each having its own .htaccess
file. The server could simply look for the user in the first path/mux, and if it's not found there look in the next one you specified, etc.
One can start with the requirement that usernames must be unique over all paths (otherwise the first one will be used). So e.g. if user foo
exists in both of two paths, when /foo
is used as the path in the URL, the first path's user is used, and the data is stored there.
I don't think the other arguments need to be per-path, let's keep it simple.
from rest-server.
Specifically, I want a NewMux()
to be associated with its own Config
-- it has nothing to do with Config.Path
in particular, and my use case definitely doesn't have anything to do with .htaccess
files.
Maybe something like restserver.NewMux(restConfig)
where restConfig := restserver.Config{...}
. But I'm not sure how to attach the mux to the config.
from rest-server.
Well, I was discussing the user interface. Regardless how you build the internals, people still need to be able to supply the configuration when starting rest-server, I presume.
Yes, some kind of injecting the config to use into the Mux seems like the way to go.
from rest-server.
I think we're talking about two different things then; I am using rest-server as a library, so there is no user interface in my case. But I can understand the need to bridge the two.
from rest-server.
Got ya. I for some reason presumed that it would be something that should be exposed on the command line as well, but I understand you're just looking at the internals then. I think once those are in place it's a pretty small thing to make it accessible through the CLI as well. So never mind me.
from rest-server.
This is a good idea, a singleton config is not great. Thanks for working on this!
from rest-server.
Related Issues (20)
- MemoryHigh=bytes in Systemd Example
- New release 0.12.0 please HOT 1
- Deeper sub-levels option for extremely large repositories HOT 2
- Backup repository check fails when server is running on OS X HOT 2
- What is the purpose of the for-loop in `TestValidate` of `htpasswd_test.go`? HOT 1
- Add unit tests for listBlobsV2
- Building from source reports wrong version number HOT 3
- WARNING: fsync is not supported by the data storage HOT 7
- Support X-Forwarded-For in logging when behind a proxy HOT 1
- Migration of already existing repositories leads to 404 HOT 7
- Base URL flag HOT 2
- rest-server doesn't correctly implement REST API HOT 2
- Prepend log with date/time
- Backup fails with 'file content does not match hash' HOT 4
- FR: add Host-level access control HOT 6
- Secure default or configurable TLS settings
- Ensure that written data is correctly written HOT 2
- Additional metric: last snapshot date/timestamp(per repository) HOT 4
- Build & publish docker images HOT 5
- rest-server.socket example file contains 8080 instead of default port 8000
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest-server.