Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Probo Uploader

The probo uploader is a command line client for uploading files to Probo.CI or any server using the Probo Asset Receiver.

The idea with probo-uploader is to provide a simple and secure way to upload assets to a receiver from wherever they are generated. To this end the uploads are secured using a token that can be deleted at any time were the upload token to fall into enemy hands. Note that this client performs uploads and is incapable of downloading the files again. On probo.ci direct downloads are publicly available.

For use with Probo.CI you first need to go to your project page and generate an upload token. If you are using the asset receiver independently see below.

Requirements

Node.js 22 or newer. The client has no native dependencies, so it installs without a compiler on Linux, Windows, and macOS (both Apple Silicon and Intel).

Installation

Installation is easy using npm:

npm install -g probo-uploader

Usage

Uploading a file from disk

If you are uploading a file from disk you can specify the path to the file as a command line argument.

probo-uploader --token=[your token] some-file.txt

Uploading a file stream

If you are creating a mysqldump or similar it is possible to stream that file directly to the asset receiver.

mysqldump mydb | probo-uploader --token=[your token] --name=dev.sql

Uploading a file stream and monitoring progress

If you want to keep track of the progress of your upload you can use the pipeview command. This can be installed in Linux via the package manager.

Installing pipeview on MacOSX via Homebrew

brew install pv

Using pipeview

pv [database file] | probo-uploader --token=[your token] --name=[filename on probo]

Uploading to your own Probo Asset Receiver

First you'll need to create an upload token either manually or from another system. A set of curl steps for performing this action is described in the documentation for the Probo Asset Receiver.

probo-uploader --token=bar --host=http://localhost:3000 somefile.txt

Exploring options

Discover the options with -h:

probo-uploader -h

Checking the version

probo-uploader --version
probo-uploader -v

Using the client as a library

The package is an ES module and exposes UploadClient, whose methods return promises.

import { UploadClient } from 'probo-uploader';

const client = new UploadClient({
  host: 'https://upload.probo.ci',
  name: 'dev.sql',
  token: process.env.PROBO_UPLOAD_TOKEN,
});

await client.uploadFile('./dump.sql');
// ...or stream from anywhere:
await client.uploadStream(process.stdin);

Upgrading from 1.x

Version 2 targets modern Node and changes three things:

  • The package is now an ES module. Use import rather than require('probo-uploader').
  • uploadFile and uploadStream return promises instead of taking an error-first callback. Replace client.uploadFile(path, cb) with await client.uploadFile(path) and catch rejections.
  • Node 22 or newer is required.

The command line interface is unchanged.

Development

npm install
npm test              # runs the built-in Node test runner
npm run test:coverage

About

A CLI client for uploading files to the probo-asset-receiver.

Resources

Stars

2 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages