🐑 Commons Host

Documentation

@commonshost/core

Deployment

Table of Contents

System Dependencies

Service Dependencies

Usage

Runs as a command line application.

commonshost-core <configuration>

Where <configuration> is the path to a file containing the configuration options. It can be JavaScript or JSON.

Configuration

Example of a configuration file using environment variables.

See: ./core.conf.example.js

AWS IAM Policies

Users

Buckets

Policies

Upload or Delete Files

core-production
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:PutObject",
        "s3:PutObjectAcl",
        "s3:DeleteObject"
      ],
      "Resource": [
        "arn:aws:s3:::commonshost-production",
        "arn:aws:s3:::commonshost-production/*"
      ]
    }
  ]
}
core-test
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:PutObject",
        "s3:PutObjectAcl",
        "s3:DeleteObject"
      ],
      "Resource": [
        "arn:aws:s3:::commonshost-test",
        "arn:aws:s3:::commonshost-test/*"
      ]
    }
  ]
}

List and Read Files

edge-production
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetObject"
      ],
      "Resource": [
        "arn:aws:s3:::commonshost-production",
        "arn:aws:s3:::commonshost-production/*"
      ]
    }
  ]
}
edge-test
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetObject"
      ],
      "Resource": [
        "arn:aws:s3:::commonshost-test",
        "arn:aws:s3:::commonshost-test/*"
      ]
    }
  ]
}