-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make updater smarter about remote and local list of update sites #66
Comments
I want to fix this since we need it for the HTTPS support. Here's how it could look like:
However this would mean that if someone modifies the URLs manually the updater would always reset them again. I would therefore add an attribute to an update site storing the manual choice and not update the URL to the remote URL in this case. This would only work for future manual changes, anyone who edited these URLs in the past would get the default URLs from the list of update sites back. |
I think a scheme like this makes sense. There are some other related edge cases to consider:
|
I'm not sure this is good. The manually added "Foo" site may not be the "Foo" site that is later added to the central/remote list. Say I have a "micron" update site for internal use which our users and facility systems use. Someone else sets a "micron" site on the central/remote list. This buggers up all our systems and our users on the next upgrade. The name of the site should be for convenience and readability, but what really matters is the actual URL. That this changes automatically under my feet sounds worrying. It's ok for the server in the URL to then redirect because by selecting that URL, the user claims to trust the server. This is different from having something else (the ImageJ list of update sites), changing the URL itself. So I don't think this is a requirement to support https. I also don't think that updating the list of sites in a central list of sites is the solution when one update sites moves location. The responsibility of this falls on the update site maintainer which means setting up a redirect. This redirect may even be Moved Permanently, in which case I guess it may make sense to update the URL. |
I agree. To clarify my point, here are two scenarios and how I would propose handling them: Scenario 1
Scenario 2
How to achieve itWhen a site is added locally (as opposed to being edited from an entry originally added via the list of update sites), it gets a special status "local only". Whether it retains that status after a new list of update sites is retrieved and compared will depend on the situation, as described above. I do not think it is trivial to consider and code all these various different edge cases, but I think it is helpful if we can make things work as seamlessly as possible over time as the list evolves. @frauzufall Perhaps it makes sense to assign each site on the list a unique ID, and store those locally, so that it becomes unambiguous whether a particular local site is really the same site linked to the list of sites. |
* UpdateSite: String modifiedUrl storing URL in case it's manually adjusted * modifiedUrl is also logged in the update site entry in db.xml.gz ("url-modified") * UpToDate plugin checks if list of available update sites contains updated URLs * in case URL was changed manually, it will not be updated to remote version * otherwise the local URL entry of the update site will be updated
@carandraug I understand your concerns. I was not happy about matching the update sites by name, I just wanted to make sure any installation supporting HTTPS will also use HTTPS without users having to manually update their URLs. I will look into your PR #67 next. |
As I commented here, we do need to update these URLs in order to serve HTTPS updates to existing installations because the ImageJ server has no redirect from HTTP to HTTPS for requests from the updater (@ctrueden correct my if I'm wrong). I would love to get this going, any suggestions welcome. We could also whitelist links from @carandraug's server in the code so that they will not be affected. |
* in case an activated update site is from the available update site list and gets an URL update, this dialog can ask for confirmation of the URL update * user can accept URL update or keep current state * if user keeps current state, choice can optionally be remembered * choices can be made for all affected update sites at once or individually * current main use case is changing URLs from HTTP to HTTPS * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
* during update all URLs from the available update site list are checked for updates * if the update site is disabled, the URL is updated automatically * if the update site is enabled, the user is asked for confirmation of URL change * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
… sites * in case an activated update site is from the available update site list and gets an URL update, this dialog can ask for confirmation of the URL update * user can accept URL update or keep current state * if user keeps current state, choice can optionally be remembered * choices can be made for all affected update sites at once or individually * current main use case is changing URLs from HTTP to HTTPS * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
* during update all URLs from the available update site list are checked for updates * if the update site is disabled, the URL is updated automatically * if the update site is enabled, the user is asked for confirmation of URL change * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
… sites * in case an activated update site is from the available update site list and gets an URL update, this dialog can ask for confirmation of the URL update * user can accept URL update or keep current state * if user keeps current state, choice can optionally be remembered * choices can be made for all affected update sites at once or individually * current main use case is changing URLs from HTTP to HTTPS * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
* during update all URLs from the available update site list are checked for updates * if the update site is disabled, the URL is updated automatically * if the update site is enabled, the user is asked for confirmation of URL change * depends on imagej/imagej-updater#71 * touches imagej/imagej-updater#66
We whitelisted |
Yes, intentionally so. For most user agents, we do now blanket redirect from HTTP to HTTPS. But if the user agent is the ImageJ Updater, we do not. This is so that old Fijis requiring HTTP will still function, rather than spewing One thing we could do is change the user agent string of the new Updater to be distinct from that of the old Updater—either all the time, or maybe even only when the Java version is new enough. Then we could have Apache behave differently for the two, doing an HTTPS redirect only if it would work. But I don't know if this would be helpful, or just overly complex. |
As mentioned on the discussion to issue #65 the updater does not update the sites URLs when they change on the wiki list.
The text was updated successfully, but these errors were encountered: