Commit Graph
4099 Commits
Author SHA1 Message Date
Zorg 47d8ed8f05 Removing this codesign script because we're not including XPC services in the framework 2016-04-17 23:27:26 -04:00
Zorg 4ea4ece4fd Add XPC service dependencies to Test App 2016-04-17 23:13:27 -04:00
Zorg 3b892524a6 Rewrite ATS check by distinguishing if Sparkle is in XPC service or not
If it's not in a XPC service, then the main bundle decides the rules.
2016-04-17 23:01:20 -04:00
Zorg 2a89393853 Take XPC services out of the framework & make them optional
I'm hoping this will ease some of the build configuration issues I've been running into.
Apps (eg: unsigned, not-sandboxed) don't need to (although they still can) use the XPC services.
Sandboxed apps naturally should use the XPC services. Although, you can for example, choose not to use the
downloader services if the host app already entitlements to allow network connections.

If you use the downloader services, you must configure ATS exceptions in them. And if you use those services,
you probably want to sign them with the required entitlements.

If you don't use the services, Sparkle will fall back on almost-identical code executed within the framework instead.

There may be other reasons to use the services or not other than for sandboxing, like fault tolerance.
Lastly, XPC services work within an application namespace. They are discoverable as long as they're in the app.
That's why we can have an app incorporate the services and let the framework use them.
2016-04-17 21:24:11 -04:00
Zorg 31dc457676 Do some Xcode XPC service cleaning
Rename the XPC service products so that they start with 'Sparkle'
Make the bundle IDs of the services a part of the build configuration, so we can pass it to the preprocessor.
2016-04-17 18:44:06 -04:00
Zorg 22e32a2304 Add codesign script and disable more signing for release modes
We have a custom codesign-after-copy script because Xcode's code sign on copy feature is bad when it
comes to frameworks including signable tools. In release build configurations, nothing we build uses
an ad-hoc code signature. This is logical because ad-hoc signatures are only meant to be used for testing purposes.
2016-04-17 03:20:57 -04:00
Zorg b9f2a24660 Only use ad-hoc signing for Debug type builds and testing
We shouldn't sign Sparkle for Release builds after all..
2016-04-17 00:26:09 -04:00
Zorg a1fa7b1fa3 Make a script file for our ats-exception run script 2016-04-17 00:00:17 -04:00
Zorg 78f2453f2b Don't ad-hoc sign Sparkle
Only the XPC services need to be ad-hoc signed (else Xcode gets cranky),
or targets with entitlements like our Test Application.

Distributing ad-hoc binaries can be mixed with distributing unsigned apps,
and ad-hoc is no worse than unsigned when it comes to distributing, so we're all good.
2016-04-16 23:04:36 -04:00
Zorg d96fd93edf Start the updater in TestAppHelper 2016-04-16 21:48:02 -04:00
Zorg 786d3d4bb6 Remove support for updating without DSA signing
Updating without DSA signing the download is simply not secure.
Before, we were keen on allowing no DSA signing as long as https is used.
However, under the separate process security model, the installer can't know or trust
if the download came over from https. We could move downloading into the installer, but
the installer may run with full privileges one day in the future, and this would
complicate the installer & updater interaction. Furthermore, this could disallow us from being able
to silently download the update in the future if the installer runs at full privileges.

An upside is that the validation and configuration checking code is simpler to read through now.

Even if we could validate that an update came over https, it is still not as secure as people may like to believe.
For example, a hijacked server can choose to manipulate the download (within restrictions), even if it's signed by a developer ID, but not with our DSA support.

Changing of DSA keys and Apple code signing identities is still allowed as long as one of these pairs match and are valid.
Hence requiring DSA signing is also safer when it comes to losing one of your keys. It's only a bit less convenient.
2016-04-16 18:04:47 -04:00
Zorg 88f4557bdd Sign with DSA "and/or" code sign 2016-04-16 17:53:16 -04:00
Zorg 39bc068b89 Move Sparkle debug warning into +load
Also use NSLog here instead of SULog because we don't want to start the logger early on
2016-04-16 17:53:16 -04:00
Zorg e767f6a4c6 Add release build configuration that allows arbitrary HTTP loads
In debug mode we always build with arbitrary http loads, but in release mode we
only want to build sparkle-cli and SparkleTestApp with arbitrary http loads.

An ATS error was added back if arbitrary HTTP loads are not allowed and if the feed URL is http://

The "distribution" target/scheme is now not very up to date because it builds everything under Release configuration.
2016-04-16 17:52:03 -04:00
Zorg 13993aea67 Defaulting NSAllowsArbitraryLoads to NO in XPC info.plist's 2016-04-16 10:21:42 -04:00
Zorg 5eef1d1243 Remove empty configuration files
If specific config files are needed for debug, release, and coverage, they can always be added later.
Right now, they just take up useless space.
2016-04-16 10:15:28 -04:00
Zorg 98f07419aa Remove ATS exception from TestApplication
The XPC services (under debug mode) now handle this.
2016-04-16 01:56:50 -04:00
Zorg 7a0ee291f9 ATS cannot be reliably checked against anymore
An app can contain a XPC service with restricted entitlements and own ATS exceptions.
Indeed, Sparkle now is a framework that embeds two XPC services that include download entitlements.
If ATS is disabled, it'd have to be disabled in those services, not within the root of the application.

So we can't keep this detection because it will generate false positives. And it's not really our responsibility anyway.
2016-04-16 01:52:29 -04:00
Zorg 63e100ae0d Instead of checking for main bundle, check for app bundle
We really want to differentiate between apps and prefpanes/plug-ins.
Using the main bundle is not at all a reliable indicator because an updater could target
any kind of bundle anywhere.
2016-04-16 01:48:54 -04:00
Zorg 291bef326b Require the updater to be started, separate from initializing
This new method also takes an error object as output, which means we can now
read a bundle in Sparkle without having to abort. If a check for updates action is invoked
before the updater has been started, it becomes a pending scheduled operation.
2016-04-15 23:36:12 -04:00
Zorg bab33b66cb Making minor improvements to property/synthesize names 2016-04-12 23:56:24 -04:00
Kornel 0132377a2a Merge pull request #795 from zorgiepoo/check-parent-writability
Check the bundle's parent directory for writability too
2016-04-13 00:02:55 +01:00
Kornel 7fdedad68e Merge pull request #794 from zorgiepoo/fix-symlinks
Don't follow symbolic links for file operations
2016-04-12 15:58:29 +01:00
Zorg ad0868ab4f Only use performedStage1Installation property on main thread
Should resolve any thread-safe worries
2016-04-11 21:54:29 -04:00
Zorg 18e666ac3a Don't make a permission prompt decision
We shouldn't change the user defaults on behalf of another application. This may require more thinking..
2016-04-11 09:03:25 -04:00
Zorg acaa021583 Merge branch 'master' into ui-separation-and-xpc 2016-04-11 03:25:00 -04:00
Zorg aa7c46ba4f Check the bundle's parent directory for writability too
This is to decide if we should allow automatic downloading & installing of updates or not.
2016-04-11 03:15:36 -04:00
Zorg d263bf4fd0 Don't follow symbolic links for file operations
This fixes issues with updating modification/access time, and changing owner/group
where symbolic links used to be followed. Symbolic link tests are included.
2016-04-11 03:05:53 -04:00
Zorg c105154ba8 Only recursively update access time, not modification time of updates 2016-04-11 02:01:58 -04:00
Zorg d4466d1448 Add Installer Progress depedency to Sparkle.framework 2016-04-11 01:31:32 -04:00
Zorg ee8fed0c2a Remove Sparkle target depedency from BinaryDelta
This shouldn't be needed.
2016-04-11 01:30:10 -04:00
Zorg e1b13f9c67 Add sparkle-cli tool that can update any arbitrary app
I added an application target but it's really intended to be used as a command line tool. The reason being was that it was the easiest way to bundle the Sparkle framework, I've found.

Note this doesn't work perfectly yet, but it's a good start. Trying to update anything that's not Sparkle based will crash for instance. And it will use the installer progress tool which may be undesirable.
2016-04-11 01:29:08 -04:00
Zorg d5f1dcc7c3 Use futimes() when updating mod times recursively 2016-04-11 00:18:32 -04:00
Zorg 88f5d9a6d9 Fix SUAppcastItem's delta updates failing to securely unarchive 2016-04-11 00:09:51 -04:00
Zorg 163a64f3fe Fix unit tests using SUCodeSigningVerifier due to previous commit 2016-04-10 19:43:30 -04:00
Zorg 15c9ae65e7 We support bundles, not applications, in the general sense 2016-04-10 19:41:58 -04:00
Zorg 1151d66337 Remove customized application icon for installer progress
This created more complexity than it was worth and leads to subpar user experience because the user can see the icon switch back to the generic one when the updater terminates. So we now bundle the icon in the install progress tool. If a developer wants to use a custom icon, they can provide their own customized tool.
2016-04-10 19:25:31 -04:00
Zorg 8eb0bc1921 Messed up on argument order here 2016-04-10 17:13:00 -04:00
Zorg 2b84e83ba4 Add customization point to installer progress tool & desired icon 2016-04-10 15:57:47 -04:00
Zorg 5fdc438fa6 Refactor InstallerProgress tool into separate classes 2016-04-10 14:46:05 -04:00
Zorg 7015303726 Pass around download name rather than download path
We know that the download sits in the update directory
2016-04-10 13:51:32 -04:00
Zorg 296154d467 Check the parent directory for writability too 2016-04-10 09:07:00 -04:00
Zorg cd108ef47c Allow automatically downloading updates, but alerting the user immediately
Following cases where after an update has been automatically downloaded, Sparkle may alert the user right away:
1) Critical updates
2) Insufficient write access to install without being root
3) Package type installations

In addition to alerting the user right away, if they dismiss the update, the schedule timer will be on regular intervals. We also no longer need to care about writability in the updater, only just in the installer.
2016-04-10 02:32:54 -04:00
Zorg 5a0ee5d56a Don't follow symbolic links for file operations
This fixes issues with updating modification/access time, and changing owner/group
where symbolic links used to be followed. Tests are included.
2016-04-09 22:33:17 -04:00
Zorg 20e8ea8603 Fix tests that use SUStandardVersionComparator 2016-04-09 21:22:22 -04:00
Zorg e1a9e98d8b Fix implicit type conversion warnings 2016-04-09 18:48:19 -04:00
Zorg 39f82edcf6 Remove standard version comparator singleton
There's no reason for this to be a singleton instance, and the singleton pattern is not even implemented right
2016-04-09 18:13:00 -04:00
Zorg 8d5f1edf39 Remove duplicated header 2016-04-09 18:06:41 -04:00
Zorg beacf49158 Improve authorization handling
Duplicated code from SUFileManager and SUGuidedPackageInstaller has been removed.

SUPlainInstaller now tests if it needs authorization rather than by trying to touch the old app.

SUGuidedPackageInstaller now tries to grab authorization during stage 2 of the installation.
2016-04-09 18:00:47 -04:00
Zorg b3b12dc4be Remove unused variable warning 2016-04-09 16:31:28 -04:00