• This repository has been archived on 26/Oct/2019
  • Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple node.js server for Squirrel.Mac and Squirrel.Windows which uses GitHub releases.

Squirrel Updates Server

aluxian/squirrel-updates-server

A simple node.js server for Squirrel.Mac and Squirrel.Windows which uses GitHub releases. It also has an endpoint for Linux.

The server doesn't do any caching, and its responses don't include caching headers. Use a service like CloudFlare to cache requests and minimise load. CHANGED: From v0.6, I added server-side caching.

Make sure you tag your releases as vX.X.X and not just X.X.X.

Endpoints

/update

Squirrel.Mac

GET /update/darwin?version=x.x.x

Sample response:

{
  "url": "https://github.com/atom/atom/releases/download/v1.4.3/atom-mac.zip",
  "name": "1.4.3",
  "notes": "### Notable Changes\r\n\r\n* Fixed a bug that caused...",
  "pub_date": "2016-02-02T21:51:58Z"
}

Squirrel.Windows

GET /update/win32/<file>

It will redirect to the download url for that file. Usage:

  • Electron's AutoUpdater: use /update/win32

    The AutoUpdater will request /update/win32/RELEASES when checking for updates, and the server will return the latest RELEASES file. It will also request files (e.g. /update/win32/atom-1.4.3-delta.nupkg), in which case the server will redirect to the correct download url on GitHub.

  • Squirrel.Windows Releasify: use /update/win32

    When it will request packages (e.g. /update/win32/atom-1.4.3-delta.nupkg), the server will detect the version and redirect to the download url (e.g. https://github.com/atom/atom/releases/download/v1.4.3/atom-1.4.3-delta.nupkg)

Windows Portable

GET /update/win32/portable

It will return information about the latest Windows version.

Sample response:

{
  "url": "https://github.com/atom/atom/releases/download/v1.4.3/atom-windows.zip",
  "name": "1.4.3",
  "notes": "### Notable Changes\r\n\r\n* Fixed a bug that caused...",
  "pub_date": "2016-02-02T21:51:58Z",
  "version": "1.4.3"
}

Linux

GET /update/linux?pkg=<deb|rpm>&arch=<i386|amd64|x86_64>

It will return information about the latest Linux version.

Sample response:

{
  "url": "https://github.com/atom/atom/releases/download/v1.4.3/atom-amd64.deb",
  "name": "1.4.3",
  "notes": "### Notable Changes\r\n\r\n* Fixed a bug that caused...",
  "pub_date": "2016-02-02T21:51:58Z",
  "version": "1.4.3"
}

/download

OS X

GET /download/darwin/latest

Get the download url of the latest OS X release (dmg) and redirect to that url.

GET /download/darwin/latest?zip=1

If the zip query parameter is truthy, the server will redirect to the zip instead of the dmg.

Windows

GET /download/win32/latest

Get the download url of the latest Windows release (installer) and redirect to that url.

GET /download/win32/latest?zip=1

If the zip query parameter is truthy, the server will redirect to the portable zip instead of the installer.

Linux

GET /download/linux/latest?pkg=<deb|rpm>&arch=<i386|amd64|x86_64>

Get the download url of the latest Linux release, for the chosen arch and package type, and redirect to that url.

/stats

See download counts for all the releases. Stats returned:

  • total: The total number of downloads (download count of every asset from every release).
  • platforms_r: The number of downloads for each platform. Only assets matched by one of the patterns in config.patterns are counted (the rest are undetected).
  • versions: The number of times each version has been downloaded. This includes every asset from every release.
  • versions_r: The number of times each version has been downloaded. Only assets matched by one of the patterns in config.patterns are counted.
  • versions_rd: The differences of downloads for each release, calculated from versions_r. Example: delta[2.0.8] = count[2.0.8] - count[2.0.7].
  • versions_rdp: The same as versions_rd, but the differences are calculated as percentages.
  • files: The number of downloads for each file, from every asset, from every release.

Note: draft releases are always ignored.

Sample response:

{
  "total": 2901,
  "platforms_r": {
    "darwin": {
      "dmg": 46,
      "zip": 154,
      "all": 200
    }
  },
  "versions": {
    "v2.0.8": 173,
    "v2.0.7": 490
  },
  "files": {
    "RELEASES": 1841,
    "whatsie-2.0.8-delta.nupkg": 26,
    "whatsie-2.0.8-full.nupkg": 0,
    "whatsie-2.0.8-linux-amd64.deb": 6
  }
}

Deployment

  1. Clone the project
git clone https://github.com/Aluxian/squirrel-updates-server.git
cd squirrel-updates-server
  1. Install dependencies
npm install
  1. Create and edit the config file
vim src/config.js
  1. Build and start
npm run build # this is now done automatically by npm start
npm start

More Repositories

1

Messenger-for-Desktop

This is not an official Facebook product, and is not affiliated with, or sponsored or endorsed by, Facebook.
JavaScript
2,170
star
2

electron-superkit

âš¡ An Electron starter kit with super powers. âš¡
CoffeeScript
214
star
3

nwjs-starter

âš¡ NW.js starter project powered by Gulp. âš¡
JavaScript
123
star
4

fish-kube-prompt

⎈ kubectl context/namespace in your fish shell prompt
Shell
77
star
5

CPP-ML-LinearRegression

A linear regression implementation in C++
C++
47
star
6

gulp-github-release

Create GitHub releases and upload assets.
JavaScript
16
star
7

Tweeather

ML project that correlates Twitter sentiment to European weather.
Scala
8
star
8

aluxian.com

My home on the interwebs!
HTML
8
star
9

klout-desktop

Unofficial desktop client for Klout. Runs on OS X, Windows and Linux.
JavaScript
8
star
10

gulp-appdmg

Generate beautiful DMG-images for your OS X applications.
JavaScript
7
star
11

FII-Lorem-UI

Sample Android app with Material Design.
Java
7
star
12

Codementor

An Android app I built for chatting on Codementor.
Java
5
star
13

heroku-buildpack-logstash

Shell
5
star
14

Butler

Butler is a personal, voice-powered assistant for Android.
Java
4
star
15

UniNet

A social network for universities. Coded together with @datBumbleB at FII Practic Hackathon 2015.
CSS
4
star
16

Coursera-Coding-the-Matrix

Homework for the "Coding the Matrix" course on Coursera (not completed).
Python
3
star
17

Assignment-Problem-Weighted-Bipartite-Matching

Assignment Problem (Weighted Bipartite Matching)
Java
3
star
18

SusuCatBot

The perfect companion for students.
Scala
2
star
19

Coursera-Machine-Learning

My homework for the "Machine Learning" course on Coursera that I completed in December 2014.
MATLAB
2
star
20

dotfiles-fish

My fish shell config
Shell
1
star
21

WHIX

Campus Hack 19 - Social media app
Swift
1
star
22

CHS-Cattics

Community for Cat Lovers. http://alux-cattics.herokuapp.com/
JavaScript
1
star
23

CNRV-RO-Website

JavaScript
1
star
24

zsh-gpt

Shell
1
star
25

docker-sentry-github

Official Sentry image with GitHub plugin
1
star
26

node-fbmessages

Builders for messages on Facebook Messenger Bot Platform
JavaScript
1
star
27

node-acrypto

Promise based version of Node.js crypto module which only includes randomBytes and pbkdf2.
JavaScript
1
star
28

CodeCon-Problems

Solutions and attempts to problems from Bloomberg's CodeCon
Scala
1
star
29

FPPiS

Functional Programming Principles in Scala
Scala
1
star
30

HackerRank-Problems

Solutions and attempts at problems from HackerRank
Scala
1
star
31

FlightManager-WinForms

A flight management dashboard written in C#
C#
1
star
32

alablad

Cryptocoin
C++
1
star
33

node-envv

Simple util for config files that checks and returns an env var.
JavaScript
1
star
34

hapi-auth-ownership

Ownership-based access control for your routes.
JavaScript
1
star
35

UoS-CS2-LaBASIC

LaBASIC is a BASIC interpreter for the LaFortuna board
C
1
star