Skip to content

DaysJan/ucloud-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

us3-cp

A command-line tool for uploading files to UCloud US3 storage using HMAC-SHA1 signature authentication.

Features

  • Simple command-line interface
  • Secure credential management (stored in ~/.config/us3-cp/config)
  • Cross-platform support (macOS and Linux)
  • Automatic MIME type detection
  • MD5 checksum calculation
  • Progress indication during upload

Requirements

  • Bash 4.0+
  • curl
  • openssl
  • file command (for MIME type detection)

Installation

  1. Download the us3-cp script:

    curl -LfS -o us3-cp https://raw.githubusercontent.com/DaysJan/ucloud-uploader/main/us3-cp
  2. Make it executable:

    chmod +x us3-cp
  3. (Optional) Add to your PATH:

    # Move to a directory in your PATH (e.g., ~/.local/bin)
    mv us3-cp ~/.local/bin

    Append to your shell config (~/.zshrc or ~/.bashrc)

    export PATH="$HOME/.local/bin:$PATH"

Configuration

On first run, the script will prompt you to create a configuration file at ~/.config/us3-cp/config.

You can also create it manually:

mkdir -p ~/.config/us3-cp
cat > ~/.config/us3-cp/config <<EOF
REGION="hk"
DOMAIN="ufileos.com"
PUBLIC_KEY="your-public-key"
PRIVATE_KEY="your-private-key"
EOF
chmod 600 ~/.config/us3-cp/config

Getting Your Credentials

Usage

us3-cp <local_file_path> <bucket_name>/<file_key>

Examples

# Upload a text file
us3-cp ./text.txt mybucket/text.txt

# Upload an image to a subdirectory
us3-cp /path/to/image.jpg mybucket/images/image.jpg

On successful upload, the script will output the download URL.

About

CLI tool for uploading files to UCloud US3 storage

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages