Closed nubpro closed 3 years ago
π Thanks for opening your first issue here! If you're reporting a π bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
For PUBLIC_AWS_BUCKET_ROOT
, do you have null in quotes, as shown in your example env, or just null
?
For
PUBLIC_AWS_BUCKET_ROOT
, do you have null in quotes, as shown in your example env, or justnull
?
They are in quotes indeed.
It will try to use the literal string "null" if it's in quotes.
It will try to use the literal string "null" if it's in quotes.
It works for the private s3 bucket where the null string is omitted from the actual path. The same applies to the public bucket when I tried it.
It should still not be in quotes unless that's actually part of the bucket URL
It should still not be in quotes unless that's actually part of the bucket URL
I understand, I will change this. I dont thk it is causing the bug? I also tested with the null string replaced with something proper, the same problem still occurs
I'm unable to reproduce this on the demo. https://demo.snipeitapp.com/hardware/1375
(Uploads are disabled on the demo though - I temporarily disabled them to test this. I'll leave it open for now so you can test for yourself tho.)
I'm unable to reproduce this on the demo. https://demo.snipeitapp.com/hardware/1375
(Uploads are disabled on the demo though - I temporarily disabled them to test this. I'll leave it open for now so you can test for yourself tho.)
Do u mind to leave them enabled til tomorrow? Im away currently π
Is it possible that u can share your masked ENV files so I can try to match it up?
# --------------------------------------------
# REQUIRED: UPLOADED FILE STORAGE SETTINGS
# --------------------------------------------
PRIVATE_FILESYSTEM_DISK=s3_private
PUBLIC_FILESYSTEM_DISK=s3_public
FILESYSTEM_DISK=s3
# --------------------------------------------
# PUBLIC S3 Settings
# --------------------------------------------
PUBLIC_AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXX'
PUBLIC_AWS_ACCESS_KEY_ID='YYYYYYYYY'
PUBLIC_AWS_DEFAULT_REGION='us-west-2'
PUBLIC_AWS_BUCKET=snipe-flysystem-public-test
PUBLIC_AWS_URL='https://XXXX.s3-us-west-2.amazonaws.com/'
# --------------------------------------------
# PRIVATE S3 Settings
# --------------------------------------------
PRIVATE_AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXX'
PRIVATE_AWS_ACCESS_KEY_ID='YYYYYYYYYY'
PRIVATE_AWS_DEFAULT_REGION='us-west-2'
PRIVATE_AWS_BUCKET=snipe-flysystem-private-test
--------------------------------------------
REQUIRED: UPLOADED FILE STORAGE SETTINGS
--------------------------------------------
PRIVATE_FILESYSTEM_DISK=s3_private PUBLIC_FILESYSTEM_DISK=s3_public
FILESYSTEM_DISK=s3
--------------------------------------------
PUBLIC S3 Settings
--------------------------------------------
PUBLIC_AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXX' PUBLIC_AWS_ACCESS_KEY_ID='YYYYYYYYY' PUBLIC_AWS_DEFAULT_REGION='us-west-2' PUBLIC_AWS_BUCKET=snipe-flysystem-public-test PUBLIC_AWS_URL='https://XXXX.s3-us-west-2.amazonaws.com/'
--------------------------------------------
PRIVATE S3 Settings
--------------------------------------------
PRIVATE_AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXX' PRIVATE_AWS_ACCESS_KEY_ID='YYYYYYYYYY' PRIVATE_AWS_DEFAULT_REGION='us-west-2' PRIVATE_AWS_BUCKET=snipe-flysystem-private-test
Interesting I dont thk I have set FILE_SYSTEM variable as s3. Lemme get back to u when Im home
Some good news! Turns out I misconfigured the IAM permissions, it was severely lacking of some essentially policies after referring to https://flysystem.thephpleague.com/v1/docs/adapter/aws-s3-v3/
Below is the required policies mandated by the flysystem:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1420044805001",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:ReplicateObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
I believe this can be better communicated over on the docs site, with that said, I'm closing this!
Filesystem abstraction library for PHP.
Debug mode
Describe the bug
I'm running a docker image, and therefore, I'm using S3 bucket as the storage layer. I've configured both public and private bucket through the ENV file. I've parked two individual S3 buckets under different AWS user, and have allocated the correct permissions respectively. I've verified this by using Postman to upload files to my S3 bucket with the credentials I've set up in the previous step.
The problem occurs when I'm trying to upload an asset image, I get hit by this error "Access Denied". The same does not happen to uploading asset files which are using the private s3 bucket.
Full error:
Docker ENV file:
Reproduction steps
Expected behavior
Able to upload asset image
Screenshots
No response
Snipe-IT Version
5.2.0
Operating System
Ubuntu
Web Server
Nginx
PHP Version
7 I think, Im using docker
Operating System
Window
Browser
Chrome
Version
92
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
No response