Get specific release from github releases for electron-updater - electron

I'm building an electron application that will be distributed to different clients. Currently, I'm testing how to update the application.
To describe my problem:
In order for this application to work client must buy a licens. And based on this licens I know who the client is and what features does he need. On star I must call my API endpoint that checks clients licens and returns where electron-updater should go and check for updates (not all clients get the same version; it's even possible that one client has a completely different version of the application from others).
Currently, I'm testing with local http-server and my URL look something like this: http://localhost:8080/v0.0.3 (inside this map I have the installer, latest.yml and blockmap files) and in main.js I use it like this:
autoUpdater.setFeedURL({
provider: 'generic',
url: ret.url // <- http://localhost:8080/v0.0.3
});
autoUpdater.checkForUpdates();
So far this approach works fine, but I'm testing now if it would be possible to use GitHub repository and through my API return URL to specific version, because all I could achieve from using GitHub was getting the latest version (it would be great if repository could be private).
So if it is could it be done something like this: https://github.com/<user>/<repo>/releases/tag/v0.0.3

Related

Auto-update Electron app to a specific (non-latest) version

I need to support a special release per user (or group), and I want each user will auto-update to a new available release only if it's suitable for him (by some kind of logic in the backend).
I've tried to do so by using electron-builder's electron-updater module, and also by using Electron's autoUpdater built in module, but it seems that both always fetch the latest version when calling autoUpdater.checkForUpdates.
I've seen that when deploying my own update server, some of them (such as nuts) support a download url for a specific version.
as described using nuts
Specific version for detected platform: http://download.myapp.com/download/1.1.0
but there seem to be no support to request a specific version in the app itself using autoUpdater.
summarizing all this up: How can I achieve auto-update to a specific release other than latest?
The solution for me was channels.
appUpdater.channel (getter and setter)
Define the channel which the Auto-Updater will follow (see the
auto-update with channels tutorial) using appUpdater.channel = 'beta'
or get the current channel with currentChannel = appUpdater.channel.
Note that channels are not supported when using GitHub as a provider (for now), as described in electron-builder autoUpdate documentation:
channel String - Get the update channel. Not applicable for GitHub. Doesn’t return channel from the update configuration, only if was previously set.
You can set the channel name to anything, and can even dynamically (if needed) direct your users to pull updates from that channel.
You can also edit the {your-channel-name}.latest file manually and add parameters that will help you determine whether the current "asking for update" user should consume the certain version (in the update-available event from the updateInfo parameter for example).

iOS can you view SVN repository on iPhone/iPad via PuTTY Pagent?

I currently develop on a Windows PC and store the code in an SVN repository that is accessed via a combination of SVN, PuTTY, and Pageant. I would like to be able to view code in the repository on an iPad but I am unsure if this is possible because of the PuTTY and Pageant element?
I'm just researching this at the moment and can see there is an SVN client for iOS but I'm not sure how to get the PuTTY/Pageant working with this?
No code to show
I hope it is possible to view the files as I going to remote locations and don't have the ability to carry a laptop and would like to be able to use my phone
Why do you think that you need SVN client to view data in your repository? You could use a web interface instead. For example, take a look at the web UI built in VisualSVN Server. It works great with mobile web browsers, activates automatically and works out of the box (no configuration required) when you use VisualSVN Server.
Note that Apache+DAV_svn supports (very) basic repository browsing capabilities and there is more functional ViewVC. But they both need manual installation and setup.

How do I demo an electron app on the web

Is there a way to easily distribute an electron.atom.io app as a static site?
I don't need all the functionality, I just want to allow the client to view the latest updates.
-- edit --
Perhaps a better way to ask the question is; "How do I build a web app that can be hosted online and run on electron with minimum rewriting" - similar to the Slack app that works the same way on web or electron app.
As long as your main use of Electron is to create a 'native browser wrapper' for a web-app this is entirely possible.
You will have to implement a check if your application is running inside a browser or inside Electron and wrap your electron specific code in it:
if (window && window.process && process.versions['electron']) {
const {BrowserWindow} = require('electron').remote
}
You'll probably have to step through your application and disable Electron specific functionality at multiple places.
You have other options to do a long distance demo of an Electron app
Electron is basically a shell to run node.js apps on the desktop. This means if you want to move it to the web, you have to give up all the Electron APIs that access the local system and you're left with a basic node.js app, which is most likely not desirable.
To demo your desktop app to an off-site client, you can either make a presentation with screenshots detailing the current user flow, or compile a sandboxed demo version of your app and send it over to them.
Screen presentation
This is your quickest and easiest solution if your client just wants to be kept in the loop and see some eye candy. You can just record how the app works with some example data, add some written or audio explanation to it, and let them enjoy the smooth ride.
Build a demo
If your client wants to actually have a hands-on demo with the app, you need to have some form of basic code distribution. The cleanest way to do this would be to tie up all loose ends in your current app flows, block all unfinished roads in it and compile it for whatever platform your client requested the demo for.
Take a look at the electron-packager and electron-builder docs to get an idea how to build an .exe, .dmg or whatever file from your Electron app, then send that file to them with some basic instructions.

How do I handle post requests from my dart app ran from the dart editor?

I have code that looks something like this (_http is the angular Http object)
var httpFuture = _http.post('/api/items', {
'ids': JSON.encode(new List.from(nonLoadedIds))
});
httpFuture.catchError((e) {
Logger.root.severe('Unable to load items!', e);
});
It is making a post request to load a bunch of things. Potentially more ids than the http get header can handle.
The nice development experience would be if I could fire up the dart editor, mock up some fake response data, run my app, and see the data in the end. I would also accept being able to start up a separate web app and somehow proxy my post requests to that web app.
What I don't want to do is change my '/api/items' into something like 'http://localhost:8084/api/items' mostly because I don't want to have to remember to replace these before deploying (I know I'll forget) and while doable, I don't want to on my server implement CORS just to have to remember to disable it when I deploy to production.
But really, I would accept just about any workflow if it is recommended. I just would like to eliminate any manual code transformations pre production deploy.
The suggested attempt is to use a simple proxy server which forwards to pub serve.
See for example https://code.google.com/p/dart/issues/detail?id=18039
This issue contains the source code for a simple custom proxy server example https://code.google.com/p/dart/issues/detail?id=15731
see also
Dart: How to use different settings in debug and production mode?
How to achieve precompiler directive like functionality
Is there a compiler preprocessor in Dart?

How to serve a defined path with Meteor?

Currently I'm connecting to my meteor project using http://localhost:3000 which uses my meteorApp.html file.
How could I make Meteor respond to the following url:
http://localhost:3000/otherPath ?
To be more explicit, I do have a file on the server side I just would like to be able to retrieve on the client side using http://localhost:3000/nameOfTheFile.sufix
I think you can just put nameOfTheFile.sufix under public directory.
See http://docs.meteor.com/#structuringyourapp
If you want otherPath to be within meteor app, public won't do.
There are several ways to do that, http://multi-page-config.meteor.com is one way to create what looks like a traditional multipage site within one meteor process.
I did this a while ago and have since perfected it a bit but haven't updated it.. this at least might give you some ideas... you can look at the source here: https://github.com/bolora/multi-page-config

Resources