Skip to content

Thechi2000/bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootstrap

Overview

The goal of this program is to update an application using a remote server, then start it, to ensure that the application will always be up to date. It uses compile time environment variables thus allowing easy reconfiguration without the need of an extra file at runtime.
To achieve that, it goes through the following steps:

Behavior

The bootstrap first send a GET request to the server, at the url specified by FETCH_URL.
It expects to receive a json formatted as follows:

    {
        base_url: String - Url of the root of the application
        algorithm: String - Name of the algorithm to checksum the files
        files: FileInfo[] - Array containing the informations for each file of the application
        ignored_files: String[] - List of files/dirs that won't be modified during the update
    }
    
    FileInfo:
    {
        path: String - Path of the file (relative to the root of the application
        hash: String - Checksum of the file (Crockford Base32 Encoding)
        placeholder: bool - A placeholder file will never be overwritten, only downloaded when absent
    }

Available hash algorithm are SHA256, SHA384, SHA512, SHA512_256

Then, it computes the checksum of all files in the working directory and compare it to the one received, and updates the file if it differs. If the file is not referenced in the json, it is deleted. The downloaded file url are computed by merging base_url and path.

When the update is completed, it starts the executable designated by EXECUTABLE_NAME

Compilation

All used libraries are platform independent, thus making the application easy to cross compile.

The following environment are needed at compile time:

  • FETCH_URL: Url where to fetch the json
  • EXECUTABLE_NAME: Name of the executable of the application, started after update

Arguments

Several argument can be given at runtime:

  • --fetch: Override FETCH_URL
  • --dir: Override DOWNLOAD_DIR
  • --no_gui:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages