Skip to content

Having trouble with setup (S3 / CORS) #28

Answered by fyears
NAL100 asked this question in Q&A
Having trouble with setup (S3 / CORS) #28
Feb 8, 2022 · 2 answers · 3 replies

I thought I set up everything correctly - I'm new to Amazon S3 and set up a bucket. I click "Check connectivity" and hit Check, and it says the bucket cannot be reached. Followed all of the instructions. The bucket is set for versioning, encryption, and public access is blocked (I assume the key still allows logging in). No access points have been set up, I'm using the default ones in the article.

Here is what my CORS file looks like - I didn't know what settings to use but here is what I put (BTW it would be really helpful to have a sample file for people to upload so they don't have to generate their own):

[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE" ], "AllowedOrigins": [ "app://obsidian.md", "capacitor://localhost", "http://localhost" ], "ExposeHeaders": [] } ]

Endpoint and region used in settings:
s3endpoint: s3.us-east-1.amazonaws.com
s3region: us-east-1

Public and private key were generated by creating a new IAM user with "AmazonS3FullAccess" permissions group. I'm not sure what I'm doing wrong.

@NAL100

  1. Please also add HEAD into AllowedMethods and try again.

  2. If you still encounter errors, would you please open the console and see if any hints/errors shown up there?

    If you would like to access developer tools, you can find it in the menu bar (View > Toggle Developer Tools) or use the hotkey (cmd+ option + i on Mac and ctrl + shift + i for Windows).
    https://forum.obsidian.md/t/how-to-access-the-console/16703

Replies

2 suggested answers
·
3 replies

fyears
Feb 8, 2022
Maintainer

@NAL100

  1. Please also add HEAD into AllowedMethods and try again.

  2. If you still encounter errors, would you please open the console and see if any hints/errors shown up there?

    If you would like to access developer tools, you can find it in the menu bar (View > Toggle Developer Tools) or use the hotkey (cmd+ option + i on Mac and ctrl + shift + i for Windows).
    https://forum.obsidian.md/t/how-to-access-the-console/16703

3 replies
@NAL100

Adding HEAD to the CORS worked! (For anyone who needs the code here is the one I used):

[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE", "HEAD" ], "AllowedOrigins": [ "app://obsidian.md", "capacitor://localhost", "http://localhost" ], "ExposeHeaders": [] } ]

Thanks for your help on this. What an awesome plugin - just tested it on a new config where my vault on the iPhone was not stored in iCloud (I just selected to create it locally) and then created a new one on my computer as well, and got them both syncing back and forth!

@fyears

Great! haha

@fyears

Hi, (if you are, or anyone is, still reading this) in order to upload large files, you should also add ETag into exposed headers. I modify your example to a full example as here

Answer selected by NAL100

public access is blocked (I assume the key still allows logging in)

And yes the bucket usually should be private, because usually users do not want to share the notes to the public.

0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants