Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefansundin/s3sha256sum
Calculate SHA256 checksums of objects on Amazon S3.
https://github.com/stefansundin/s3sha256sum
amazon-s3 aws aws-sdk-go-v2 golang sha256sum
Last synced: 19 days ago
JSON representation
Calculate SHA256 checksums of objects on Amazon S3.
- Host: GitHub
- URL: https://github.com/stefansundin/s3sha256sum
- Owner: stefansundin
- License: gpl-3.0
- Created: 2021-10-28T05:50:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T17:33:03.000Z (2 months ago)
- Last Synced: 2024-10-11T00:55:13.170Z (about 1 month ago)
- Topics: amazon-s3, aws, aws-sdk-go-v2, golang, sha256sum
- Language: Go
- Homepage:
- Size: 114 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
s3sha256sum is a small program that calculates SHA256 checksums of objects stored on Amazon S3. Use it to verify the integrity of your objects.
If the expected checksum value has been attached to the object metadata (or tag), then s3sha256sum will automatically compare the values and report `OK` or `FAILED`. [See here for an example.](https://github.com/stefansundin/s3sha256sum/discussions/1)
s3sha256sum has a fancy feature that helps avoid double work and extra data transfer charges if you have to abort the hashing process. If you interrupt the program with Ctrl-C, it will print the internal state of the hash function and print a command that will resume the process from that position in the object.
For the paranoid, s3sha256sum also has an option that prints the status on an interval. This can be useful for humongous objects where you can't afford to restart the process from the beginning.
**Tip:** In many cases it may be worth running s3sha256sum on an EC2 instance located in the same region as the S3 bucket. Data transfer from S3 to EC2 is free.
## Installation
You can download precompiled binaries [from the releases section](https://github.com/stefansundin/s3sha256sum/releases/latest).
If you prefer to compile from source (or to use unreleased features), you can install using `go install`:
```
go install github.com/stefansundin/s3sha256sum@latest
```## Usage
```
$ s3sha256sum --help
Usage: s3sha256sum [parameters] [S3Uri]...
S3Uri must have the format s3:///.Parameters:
--ca-bundle string The CA certificate bundle to use when verifying SSL certificates.
--debug Turn on debug logging.
--endpoint-url string Override the S3 endpoint URL. (for use with S3 compatible APIs)
--expected-bucket-owner string The account ID of the expected bucket owner.
--no-sign-request Do not sign requests.
--no-verify-ssl Do not verify SSL certificates.
--paranoid duration Print status and hash state on an interval. (e.g. "10s")
--profile string Use a specific profile from your credential file.
--region string The region to use. Overrides config/env settings. Avoids one API call.
--request-payer string Confirms that the requester knows that they will be charged for the requests. Possible values: requester.
--resume string Provide a hash state to resume from a specific position.
--use-accelerate-endpoint Use S3 Transfer Acceleration.
--use-path-style Use S3 Path Style.
--verbose Verbose output.
--version Print version number.
--version-id string Version ID used to reference a specific version of the S3 object.
```You can also set environment variables that [aws-sdk-go-v2](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config#EnvConfig) automatically consumes:
```
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_ROLE_ARN
AWS_ROLE_SESSION_NAME
AWS_REGION
AWS_PROFILE
AWS_SHARED_CREDENTIALS_FILE
AWS_CONFIG_FILE
AWS_CA_BUNDLE
```