scripting / feedlandInstall

Instructions for setting up a FeedLand server.
GNU General Public License v3.0
3 stars 1 forks source link

Option to use S3 for storage #15

Open scripting opened 1 year ago

scripting commented 1 year ago

If you look in the directory that contains feedland.js you will see a privateFiles sub-directory. There's one sub-folder for each user with an account.

There are two types of files it could contain:

  1. prefs.json -- very user will have this.
  2. bookmarks.opml -- if you're using bookmarks, you'll have one of these.

We found that we need the option to save these files in S3 instead of on the local machine, so I added a new config.json value, flUseS3ForStorage. If it's true, you must also provide a value for s3PathForStorage. And we will save files on S3 where you specify.

There are docs for these, here.

chriszarate commented 1 year ago

Confirmed working on my instance, thank you!

These steps should also be documented:

  1. Static website hosting must be enabled for the bucket.
  2. All "Block public access" options must be disabled.
  3. If you provision a user and credentials for FeedLand (recommended), select "ACLs enabled" under "Object ownership."
  4. The credentials must be supplied as environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
  5. The credentials you use must have permission to read, list, and write to the S3 bucket. Here is an example policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::bucket-name",
                "arn:aws:s3:::bucket-name/*"
            ]
        }
    ]
}
scripting commented 1 year ago

@chriszarate -- thanks for writing the S3 notes.

I put them on their own page, and linked to them from the config.md page.

https://github.com/scripting/feedlandInstall/blob/main/docs/s3storage.md