Coder Social home page Coder Social logo

6fdigital / silverstripe-tauri-update-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 51 KB

A module turning silverstripe into a update server for tauri apps

License: MIT License

PHP 100.00%
silverstripe silverstripe-4 silverstripe-module tauri tauri-apps

silverstripe-tauri-update-server's Introduction

Silverstripe Tauri Update Server

[![Software License][license-image]][license-url]

A module turning silverstripe into a update server for tauri apps

Requirements

SilverStripe 4+

Installation

composer require 6fdigital/silverstripe-tauri-update-server

Concepts

Tauri apps are shipped with an updater included. This requires a server responding to the request of a tauri updater. The general documentation could be found here.

This module will handle requests from your tauri-app(s) by serving some json, which allows the tauri updater to determine whether an update are available or not. Just add the url of your silverstripe installation as the endpoint within the tauri config.

The module allows to manage multiple applications with different releases and artifacts. Simply go to the Update Server section within the CMS and add your information.

Checking for updates

Add the url of you're silverstripe-installation to the endpoint section within the tauri config:

{
  "updater": {
    "active": true,
    "endpoints": [
      "https://some.tld/update/<app-name>/{{target}}-{{arch}}/{{current_version}}"
    ]
  }
}

This will return with some json data and status code 200 if a new version are available or with status-code 204 if not.

Semver Version Checks

To check whether an app has updates, we'll use the composer/semver package. For more information see here.

Creating a new release

The module also supports creating a new release via a HTTP POST request. To create a new release you need the following information:

  • Token - If enabled on the application, you must serve a token with your request
  • Release Manifest - See below for more information

Release Manifest

To release a new version of an application, you MUST create a release manifest and send it along with your request. Also, you must specify at least one artifact you want to publish with your release. Simply these are the files the updater would upload if a new release are available.

Here you can see an example release manifest:

{
   "version":"<release-version>",
   "notes":"<release-notes>",
   "application":"<application-name>",
   "artifacts":[
      {
         "os":"<os (linux | darwin | windows)>",
         "arch":"arch (x86_64 | aarch64 | i686 | armv7)",
         "signature":"<tauri-artifact-signature>",
         "field":"<field-name>"
      }
   ]
}

For the request to function, you must create a form-data request, add your files under the field names for each artifact (field), add a MANIFEST field serving the above json and providing a TOKEN field. The endpoint for adding new releases are available under https://your.tld/release/add. More information about signing your builds could be found in the next section Code Signing.

Code Signing

Each artifact must contain a valid signature defined by tauri during the app builds. Therefore, you MUST create a pub/private-key to sign your artifacts.

The signature for each artifact could be found in the appropriate *.tar.gz.sig file within each single build target in the target folder of your tauri-app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.