-
Notifications
You must be signed in to change notification settings - Fork 654
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
Add search functionality #65
Conversation
My biggest concern here is DoS. With this patch anyone who have access to Does it make sense to include local packages there? Maybe just |
Sinopia is more likely used on a private network than on a public one so I don't see DoS as a real issue. We could use the About the local packages, our needs are to be able to search on the npm registry but also to be able to find the private packages we published on Sinopia. |
I think I'm in a similar situation as @yannickcr . I want to be able to search private packages, (even: want to be able to search only private packages), and since this will most likely be internal, I don't care about DDOS. But if that's a problem in general, it could be only enabled in the config, or even (config.yaml):
I'd be happy to contribute here if needed. |
+1 Would really appreciate being able to search for packages! Also willing to contribute if needed? |
+1 search would be awesome |
+1 on searching private. @rlidwka - thoughts? |
+1 on searching private. Not concerned with DoS here either. |
Another +1 here. Would looove to see this feature. 👍 |
great. I will give this a go |
…d "error"), not an actual error ref #65
For each of the packages check if user has access to it and remove package info from the result if he doesn't. ref #65
Thanks, merging. I also changed it a bit (see commits before), most notably adding access control (with your version anybody who have access to "" package would see anything). Please check that out. There is still a lot of issues with this, for example it polls only the first uplink (if it's unreachable, returns {} which confuses npm a lot), but I suppose it would work for now. (sorry for the delayed response, was on vacation for a month) |
Great ! Thanks. |
perhaps I'm misunderstanding something, but I can't get the search to work . https://registry.npmjs.org/-/_view/byKeyword??startkey=["http"]&endkey=["http",{}]&group_level=2 works fine, however, http://dev.npm.myrepo/-/_view/byKeyword?startkey=["http"]&endkey=["http",{}]&group_level=2 doesn't am I missing something, or have I completely misunderstood what the search function does in sinopia ? thanks! |
Fix rlidwka#65 and also PR on fl4re#4
I've implemented the search functionality, it should fix #36
Basically, it will fetch package list from npm and simply append the local ones in the response.
This patch:
/-/all/*
).get_recent_packages
method inlocal-storage
to list the packages more recent than a given timestamp.search
method instorage
to run the request to npm and to append the local packages (found withget_recent_packages
) to the response.