Commit Graph

41 Commits

Author SHA1 Message Date
Myron Boyle d032669037 handle close on ESC 2019-02-25 14:37:46 +01:00
Michael Bayne 68341fedc2 Pre-fill known proxy info into ProxyPanel.
We no longer use the system properties, so we can't rely on the info having
been stuffed in there by some previous machinations.
2019-01-15 12:37:36 -08:00
Michael Bayne ae129fad6f Added support for proxy auth.
This also makes the use of a Proxy instance explicit in the Getdown code,
rather than trying to thread things through the proxy-related system
properties.

It introduces a ProxyAuth SPI which allows an app installation to save proxy
credentials in whatever way it deems fit. Otherwise the credentials are unsaved
and the user effectively has to enter them every time Getdown attempts to
access the internet.

This is obviously a terrible design, but there's no good (cross-platform) way
to securely store a username and password. So anyone using this feature is
likely going to need to provide an implementation of ProxyAuth that does
whatever auth storage they deem appropriate.

Adapted from PR from @ThomasG-AI, thanks!
2019-01-15 12:27:05 -08:00
Michael Bayne dc768515d5 Add changelog entry, wrap long line. 2019-01-04 10:53:33 -08:00
vsolanki 7d65b2f6a3 Https proxy 2018-12-20 09:58:46 -05:00
Michael Bayne 5d1bdbfb3f Install in the loop we already have.
Also don't create a valid marker file. Patch files are deleted immediately
after use.
2018-12-17 11:25:35 -08:00
Michael Bayne faa9d2422e No need for a separate method. 2018-12-17 11:22:53 -08:00
Leandro Quiroga 8a00ff60d8 true arg passed to install() 2018-12-14 16:35:43 -03:00
Leandro Quiroga 28b779f0f8 Fix issue #176
install(Resources) method created and called from update() method, below calling download().
2018-12-14 16:22:39 -03:00
Michael Bayne 9402d7c900 Update copyright headers. 2018-12-06 11:55:49 -08:00
Michael Bayne 9f2071f152 Minor reorg & fix all "config UI when getdown.txt" changes issues. 2018-12-01 20:00:03 -08:00
Michael Bayne f4679b4a36 Merge pull request #172 from vatsal22/Predownloads
Use presource=[resource] to "predownload" resource
2018-11-30 14:49:56 -08:00
vsolanki cca7749dc8 Use presource=[resource] to "predownload" resource
-these will be downloaded before a UI is displayed, allowing them to be
loaded on first launch
2018-11-30 15:40:51 -05:00
Michael Bayne 78fdc9031e Small formatting tweaks. 2018-11-30 11:36:10 -08:00
Guenther Demetz a072718d4e Checking Java version only after getdown.txt has been re-fetched.
Typical use case is a security patch, were a new java patch 
(java_windows.jar) is put on server side and java_min_version updated
accordingly in getdown.txt

Currently the new virtual machine will be downloaded only after 
a second getdown launch. This pull request fixes this.
2018-11-29 09:34:44 +01:00
Michael Bayne ac876a36ef [maven-release-plugin] prepare for next development iteration 2018-11-27 13:35:37 -08:00
Michael Bayne 7f8add0322 [maven-release-plugin] prepare release getdown-1.8.2 2018-11-27 13:35:31 -08:00
Michael Bayne 555d28a80a [maven-release-plugin] prepare for next development iteration 2018-11-26 14:33:07 -08:00
Michael Bayne 2523ba285b [maven-release-plugin] prepare release getdown-1.8.1 2018-11-26 14:32:57 -08:00
Michael Bayne d7ec1baa60 Avoid using UI if we're in a headless JVM.
Closes #131.
2018-11-26 13:28:51 -08:00
Michael Bayne e0d119d87b A bunch of cleanup of the concurrent downloads PR.
- Max concurrent downloads is controlled by a config in getdown.txt:
  max_concurrent_downloads. It defaults to two.

- A bunch of thread-safety problems were fixed.

- While in there, I revamped the downloader to be less crufty from years of
  ad-hoc requirements accretion.

- I disabled the Channel.transferFrom based download change because it prevents
  fine-grained feedback (and abort checking) from taking place, and it doesn't
  handle failure cases. Maybe we'll clean it up and re-enable it in the future.
2018-11-26 11:25:37 -08:00
Michael Bayne d4884d5388 [maven-release-plugin] prepare for next development iteration 2018-10-19 09:50:39 -07:00
Michael Bayne 9edca56628 [maven-release-plugin] prepare release getdown-1.8.0 2018-10-19 09:50:29 -07:00
Michael Bayne 883954c3e5 Consolidate & enhance "environment config" handling.
The new code is more careful about how it obtains config info, and issues
warnings when sources of info conflict. It does not abort in such circumstances
as Getdown's prime directive is to do the best it can to get the app updated
and launched. But the warnings will hopefully allow accidental conflicts to be
detected and avoided before being deployed to customers.

We also now allow bootstrap.properties to provide an appid; that matches what
was possible via system properties and command line arguments. We also avoid
"communicating" environment configuration through the Java system properties
mechanism. We now read from sysprops but do not write back to them.

Lastly, this includes some name tidying (like appdir -> appDir and
getAppdir -> getAppDir).
2018-09-17 13:44:14 -07:00
gropp_volker 38427cbc1e load bootstrap.properties from resource bundle 2018-09-17 17:36:14 +02:00
Michael Bayne 2f0eae9753 Excise additional samskivert code. 2018-09-14 14:48:58 -07:00
Michael Bayne 24a23637a7 Avoid samskivert StringUtil import.
I thought I excised all of these except the Swing stuff, but apparently not.
I will finish that job.
2018-09-14 14:38:22 -07:00
Michael Bayne 64ce5c2e1c Merge pull request #136 from sdgx/patch-notes-url-command-injection
Avoid possible command injection (patch notes URL)
2018-09-14 14:35:45 -07:00
Michael Bayne 694457da53 Merge pull request #137 from sdgx/remove-legacy-main
Remove legacy Getdown.main( ) method
2018-09-14 14:34:41 -07:00
Daniel Gredler fdd767086a Avoid calling overridable function from constructor
When a constructor calls an overridable function, it may allow an attacker to access the "this" reference prior to the object being fully initialized, which can in turn lead to a vulnerability.

Application -> getLocalPath
ProxyPanel -> get
AbortPanel -> get
RotatingBackgrounds -> makeEmpty

(Triggered by internal security audit and Fortify analysis.)
2018-09-13 16:20:53 -04:00
Daniel Gredler d9826ff895 Remove legacy Getdown.main( ) method
This method was apparently deprecated 12 years ago, when GetdownApp.main( ) was added. The immediate motivation is to eliminate some of the security noise around this method being a source of untrusted data, but in a more general sense it also probably makes sense to clean it up after not being used for so long.

(Triggered by internal security audit and Fortify analysis.)
2018-09-12 16:43:05 -04:00
Daniel Gredler 70174d2a98 Avoid possible command injection
Because we are running cmd.exe here, it is possible to use a malicious URL to execute arbitrary commands on the shell ( e.g. if url=http://my-patch-notes.com/" & del C:\ )

(Triggered by internal security audit and Fortify analysis.)
2018-09-12 16:26:25 -04:00
Michael Bayne 712b06f8fb Generate Build.java file with data from the build.
Currently includes build version and time, but additional build-time static
data can be easily added in the future.
2018-09-10 14:23:11 -07:00
Michael Bayne 108f87d4c7 Simplify Color & Rectangle handling, fix bug.
We can just keep Color in its ARGB format and have a single static brightness()
helper. Reactangle grew a union method which allows us to avoid AWT's Rectangle
entirely.

stringsToList() needed to return null for null array input, and I went ahead
and used Arrays.asList while I was in there because we know the provenance of
the input array, no one will mutate it.
2018-09-05 16:11:20 -07:00
Daniel Gredler 1f2c736564 Unsafe public fields in UpdateInterface class: make public fields final
This commit makes the UpdateInterface class immutable. The Config -> UpdateInterface initialization is moved to the UpdateInterface constructor. Default values for the fields are moved to the constructor as well. Instances of String[] are changed to List<String> and made immutable. Instances of java.awt.Rectangle (which is mutable) are replaced with a new immutable com.threerings.getdown.util.Rectangle class.

Although java.awt.Color is (sort of) immutable, it was also removed and replaced with a new immutable com.threerings.getdown.util.Color class, since it was the last dependency from the getdown core module to anything in the java.awt package, which means that when we migrate to Java 9+ the core module should no longer require a dependency on the java.desktop module.

The assertions and expected values in ColorTest have been verified against the corresponding java.awt.Color values.

(Triggered by internal security audit and Fortify analysis.)
2018-09-05 17:07:58 -04:00
Michael Bayne be5490dce7 Merged the tools module into core.
It wasn't actually providing any value. Neither tools nor core have any special
dependencies. The code in tools operates on the same files, formats and data
structures that core/runtime code operates on. It is simpler to have them in
the same module.
2018-09-04 16:06:37 -07:00
Michael Bayne 97ec8632ae Eliminate samskivert dependency in core.
I've long wanted to do this, but the launcher's use of all the samskivert UI
stuff made it onerous. Now that the launcher is a separate module, we can
remove the samskivert dependency in core (and tools), which simplifies things
and makes it easier to depend on core in a (future) self-updating app (when we
add support for that).
2018-09-04 13:54:40 -07:00
Michael Bayne 852d15a033 Change groupId to com.threerings.getdown.
I don't want to pollute the com.threerings top-level namespace with a bunch of
getdown-foo artifacts, and grouping everything under the top-level project
name, even when that name is repeated for all the artifacts is fairly standard
practice.
2018-09-04 12:36:48 -07:00
Michael Bayne a21657d6d0 Target 1.8-SNAPSHOT.
The new multi-module Getdown will be 1.8.
2018-09-04 12:33:38 -07:00
Michael Bayne 8195460ee2 Remove obsolete Applet code. 2018-09-04 12:31:46 -07:00
Michael Bayne 4c383f99c7 Split Getdown into multiple (Maven) modules.
- core: the main Getdown logic code
- tools: code to create digest.txt & patch files
- launcher: the standalone launcher/updater app
- ant: the Ant task for creating digest.txt files

This paves the way for a proper Jigsaw-ification of the Getdown code.

I may further factor code out of getdown-launcher and into getdown-core to
enable the use-case where an app embeds Getdown completely and does not use the
launcher app/UI. That will also make it easier to create a JavaFX UI and retire
the old Swing UI.

This also moves the obsolete applet code into a separate applet module, which
is merely a temporary holding area. It will be deleted in the next commit.
2018-09-04 12:31:46 -07:00