Ruby HTML JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
logo
public
spec
vendor/assets
.coco.yml
.gitignore
.rspec
.rubocop.yml
.ruby-version
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package.json
yarn.lock

README.md

anmo

CircleCI Coverage Status

Development

Install phantomjs and make sure it's in your path.

./bin/setup

S3 configuration

Choose your subdomain. Create a bucket named the same as your chosen subdomain. Create an IAM user with a custom policy, using the name of your subdomain:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:*"
            ],
            "Resource": [
                "arn:aws:s3:::<your subdomain / s3 bucket name>",
                "arn:aws:s3:::<your subdomain / s3 bucket name>/*"
            ]
        }
    ]
}

Set these environment variables:

AWS_ACCESS_KEY_ID=<from IAM user>
AWS_SECRET_ACCESS_KEY=<from IAM user>
AWS_S3_BUCKET=<your chosen subdomain>
AWS_REGION=<region, for example: us-east-1>

Enable static site hosting on the bucket, and add the following CORS configuration:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

Temporarily add the IAMFullAccess policy to your AWS user. Upload the certificate (These files correspond directly to the files you download from dnsimple).

aws iam upload-server-certificate --server-certificate-name 'STAR.anmo.io' --certificate-body file://STAR_anmo_io.crt --private-key file://STAR_anmo_io.key --certificate-chain file://STAR_anmo_io_bundle.pem --path /cloudfront/

Configure a cloudfront web distribution:

Origin Domain Name: your s3 bucket
Forward Headers: Whitelist "Origin"
Alternate Domain Names (CNAMEs): your chosen subdomain
SSL Certificate: Custom SSL Certificate

Point your subdomain (CNAME) at the new cloudfront domain.