Open DoCode opened 5 years ago
Duplicate of #36 ?
Nop, I come tomorrow with details for this feature.
Ah, maybe #36 is mostly about auth on the service..
This is a bit of a hack, but you can run two instances of BaGet side-by-side by setting the PathBase
variable. These won't be able to share resources though. Is this acceptable?
Maybe have a way to work in multi-tenancy in the web host?
It'd be great if feeds could be created from the UI, keys managed centrally -- one key for multiple feeds, etc.
EDIT: Multi tenancy is probably the way to go:
Against multi tenancy:
I implemented a multi-tenant service, based on the NuGet.Server code base. It's rudimentary but it works for us.
The tenants stored in a simple JSON file: Feed URL, users with passwords and API keys.
The API creates dynamically the controllers from the NuGet.Server.
See that base classes: IHttpControllerActivator
, HttpControllerDescriptor
, DefaultHttpControllerSelector
All this works very well and stable. But it based on the old
v2 NuGet protocol... ;-)
I'd like to do a prototype of multi tenancy on BaGet before committing to anything. I'm worried that this feature could hurt BaGet's ease-of-use and bring complexity to the code base.
Yes, that's a different architecture, but when its injected in BaGet, it's irrelevant if a user has one or more feeds/tenants...
In spite of the PathBase
was set, for example /nuget/core
, the static files' href still were the root path /static/css/main.a14e254f.css
It seems to be broken. I'll need to dig deeper into this, I wasn't able to figure this out easily.
@loic-sharma Have any news here? May I do something for you to resolve this issue?
i'm working on a prototype for investigations about "multiple feeds"
routing can be enhanced with a few small changes, but i found one issue located here
the 2 red items are not rendering the tenant into the url "localhost/tenantid/v3/registration" because the call "url.AbsoluteUrl" is not supporting that, the other one using "url.AbsoluteRoutingUrl" are perfectly working=> i have a implementation proposal for that..... but during regression tests i found one issue/question about trailing slash.
currently, "PackageBase" and "RegistrationBase" are delivered WITH trailing slash, the other items (PackagePublish, SymbolPublish etc) are delivered WITHOUT trailing slash.
Is this different behavior intended ? if we change the implementation for the two red items into "AbsoluteRoutingUrl" then we deliver WITHOUT trailing slash, and i'm not sure about the impact....
Werner
@kexxxfeng I haven't had a chance to look deeper into this yet.
@WernerMairl Whether there's a trailing slash shouldn't matter, that behavior is unintentional. What is AbsoluteRoutingUrl
? I can't find documentation for that anywhere.
AbsoluteRoutingUrl creates a Url based on the ROUTING information from the (incoming) request.
for my prototype i have added a additional "variable" into the routing template: "http/localhost/{feed}/v3/{controller}" AbsoluteRouteUrl ensures that the value for "{feed}" is resolved at runtime!
a few changes made for routing available for discussion/feedback here:
https://github.com/mssforks/BaGet/tree/feature/tenants
(not ready for PR but showing the changes with the highest impact)
Like myget. Under different URL's: