-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited path rewrites. #2076
Comments
I'm more then happy to use a plugin for this, just trying to figure out one that works. The linked one does not for my use cause because it requires the client to support 30x redirects. Which unfortunately a lot of implementations do not. (yes I know it's a standard that has existed forever, but thus is legacy clients). Currently going down the path of trying to get javlin to be able to reprocess a quest with a modified path. Not having much luck. Also, is there some plugin repo? I only see the ones listed on your site made by you. Or is it something to just search github for? |
How about running reposilite behind a reverse proxy instead? (nginx, traefik, caddy.. to name a few) That way you could simply apply some URL rewrite rules at the proxy level and have them be opaque to the connecting client. |
That is a possibility, everything is already passing through traefik for one of the servers I manage. But it would be nice to have a simpler/light weight solution for the other servers where a reverse proxy isn't already setup. It's a useful feature of 2.x, that was nuked. Just seems weird to setup a whole other docker/server for what in effect ends up being just editing two strings in the handler. Plus doing it on Reposilite's end allows for one place integration with adding/removing repositories. |
I think that the proper solution should be covered on a plugin api level. I also don't want to make this feature a part of Reposilite's config, because it'd kinda open this whole topic once again. Probably the easiest way to expose this function could be achieved by moving current endpoint implementation to some sort of a factory, so you'd just simply do something like I'm quite tired right now, so I'll take a look at it a little bit later - hopefully tomorrow. |
Alright, I was able to find a solution that is functional. I'm not the biggest fan of it because it has hardcoded a few magic strings {to filter out frontend files}, and i cant get config to work correct, so if you have any ideas for a better solution let me know. |
Touching underlying servlet api and frontend specific files might not be the best way to go, I'm not sure if it'd work properly with further request processing 🤔 Instead, I'd try to iterate over root directories in redirected repo and just register a new route for each one of them: reposilite/reposilite-backend/src/main/kotlin/com/reposilite/redirect/RedirectPlugin.kt Lines 18 to 66 in a5b206b
~ #2077 We could hide this behind |
Released with 3.5.9: I didn't have time to test it tho, so let me know in case of any issues. |
I noticed that we're missing docs for the redirect plugin, so let's keep it open until I find time to cover that in the guide. |
Saw this popup in my github notifications again. Single Hosted at: Note the lack of 'ant' directory in the This is my main concern/smallest use case. Below is a overarching "I would like a system like this" explination. {
"base": "https://maven.my.site/",
"mainRepo": "releases",
"repos": [
{
"name": "releases",
"quota": "0b",
"proxies": [{
"target": "team",
"filter": "net.team"
}, {
"target": "mark",
"filter": "org.mark"
}, {
"target": "sally",
"filter": "org.sally"
}, {
"target": "wayde",
"filter": "com.wayde"
}, {
"target": "central"
}
]
}, {
"name": "team"
"quota": "10GB"
}, {
"name": "mark"
"quota": "1GB"
}, {
"name": "sally",
"quota": "50MB"
}, {
"name": "wayde",
"quota": "5GB",
"proxies": [
{
"target": "https://maven.wayde.com/",
"filter": "com.wayde",
"cache": true
}
]
}, {
"name": "central",
"quota": "500GB",
"proxies": [
{
"target": "https://repo1.maven.org/maven2/",
"cache": true
}
]
}
],
"users": [
{
"name": "mark",
"permissions": {
"/mark/org/mark/": "rw",
"/team/net/team/": "rw"
}
}, {
"name": "sally",
"permissions": {
"/sally/org/sally/": "rw",
"/team/net/team/": "rw"
}
}
]
} the following files on disc:
The following files exist remotely:
All of this data should be accessible via the
Ideally users would be able to publish to the root directory as well, but this is far less important as configuring dev's is far easier then users.
Overall this boils down to somthing like this:
Yes there are issues if there is a folders in a proxied repo that matches a repo name. Making us not know if they mean the artifact or the repo. But honestly I don't think that's a concern worth caring about. But with this layout you can see some of the features that I would like to be able to do: Anyways, I don't actually expect you to implement this especially not any time soon. But this is what I would like to have possible. If it is possible to do this like this I would like know how and preferably have a useable example. |
Yup, it was not supposed to support mirrored content - just a simple redirect for a local content. I don't think it makes sense to it provide a more advanced support at this point, especially that I have a feeling that it could be tackled at the proxy level 🤔 I'll try to think about it during 4.x development phase, maybe we can sneak in something helpful for such use-case.
Yeah, I think I get the idea. My main concern is that it introduces complexity at both levels - implementation & UX. By design, Reposilite also tries to provide the simplest possible solution that is flexible enough for most of the people - that's why we don't even have user accounts in the first place. Anyway, some significant stuff will change in 4.x, so thanks for the extra input - I'll try to think about that too. |
How would it be addressed at the proxy level? Or do you mean at the reverse proxy on the host side? Anyways, fundamentally to fit my currently active usecase all that would be needed is the "make everything point at releases" code I posted in my first post. So that I can update without having to redirect all old users.
Looking forward to it, currently using the 2.x branch as it's functional and i've modified it to my needs. But would be nice to not use a fork.
Ya, that whole description was a wish list style, and addressed multiple different feature wants. |
Request details
I know I'm late to the party, however looking at upgrading form 2.x to 3.x and saw that path rewriting was removed. As this makes sense from a complexity viewpoint. Is there any possibility of a limited scope of this returning. My main issue is that the maven I run is old and used by tons of people/old software and it's a real hassle/impossible to get them to update anything. However the maven is really simple, it's just one repo with a couple of proxied repos behind it. I don't have to worry about people uploading to re-written addresses because everyone who uploads is easily contactable and can update their paths. I'm concerned with the plethora of existing links out in the internet and in old versions of the software.
So what I am requesting is a single configuration value on GET/HEAD requests.
As a proof of concept I tried this code, and it works exactly how I want it.
Note: this is just a quick POC as I have no idea how you'd want to store this config value or expose it in the settings menu. But I think it may be simple enough in this limited scope to be worth considering.
Heck, if this is possible in some other way let me know, your update guide says this can be imitated with custom repos, I'm assuming you mean by having a repo for each of the root folders and redirecting it using a loopback url to 'release' repo? Which is a real pain to setup. If there is a simpler option please let me know.
The text was updated successfully, but these errors were encountered: