dwyl / github-backup

:octocat: :back: πŸ†™ Backup your GitHub Issues so you can still work when (they/you are) offline.
https://github-backup.herokuapp.com
GNU General Public License v2.0
32 stars 3 forks source link

MVP Project setup #18

Closed SimonLab closed 6 years ago

SimonLab commented 6 years ago

As a developer of the MVP I want to define an easy setup of the application So that I can start implementing, deploying and validating the main ideas of github-backup

Once these three main steps are done we can

@nelsonic @iteles If this setup sounds good to you, do you have a preference on how to create the Heroku app: should I create a new account with a gmail address or should we create the app on a dwyl account?

Cleop commented 6 years ago

Steps for setting up Amazon S3 (Simple Storage Service). Assumption: you already have an AWS account.

Keywords: bucket (a folder), objects (a file/photo etc. that you wish to save in your bucket).

Every bucket is assigned to a region, you can choose any AWS Region that is geographically close to you for optimisation of cost/speed. You are not charged for creating a bucket. You are only charged for storing objects in the bucket and for transferring objects out of the bucket. Note: bucket names must be globally unique and cannot be changed, they will also feature in the url of the item so consider this when creating them.

image image

Versioning – Versioning enables you to keep multiple versions of an object in one bucket. Versioning is disabled for a new bucket by default.--- relevant for this project @SimonLab ?

Server access logging – Server access logging provides detailed records for the requests that are made to your bucket. By default, Amazon S3 does not collect server access logs.

Tags – With AWS cost allocation, you can use tags to annotate billing for your use of a bucket. A tag is a key-value pair that represents a label that you assign to a bucket. To add tags, choose Tags, and then choose Add tag.

Object-level logging – Object-level logging records object-level API activity by using CloudTrail data events.

Default encryption – Amazon S3 default encryption provides a way to set the default encryption behavior for an S3 bucket. You can set default encryption on a bucket so that all objects are encrypted when they are stored in the bucket.

I then proceeded and clicked 'create bucket' and got this message when I had enabled 'versioning', it then worked fine when I disabled versioning. image

The bucket has now been created πŸŽ‰

@SimonLab - do you think we need to enable versioning?

Cleop commented 6 years ago

Next we need our files to automatically be added to S3 from our application using the S3 API.

https://devcenter.heroku.com/articles/s3

@nelsonic - do I have the right permissions?

I want to be able to access secret keys on my security credentials like this: image

But currently I only see my password on this page, nothing else: image

image

nelsonic commented 6 years ago

@Cleop you should be able to access your security keys on AWS, please share your screen tomorrow morning during standup so we can debug this.

@SimonLab I think the app should be "owned" by dwyl and You and Cleo should be added to the dwyl Heroku group. (yes this means there's no "free web dynos", but that's "OK", we need to ship!)

Cleop commented 6 years ago

Having added the config vars to heroku, next comes deciding how files will be uploaded to S3. The 2 options are: direct uploads or pass-through uploads.

Pass-through uploading sends the file from the user to the application on Heroku which then uploads it to S3. Benefits of this approach include the ability to pre-process user-uploads before storing in S3. However, be careful that large files don’t tie up your application dynos during the upload process.

nelsonic commented 6 years ago

@Cleop users are not uploading anything to S3. Our Phoenix App will create a {commentid}.md file in the S3 bucket using ex-aws and store a reference to it in the comment_history table. We really need a separate issue for "Saving Comment Richtext Data to S3" as this isn't really "setup" it's "technical implementation detail" ...

Cleop commented 6 years ago

Having created #31 for the saving of data to S3, I've ticked the checkbox on this issue for setting up my account and creating a bucket.

Cleop commented 6 years ago

Closing as 'Done' in the Projects board.