Skip to content

wushilin/rust-s3-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-s3-server

An S3 compatible Object Storage written in Rust. Ideal for local test environment

Building

$ cargo build --release

Running

Getting help

$ target/release/rusts3 --help
Usage: rusts3 [OPTIONS]

Options:
  -b, --base-dir <BASE_DIR>          [default: ./rusts3-data]
      --bind-address <BIND_ADDRESS>  Bind IP address [default: 0.0.0.0]
      --bind-port <BIND_PORT>        Bind port number [default: 8000]
      --log-conf <LOG_CONF>          Log4rs config file [default: ]
  -h, --help                         Print help

Example usage:

$ target/release/rusts3 -b "test-data" --bind-address "192.168.44.172" --bind-port 18000 --log-conf log4rs.yaml

Testing

Creating bucket:

$ aws --endpoint-url http://192.168.44.172:18000 s3 mb s3://new-bucket
make_bucket: new-bucket

Uploading object:

$ aws --endpoint-url http://192.168.44.172:18000 s3 cp ~/Downloads/zulu.dmg s3://new-bucket/some-path/zulu.dmg
upload: ./zulu.dmg to s3://new-bucket/some-path/zulu.dmg 

Downloading object:

$ aws --endpoint-url http://192.168.44.172:18000 s3 cp s3://new-bucket/some-path/zulu.dmg ./new.dmg
download: s3://new-bucket/some-path/zulu.dmg to ./new.dmg 

# files should be the same
$ diff ~/Downloads/zulu.dmg ./new/dmg

Listing object:

$ aws --endpoint-url http://192.168.44.172:18000 s3 ls s3://new-bucket
                           PRE some-path/
$ aws --endpoint-url http://192.168.44.172:18000 s3 ls s3://new-bucket/some-path/
                           PRE some-path/
2023-08-13 11:45:25     615835 zulu.dmg

Deleting object:

$ aws --endpoint-url http://192.168.44.172:18000 s3 rm s3://new-bucket/some-path/zulu.img
delete: s3://new-bucket/some-path/zulu.dmg

About

An S3 compatible Object Storage written in Rust. Ideal for local test environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published