Sinker is a Go executable that synchronises files from a given folder into an AWS S3 bucket.
Please note: this executable only watches for changed files if the executable is running. It will not update files if it was not executing when they have changed.
Go installed on your machine. On macOS you can install it via Homebrew with:
brew install go
Make sure to create a user in AWS IAM that has read and write access to your S3 bucket of choice. If you are uncertain what policy to give you can use the following JSON payload to give full rights (not only read/write) to your user on the bucket of choice:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::your-bucket-name-here",
"arn:aws:s3:::your-bucket-name-here/*"
]
}
]
}
Clone the project on your machine:
git clone git@github.com:thtg88/sinker.git
Copy .env.example
contents to a .env
in the same directory.
Make sure to set the correct env variables:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
: the access key ID and secret of an AWS user which has read and write access on your AWS S3 bucketAWS_BUCKET
: the actual S3 bucket you want to write toSINKER_BASE_PATH
: the base directory on your machine, which you want to keep synchronised
go run .