Skip to content
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

New Updater V1 (using HTTPS update sites if certificate supported) #71

Open
wants to merge 12 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@frauzufall
Copy link
Member

commented Dec 18, 2018

See #70. This is the PR for V1.

What's changed:

  • check HTTPS certificate

  • handle SocketTimeoutException -> warning and fallback to HTTP

  • handle SSLHandshakeException -> warning and fallback to HTTP

  • UnknownHostException -> warning that internet is down

  • local URLs of available update sites will be updated if the remote list changed (#66)

This is a two step process:
First, it checks for HTTPS support, checks out if there are user sites which can be converted from HTTP to HTTPS and matches the local update sites with the list of available update sites.

AvailableSites.checkHTTPSSupport(log);
AvailableSites.fixInsecureUserSites(files);
AvailableSites.matchSites(files, availableUpdateSites);

Then the user interface can notify the user of changes and ask for approval. Afterwards, changes to the URLs will be saved with this line:

AvailableSites.applySitesURLUpdates(files);

Consequences for users:

  • if our certificate is supported, their update site links should be updated to HTTPS
  • any URLs that were manually changed in the past will be reset to the remote URLs
  • future manual changes will be saved and not overridden
  • there is a test for mirrors (it currently only matches if the URL starts with https://downloads.micron.ox.ac.uk and does not recommend updating the the official links in this case) @carandraug

Open questions:

  • the scripts also contain HTTP links, not sure how relevant they are
Update URLs of available update sites #66
* 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
@frauzufall

This comment has been minimized.

Copy link
Member Author

commented Dec 18, 2018

After reading the discussion in #66 I should reconsider how to update the URLs.

@frauzufall frauzufall referenced this pull request Dec 21, 2018

Open

New version of the ImageJ Updater #70

2 of 6 tasks complete

frauzufall added some commits Dec 18, 2018

Use HTTPS "available update sites" list if certificate is supported #70
* adds check for HTTPS certificate:
	* tries to connect to "https://imagej.net/api.php"
	* if SSLHandshakeException, assume missing certificate support
* throws warning via LogService in case HTTPS cannot be used
* also throws warning via LogService if internet connection is down
* otherwise use HTTPS to retrieve list of available update sites (which
will include HTTPS links for default servers)
* AvailableSites.getProtocol() returns prefix for URLs depending on mode
* scripts are not using this yet, they still contain HTTP URLs
Handling HTTPS connection timeout #70
* sets timeout for HTTPS request connection to 10 seconds
* in case of SocketTimeoutException throw warning and fall back to HTTP

@frauzufall frauzufall force-pushed the updater-v1 branch from 1d60735 to 8dfce6b Jan 3, 2019

frauzufall added some commits Feb 8, 2019

Add deletion check to test
* adds test if deleted files really don't exist anymore afterwards
* adds boolean isDeleted(String path) function to Deleter interface
* other Uploaders must implement this method, otherwise
NotImplementedException is thrown when running this test

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

Dialog to handle remote URL changes of activated update 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

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

Adds Update Site URL status check to Updater procedure
* 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

frauzufall added some commits Feb 26, 2019

Match existing update sites with available sites by name not URL
* this will be changed into matching by ID in the future, right now
there is no ID and the URLs are changing
FilesCollection: separate downloadIndexAndChecksum function into Read…
…ing and Loading

* downloadIndexAndChecksum reads local db.xml.gz and checks enabled
update sites for updates
* this PR separates this function into two steps:
  (1) read db.xml.gz
  (2) retrieve updates from enabled update sites
* this makes it possible to update the URLs of update sites in between
Handling available update site URL updates
* UpdateSite: adds URLStatus and URLAction
* UpToDate: adds check if update site URLs should be updated
* AvailableUpdateSites: adds assigning and handling of update site
URLStatus and URLAction depending on list of available update sites
* improved naming, added documentation

@frauzufall frauzufall force-pushed the updater-v1 branch from c01734b to a793bc8 Feb 26, 2019

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

ReviewSiteURLsDialog to handle remote URL changes of activated update…
… 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

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

Adds Update Site URL status check to Updater procedure
* 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

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

ReviewSiteURLsDialog to handle remote URL changes of activated update…
… 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

frauzufall added a commit to imagej/imagej-ui-swing that referenced this pull request Feb 26, 2019

Adds Update Site URL status check to Updater procedure
* 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

frauzufall added some commits Feb 28, 2019

HTTPS upgrade check for manually added update sites
* checks if any manually added update sites start with
"http://sites.imagej.net"
* in case they do and the updater can handle the HTTPS protocol,
the updater will suggest to update these URLs to HTTPS
Checks if update site URL is a known mirror
* prevents automatic updates of update site URLs from known mirrors
* currently only https://downloads.micron.ox.ac.uk is hardcoded as a
known mirror, in the future there should be an online resource listing
mirrors

@frauzufall frauzufall changed the title [WIP] New Updater V1 (using HTTPS update sites if certificate supported) New Updater V1 (using HTTPS update sites if certificate supported) Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.