-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
384 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Clearing cache | ||
|
||
Clearing the cache is done via the pz command line. | ||
|
||
Make sure you have a pullzone api key stored and then use `pz -p` (PullZone purge) | ||
|
||
## Usage | ||
|
||
```console | ||
bnycdn pz -p <name> | ||
``` | ||
|
||
If you are unsure about your pullzone name, use `pz -l` to list all accessible pullzoneswith your current API Key and search for the name column | ||
|
||
You can also use anorther API key than default: | ||
|
||
```console | ||
bnycdn pz -p <name> -k <key_name> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Downloading file or directories | ||
|
||
Downloading a file into a storage is done via cp command, directories with -R (recursive) option | ||
|
||
Make sure you have a storage password stored and then use `cp` | ||
|
||
A read only storage password is enough for downloads, but you can use standard password of course. | ||
|
||
*Please note that there is no progress bar as of now, backgrounded large file downloads may look idle.* | ||
|
||
## Usage | ||
```console | ||
bnycdn cp -s <storage_key_name> [-R] --from <path_from_bunnycdn> --to <path_to_machine> | ||
``` | ||
|
||
Please note that the path *must* start with the storage name from bunnycdn. | ||
|
||
For example, my storage name is testcdn. | ||
|
||
## Examples | ||
|
||
### Download a single file | ||
```console | ||
$ bnycdn cp -s testcdn --from /testcdn/bunnycdncli/nightly/bnycdn_0.0.3-1_amd64.deb --to ./test/test.deb | ||
⌛ [DL] ./test/test.deb => ? | ||
⌛ [IO] ./test/test.deb => ? | ||
✔ [OK] ./test/test.deb => 8.92 MB | ||
``` | ||
|
||
### Download directory recursivly | ||
```console | ||
$ bnycdn cp -R -s testcdn --from /testcdn/bunnycdncli/nightly/ --to ./testfiles/ | ||
↻ [WT] [ ∞ 0| ⇅ 1 | o 0] /testcdn/bunnycdncli/nightly/Packages => 1.04 KB | ||
⌛ [DL] [ ∞ 0| ⇅ 2 | o 0] ./testfiles/Packages => 1.04 KB | ||
[ truncated for readability] | ||
⌛ [DL] [ ∞ 2| ⇅ 8 | o 1] ./testfiles/bnycdn_0.0.2-1_armel.deb => 7.66 MB | ||
↻ [WT] [ ∞ 2| ⇅ 7 | o 1] /testcdn/bunnycdncli/nightly/deb/Release => 1.96 KB | ||
⌛ [DL] [ ∞ 2| ⇅ 8 | o 1] ./testfiles/deb/Release => 1.96 KB | ||
↻ [WT] [ ∞ 2| ⇅ 8 | o 1] /testcdn/bunnycdncli/nightly/deb/Packages.xz => 652 B | ||
↻ [WT] [ ∞ 3| ⇅ 8 | o 1] /testcdn/bunnycdncli/nightly/deb/Packages.gz => 594 B | ||
↻ [WT] [ ∞ 4| ⇅ 8 | o 1] /testcdn/bunnycdncli/nightly/deb/Packages.bz2 => 661 B | ||
↻ [WT] [ ∞ 5| ⇅ 8 | o 1] /testcdn/bunnycdncli/nightly/deb/Packages => 1.04 KB | ||
[ truncated for readability] | ||
⌛ [IO] [ ∞ 0| ⇅ 1 | o 14] ./testfiles/bnycdn_0.0.2-1_amd64.deb => 8.78 MB | ||
✔ [OK] [ ∞ 0| ⇅ 1 | o 15] ./testfiles/bnycdn_0.0.2-1_amd64.deb => 8.78 MB | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# Documentation | ||
- [01 - Installation](https://dkfn.github.io/bunnycdn-cli/docs/install) | ||
- [02 - Adding/Editing/Deleting API keys and storage passwords](https://dkfn.github.io/bunnycdn-cli/docs/key) | ||
- [03 - Clear cache from a pullzone](https://dkfn.github.io/bunnycdn-cli/docs/cache-clear) | ||
- [04 - Add/Remove hostnames to a pullzone](https://dkfn.github.io/bunnycdn-cli/docs/pz-hostnames) | ||
- [05 - List files in a storage](https://dkfn.github.io/bunnycdn-cli/docs/list-files) | ||
- [06 - Upload file(s) to a storage](https://dkfn.github.io/bunnycdn-cli/docs/upload) | ||
- [07 - Download file(s) to a storage](https://dkfn.github.io/bunnycdn-cli/docs/download) | ||
- [08 - Ban/UnBan hostnames to a pullzone -Doc TODO-](https://dkfn.github.io/bunnycdn-cli/docs/bans) | ||
- [09 - Change the number of asynchronous operations](https://dkfn.github.io/bunnycdn-cli/docs/set-workers) | ||
|
||
# Manual Pages -TODO- | ||
- [01 - key](https://dkfn.github.io/bunnycdn-cli/docs/man/key) | ||
- [02 - cp](https://dkfn.github.io/bunnycdn-cli/docs/man/cp) | ||
- [03 - ls](https://dkfn.github.io/bunnycdn-cli/docs/man/ls) | ||
- [04 - pz](https://dkfn.github.io/bunnycdn-cli/docs/man/pz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Install | ||
|
||
- [Ubuntu/Debian]() | ||
|
||
- [NPM]() | ||
|
||
- [MacOS]() -pending 0.5- | ||
|
||
- [Windows]() -pending 0.5- | ||
|
||
- [Docker]() -pending 0.5- | ||
|
||
> As the project is in early developpement stages and will receive frequent updates, I strongly suggest that you use NPM to easily get updates | ||
## Ubuntu/Debian | ||
This is the only native release method for now. More operating systems will be supported native | ||
|
||
*Using this method will not get you auto-updates. This will be supported in a future release* | ||
|
||
### AMD64 | ||
```console | ||
wget http://cdn.infra.tetel.in/bunnycdn-cli/nightly/deb/bnycdn_0.2.1-1_amd64.deb | ||
sudo dpkg -i bnycdn_0.2.0-1_amd64.deb | ||
``` | ||
|
||
### ARM | ||
```console | ||
wget http://cdn.infra.tetel.in/bunnycdn-cli/nightly/deb/bnycdn_0.2.1-1_armel.deb | ||
sudo dpkg -i bnycdn_0.2.0-1_armel.deb | ||
``` | ||
|
||
|
||
## NPM | ||
This is great if you already have NodeJS installed (>= 8.0.0) and you can update the cli with a simple command. | ||
Also, it is the only way to get it working on unsupported systems. | ||
|
||
```console | ||
$ npm install -g bnycdn | ||
``` | ||
|
||
|
||
You should be able to execute bunnycdn connands : | ||
```console | ||
$ bnycdn help | ||
|
||
Simple cli for BunnyCDN service. This app is not an official one. | ||
|
||
VERSION | ||
bnycdn/0.2.1 linux-x64 node-v8.10.0 | ||
|
||
USAGE | ||
$ bnycdn [COMMAND] | ||
|
||
COMMANDS | ||
cp This is the cp-like command for BunnyCDN storages. | ||
help display help for bnycdn | ||
key To add / delete / set a key for a pullzon or a storage | ||
ls describe the command here | ||
pz Only allows you to list pull zones so far | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Managing keys and password | ||
|
||
Via the `key` command you can add, edit and delete API keys and storage passwords. | ||
|
||
## Usage | ||
```console | ||
bnycdn [-l] [-s <key_name>] [-d <key_name>] [-v <key_value>] [-t <key_type>] | ||
``` | ||
|
||
### Examples | ||
#### Add default API Key: | ||
```console | ||
$ bnycdn key -s default -v my_api_key_from_panel | ||
ⓘ Successfully deleted key : default | ||
``` | ||
|
||
### Add aliased API Key (If you have multiple accounts): | ||
|
||
```console | ||
$ bnycdn key -s myKeyName -v my_api_key_from_panel | ||
ⓘ Successfully deleted key : myKeyName | ||
``` | ||
|
||
#### Add a storage Key: | ||
|
||
```console | ||
$ bnycdn key -s mynewkey -t storages -v my_storage_ftp_password | ||
ⓘ Key successfully set: mynewkey | ||
``` | ||
|
||
#### Add a default storage Key: | ||
|
||
```console | ||
$ bnycdn key -s default -t storages -v my_storage_ftp_password | ||
ⓘ Key successfully set: mynewkey | ||
``` | ||
|
||
#### Delete a key | ||
|
||
```console | ||
$ bnycdn key -d mynewkey -t storages | ||
ⓘ Successfully deleted key : mynewkey | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# List files in a storage | ||
|
||
Listing files and directory in a storage is done via ls command | ||
|
||
Make sure you have a storage password stored and then use `ls` (ls implementation) | ||
|
||
## Usage | ||
```console | ||
bnycdn -s <storage_key_name> -d <path_of_storage_directory> | ||
``` | ||
|
||
Please note that the path *must* start with the storage name from bunnycdn. | ||
|
||
For example, my storage name is testcdn. | ||
|
||
## Examples | ||
Adding a key and then listing all directories: | ||
```console | ||
$ bnycdn key -s testcdn -v XXXXXXX | ||
ⓘ Key successfully set: testcdn | ||
➜ bunnycdn-cli git:(master) ✗ bnycdn ls -s testcdn -d /testcdn/ | ||
type lastChanged size path | ||
--------- ----------------------- -------- ------------------------------------ | ||
[ DIR ] 2019-03-11T22:08:20.501 0 B /testcdn/minireddit | ||
[ DIR ] 2019-03-10T21:24:20.971 0 B /testcdn/nightly | ||
[ FILE ] 2019-03-09T23:27:04.895 1 MB /testcdn/samplebig.mkv | ||
[ FILE ] 2019-03-10T00:32:26.305 1000 MB /testcdn/1GB.bin | ||
[ FILE ] 2019-03-16T12:51:56.237 317 B /testcdn/manifest.json | ||
[ FILE ] 2019-03-09T23:36:43.722 10.01 MB /testcdn/samplemid1.mkv | ||
[ FILE ] 2019-03-09T23:24:16.448 97.11 KB /testcdn/paris.jpg | ||
|
||
$ bnycdn ls -s testcdn -d /testcdn/nightly/ | ||
type lastChanged size path | ||
--------- ----------------------- ---- ----------------------- | ||
[ DIR ] 2019-03-10T21:59:01.941 0 B /testcdn/nightly/deb | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Adding and removing hostnames | ||
|
||
Adding or removing hostnames into a pullzone is done via the pz command: | ||
|
||
|
||
Make sure you have a pullzone api key stored and then use `pz -a` (Adds an hostname) or `pz -d` (Deletes an hostname) | ||
|
||
## Usage | ||
### Add | ||
```console | ||
bnycdn pz -a <pullzone_name> -v <hostname> | ||
``` | ||
|
||
### Remove | ||
```console | ||
bnycdn pz -d <pullzone_name> -v <hostname> | ||
``` | ||
|
||
## Examples: | ||
```console | ||
$ bnycdn pz -a testpz -v cdn.example.com | ||
|
||
$ bnycdn pz -d testpz -v cdn.example.com | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Changing the number of connections | ||
|
||
By default, the CLI will try to perform download/uploads with 8 parallel connections. | ||
You can change the number of asynchronous operations by setting `BNYCDN_PARALLEL` varenv | ||
|
||
It is set to 8 by default. This is an average guess of the typical usage (mixed big and small files) and should give correct performance. | ||
Of course, it may not be ideal for orther cases (slow connections, big file downloads). | ||
|
||
Please note that raising this value to much (> 20) may result in dropped connections or poor I/O performance. | ||
|
||
## Examples | ||
```console | ||
$ export BNYCDN_PARALLEL=1; bnycdn cp -R -s testcdn --to /testcdn/bunnycdnclitest2/ --from ./testfiles2/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Uploading file or directories | ||
|
||
Uploading a file into a storage is done via cp command, directories with -R (recursive) option | ||
|
||
Make sure you have a storage password stored and then use `cp` | ||
|
||
*Please note that there is no progress bar as of now, backgrounded large file uploads may look idle.* | ||
|
||
## Usage | ||
```console | ||
bnycdn cp -s <name_of_storage_key> [-R] --from <path_from_machine> --to <path_to_storage> | ||
``` | ||
|
||
Please note that the path *must* start with the storage name from bunnycdn. | ||
|
||
For example, my storage name is testcdn. | ||
|
||
## Examples | ||
|
||
Single file upload | ||
```console | ||
$ bnycdn cp -s testcdn --from ./dist/deb/bnycdn_0.0.3-1_amd64.deb --to ./testcdn/bunnycdncli/nightly/testup.deb | ||
⌛ [UP] ./testcdn/bunnycdncli/nightly/testup.deb => 8.92 MB | ||
✔ [OK] ./testcdn/bunnycdncli/nightly/testup.deb => 8.92 MB | ||
``` | ||
|
||
Directory upload | ||
```console | ||
$ bnycdn cp -s testcdn -R --from ./dist/deb/ --to ./testcdn/bunnycdncli/nightly/ | ||
⌛ [UP] [ ∞ 0| ⇅ 1 | o 0] ./testcdn/bunnycdncli/nightly/Packages => 1.04 KB | ||
⌛ [UP] [ ∞ 0| ⇅ 2 | o 0] ./testcdn/bunnycdncli/nightly/Packages.bz2 => 661 B | ||
⌛ [UP] [ ∞ 0| ⇅ 3 | o 0] ./testcdn/bunnycdncli/nightly/Packages.gz => 596 B | ||
⌛ [UP] [ ∞ 0| ⇅ 4 | o 0] ./testcdn/bunnycdncli/nightly/Packages.xz => 656 B | ||
⌛ [UP] [ ∞ 0| ⇅ 5 | o 0] ./testcdn/bunnycdncli/nightly/Release => 1.96 KB | ||
⌛ [UP] [ ∞ 0| ⇅ 6 | o 0] ./testcdn/bunnycdncli/nightly/bnycdn_0.0.3-1_amd64.deb => 8.92 MB | ||
⌛ [UP] [ ∞ 0| ⇅ 7 | o 0] ./testcdn/bunnycdncli/nightly/bnycdn_0.0.3-1_armel.deb => 7.8 MB | ||
✔ [OK] [ ∞ 0| ⇅ 6 | o 0] ./testcdn/bunnycdncli/nightly/Release => 1.96 KB | ||
✔ [OK] [ ∞ 0| ⇅ 5 | o 0] ./testcdn/bunnycdncli/nightly/Packages => 1.04 KB | ||
✔ [OK] [ ∞ 0| ⇅ 4 | o 0] ./testcdn/bunnycdncli/nightly/Packages.bz2 => 661 B | ||
✔ [OK] [ ∞ 0| ⇅ 3 | o 0] ./testcdn/bunnycdncli/nightly/Packages.xz => 656 B | ||
✔ [OK] [ ∞ 0| ⇅ 2 | o 0] ./testcdn/bunnycdncli/nightly/Packages.gz => 596 B | ||
✔ [OK] [ ∞ 0| ⇅ 1 | o 0] ./testcdn/bunnycdncli/nightly/bnycdn_0.0.3-1_armel.deb => 7.8 MB | ||
✔ [OK] ./testcdn/bunnycdncli/nightly/bnycdn_0.0.3-1_amd64.deb => 8.92 MB | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.