atlassian / nucleus

A configurable and versatile update server for all your Electron apps
Other
393 stars 91 forks source link

feat(file-store): add Google Cloud Storage as filestore #65

Open leofidus opened 5 years ago

leofidus commented 5 years ago

This implements GCP as a file store.

Some care was taken to allow flexibility in the configuration to allow usage with Google's CDN or any ther CDN. I haven't implemented an invalidator for Google's CDN as I'm not currently using it.

Since I had to update @types/node to get this to compile I guess you need at least Node 8 to use the GCP backend. Using an older Node version with a different file store shouldn't be impacted.

I use the override flag of putFile to set a different cache policy, since Google applies and uses a default cache policy of one hour. Using the override flag is a bit of a hack since there's no system in place to communicate file lifetime. It works reasonably well with only a few non-critical edge cases (the initial version.json is cached too long, the icon and pubkey could be cached longer). In principle everything works even without setting the cache policy (since the lock file returns proper status over this API), the releases would just be delayed by an hour.

MarshallOfSound commented 5 years ago

CI is failing due to linting errors --> https://travis-ci.org/atlassian/nucleus/builds/447422901

leofidus commented 5 years ago

Can you add a spec similar to the S3 spec for this?

Sure, I'll see if I get around to it later.

leofidus commented 5 years ago

Build is failing because of https://github.com/googleapis/google-auth-library-nodejs/issues/520 (which is a dependency of a dependency).

Locally I've overridden version resolution for that library with a resolutions block in the package.json, but for the pull request I'll just wait for the bug to be resolved.

MarshallOfSound commented 5 years ago

@leofidus That issue is marked as wontfix and can only be resolved by updating to TS >= 3.0

I'll look at doing that for master today to get this unblocked 👍

MarshallOfSound commented 5 years ago

@leofidus Typescript 3 is now in master 👍

GEverding commented 4 years ago

What's happening with this feature? Would be great to get finished.

leofidus commented 4 years ago

@GEverding I'm running it in production for two years now without issues. I wanted to write unit tests for it, but then other priorities got in the way and I never got around to it.