Skip to content

murdinc/drivethru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drivethru

Latest Release File Server

Build Status

Intro

drivethru does the heavy-lifting of presenting end-users with a one-line-command for installing your application. For example: curl -s http://dl.sudoba.sh/get/drivethru | sh

Features

installation scripts - drivethru generates an installation script that determines the OS and Architecture of the machine it is running on, and serves it at: /get/:appName

auto tarball - drivethru serves binary files as tarballs on-the-fly, so that your build scripts don't have to, and serves it at: /download/:appName/:os/:arch

Installation

drivethru installs itself via this command:

curl -s http://dl.sudoba.sh/get/drivethru | sh

Configuration

The configuration file is loaded from: /etc/drivethru/drivethru.conf and the options are very simple to configure. Example:

url = dl.sudoba.sh

host = localhost
port = 2020
root = /etc/drivethru/source

[drivethru]
source = drivethru
destination = /usr/local/bin/
github = https://github.com/murdinc/drivethru

[crusher]
source = crusher
destination = /usr/local/bin/
github = https://github.com/murdinc/crusher

[isosceles]
source = isosceles
destination = /usr/local/bin/
github = https://github.com/murdinc/isosceles

[awsm]
source = awsm
destination = /usr/local/bin/
github = https://github.com/murdinc/awsm

[awsmDashboard]
source = test
destination = ~/awsmDashboard
github = https://github.com/murdinc/awsmDashboard
universal = true

The structure of the source_folder for the configuration above should look similar to this:

source/
├── awsm
│   ├── Darwin
│   │   └── amd64
│   │       └── awsm
│   ├── Linux
│   │   ├── amd64
│   │   │   └── awsm
│   │   ├── arm
│   │   │   └── awsm
│   │   └── arm64
│   │       └── awsm
│   └── Windows
│       └── amd64
│           └── awsm
├── awsmDashboard
│   ├── index.html
│   ├── style.css
│   ├── awsmDashboard.js
│   └── awsmDashboard.js.map
│  
├── crusher
│   ├── Darwin
│   │   └── amd64
│   │       └── crusher
│   ├── Linux
│   │   ├── amd64
│   │   │   └── crusher
│   │   ├── arm
│   │   │   └── crusher
│   │   └── arm64
│   │       └── crusher
│   └── Windows
│       └── amd64
│           └── crusher
├── drivethru
│   ├── Darwin
│   │   └── amd64
│   │       └── drivethru
│   ├── Linux
│   │   ├── amd64
│   │   │   └── drivethru
│   │   ├── arm
│   │   │   └── drivethru
│   │   └── arm64
│   │       └── drivethru
│   └── Windows
│       └── amd64
│           └── drivethru
└── isosceles
    ├── Darwin
    │   └── amd64
    │       └── isosceles
    ├── Linux
    │   ├── amd64
    │   │   └── isosceles
    │   ├── arm
    │   │   └── isosceles
    │   └── arm64
    │       └── isosceles
    └── Windows
        └── amd64
            └── isosceles

Example Installation Script URL Output

This is an example installation script, generated for the installation of drivethru via the URL http://dl.sudoba.sh/get/drivethru

#!/bin/sh

FORMAT="tar.gz"
TEMPFOLDER="/tmp/drivethru-drivethru-$$"
TARBALL="$TEMPFOLDER/tar/drivethru.$FORMAT"
OS=$(uname)
ARCH=$(uname -m)
URL="http://dl.sudoba.sh/download/drivethru/$OS/$ARCH/"
DEST=/usr/local/bin/

sudo mkdir -p /tmp/$$/ && sudo chmod 777 /tmp/$$/

sudo mkdir -p "$TEMPFOLDER/tar"
sudo mkdir -p "$TEMPFOLDER/expanded"
sudo chmod -R 777 "$TEMPFOLDER"

echo "Downloading $URL"

curl -o $TARBALL -L -f $URL
if [ $? -eq 0 ]
then
    echo "\nCopying drivethru into $DEST\n"
    sudo mkdir -p $DEST/
    tar -xzf $TARBALL -C $TEMPFOLDER/expanded && sudo cp -av $TEMPFOLDER/expanded/drivethru/* $DEST/ && rm -rf drivethru
    if [ $? -eq 0 ]
    then
        sudo rm -rf "$TEMPFOLDER"
        echo "\ndrivethru has been installed into $DEST\n"
        echo "Done!"
        exit 0
    fi
else
    echo "Failed to install drivethru.\nPlease try downloading from https://github.com/murdinc/drivethru instead."
    sudo rm -rf "$TEMPFOLDER"
fi

exit 1

About

Latest Release File Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages