denPusher is a CLI tool developed with .NET 8, intended for packaging into a tar archive, compressing using Zstandard, and/or uploading files to a web API. This tool simplifies the process of sending large amounts of data over the network by compressing the data locally before transmission. It's particularly useful for automating backups, batch processing of data for analysis, updating resources on a server, or uploading biaries for further installation.
It uses several libraries to facilitate its operations:
- Cocona: For easy command line interface creation and argument parsing.
- Newtonsoft.Json: For JSON data manipulation, crucial for web API communication.
- ZstdNet: For data compression using the Zstandard algorithm, optimizing upload efficiency.
- Packs using TAR and compresses using ZStandard;
- Uploads the compressed archive directly to a web API;
- Supports token-based authentication for secure API access;
- .NET 8 Runtime
To install denPusher, follow these steps:
- Clone the repository:
git clone https://github.com/buchmiet/denPusher.git
cd denPusherRestore NuGet packages:
dotnet restoreThis will install Cocona, Newtonsoft.Json, ZstdNet, and other dependencies.
Build the project:
dotnet buildTo create a tar archive from a source directory:
dotnet run --project denPusher tar <destination> [source directory]- destination: The output tar file name. This parameter is required.
- source directory: The source directory to tar. If not specified, defaults to the current directory.
To pack files into a tar archive and compress it with Zstandard:
dotnet run --project denPusher pack <destination> [source directory] [-c compression level]- destination: The output tar file name. This parameter is required.
- source directory: The source directory to tar. If not specified, defaults to the current directory.
- -c: Optional compression level using Zstandard, ranging from 1 (lowest compression) to 100 (highest compression). The default is 100.
To pack, compress and upload a directory or file to a web API with optional authentication:
dotnet run --project denPusher --upload <API_URL> [SOURCE_DIRECTORY]- login (l): API endpoint for authentication, specifying only the endpoint part;
- username (u): Username for API authentication;
- password (p): Password for API authentication;
- compression (c): Sets the optional compression level using Zstandard, ranging from 1 (lowest compression) to 100 (highest compression), with a default of 100.
- version (v): Specifies the version of the application binaries, if required by the web API;
For authentication and to specify the compression level:
dotnet run --project denPusher --upload --url <API_URL> [SOURCE_DIRECTORY] --login "LOGIN_ENDPOINT" --username "USERNAME" --password "PASSWORD" --compression 50 --version "0.8"dotnet run --project denPusher upload http://example.com/api/upload ./datadotnet run --project denPusher upload http://example.com/api/upload ./data -l login -u user -p pass -c 75 -v 1.0We appreciate contributions of any kind. To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Push your branch and open a pull request.
- License
denPusher is released under the MIT License. See the LICENSE file for more details.
13/02/2024: 0.8 Initial release;