Frappe S3 Attachment steps - ashish-greycube/help GitHub Wiki

on local server

bench get-app https://github.com/shridarpatil/frappe-attachments-s3
bench --site studio.greycube.in install-app frappe_s3_attachment
if required
source env/bin/activate
pip3 install python-magic -U
pip3 install botocore -U
pip3 install boto3 -U

create bucket first and then generate access key for user also, put 2 public off at time of bucket creation

###[A] to get AWS Key/AWS Secret

1)https://aws.amazon.com/s3/

go to security credentials image

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:*",
                "s3-object-lambda:*"
            ],
            "Resource": "*"
        }
    ]
}

image 2) create access key image 3) put keys in S3 File Attachment image

###[B] get bucket and folder name

  1. from services->storage-->s3 image
  2. create bucket : choose acl enabled and correct aws region image
  3. unblock public access and first checkbox and click create bucket image
  4. go inside bucket and click create folder (with defaults) image
  5. copy bucket name/region name to frappe s3 image image

###[C] go to any doctype and attach file, it should get uploaded to s3 amazon


create bucket with name and ACL is enabled image create folder in bucket image create user ( go to service credentials) image attach policy to user "amazon s3 full access" image copy user's arn : arn:aws:iam::xx:user/signum_user1 image go to bucket permissions, ublock first 2 image edit bucket policy

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "AddCannedAcl",
			"Effect": "Allow",
			"Principal": {
				"AWS": "arn:aws:iam::XX:user/signum_user1"
			},
			"Action": [
				"s3:PutObject",
				"s3:PutObjectAcl"
			],
			"Resource": "arn:aws:s3:::testme1/*",
			"Condition": {
				"StringEquals": {
					"s3:x-amz-acl": "public-read"
				}
			}
		}
	]
}

create access key for the user -- select Application running outside AWS image