-
Notifications
You must be signed in to change notification settings - Fork 1
Restricted access #11
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
Comments
Currently, browsing the repo is not restricted in any way. In TeamCity, when the webcontroller is registered at a certain URL, the authenticate flag is specified. Currently authentication is not required for that controller. So in theory, I could sub-class the controller with an alternative URL and set the authenticate flag to true, then the controller would require authentication. How this works in TeamCity is that accessing the URL would bounce you to the login page if there is no valid session. However, TeamCity also provides the So:
Then the repo would be accessed at http://user:pass@teamcity.company.com/httpAuth/app/debrepo-restricted/MyRepoName/ or something like that. We could come up with a better name than debrepo-restricted :-) |
The user:pass would be TeamCity username and password. The user would need read permission on the project that the repo is associated to (or a subproject). |
Should it return 404 or should it do a 301 redirect to the restricted URL? |
BTW. Thanks for the link. I was not aware a repository could be restricted. |
I guess 501 would be the least unexpected http code in that case. Your suggestion sounds awesome! I didn't quite get point 3 there, but this feature would be very helpful to us. Can we help out somehow? Testing? Coding? The name debrepo-restricted sounds very clear to me 👍 |
I don't agree with 501. The features are implemented, it's just that it is now in a different location. I think a redirect (301) and then 401 if auth required, 200 if OK or 404 if not found seems like the most logical to me. However, I will do some testing and see how APT handles it. Most of the time, APT is the client, so it should really be whatever is going to give the most useful response back to APT.
The ability to toggle whether a repo is restricted. If it's restricted then the above logic will redirect the client to the relevant location.
I'll try to have a test build available in the next few days and you can let me know how it goes.
OK, great. |
@vidstige I have a working build which implements all four of the items I listed above. WRT the redirects, I have implemented the following for handling restricted repositories:
The behaviour I have noticed from So this redirecting is not much use for APT, but is still very useful when trying to obtain the correct URL by visiting in a browser. One can then simply copy the new URL into the I will tidy up some code, and then push the branch to GitHub where it will build and I can make a test plugin ZIP file available for testing. It should be ready for you on Monday morning your time. |
This behavior makes lots of sense. That was very quick work. Thank you so much! 😊 |
Note to @netwolfuk. Consider showing user:pass in the URL of the |
As per issue #11 - Added a new controller registered at the alternative URL /app/debrepo-restricted/* - The new controller requires authentication (using TeamCity Auth and permissions) and checks that the user has read permission on the project that the repo is associated to. - Added a setting on a repository that indicates if authentication is required - Added a redirect so that http requests to the unrestricted repository address send the browser to the restricted address. - Added UI to set the restricted setting. - Updated the various links to the repositories to point to the relevant location.
Test build is available here |
As per issue #11 - Added a new controller registered at the alternative URL /app/debrepo-restricted/* - The new controller requires authentication (using TeamCity Auth and permissions) and checks that the user has read permission on the project that the repo is associated to. - Added a setting on a repository that indicates if authentication is required - Added a redirect so that http requests to the unrestricted repository address send the browser to the restricted address. - Added UI to set the restricted setting. - Updated the various links to the repositories to point to the relevant location.
Hi @vidstige. Did you get a chance to test this? |
@netwolfuk sadly no. Our TeamCity expert @rasmusgo is skiing this week. But we're thrilled and will get to it asap. Thanks again for this feature, I'll let you know how it works out for us. If not, ping again! :) |
We have installed the plugin successfully and created a debian repository in the UI. However,
Do we need to enable insecure updates or is there a way for the plugin to generate this file? |
@rasmusgo Thanks for the feedback. I am aware of this. I have tried a few things, but have not yet managed to get recent ubuntu versions to install from the plugin. See the original README from version 1.0. I am making progress on fixing this. Please see issue #14 , which relies on #13 and #4. |
We missed that table with supported linux dists. Thanks for quick reply, we'll anticipate the 1.1 release then. Some quick googling reveals it seems tricky indeed with GPG signing. Some quick googling reveals it might be possible with some fiddling around using the bouncycastle library as described eg. here. |
Yes, I think I saw that post on SO the other night whilst searching. "Clear Signing" as per the Debian docs appears to be the keyword phrase to search for. Googling that reveals this example which might be promising (and is MIT licensed, yey). It looks like I have some crypto to learn, after I get the Release files generated. If you're at all inclined, I'd happily accept a pull request or GIST of a code snippet that can clearsign a text string. The release file will be stored in the DB, so I need to take a chunk of text, clearsign it, and then persist it into the DB again. My initial thoughts are that I need to generate the Package files and Release file after every build which produces a DEB file. I'm still working through that in my head. Unless generating the Release file, and signing it is so lightweight I can do it on demand. As I say. Still mulling it over at the moment. |
To be able to use this sweet plugin for proprietary software, restricted access is needed. See this for example: https://debian-administration.org/article/513/Restrict_Access_To_Your_Private_Debian_Repository
Are the actual .deb files protected by normal TeamCity access? In that case I should just be able to use e.g. http://user:pass@teamcity.company.com/app/debrepo/
Please advice
The text was updated successfully, but these errors were encountered: