serverless-podcast icon indicating copy to clipboard operation
serverless-podcast copied to clipboard

[UNMAINTAINED] 📢 Easy, cheap podcast hosting using Serverless and S3

serverless-podcast

Ever wanted to start podcasting? Now is your chance, it doesn't get easier than going serverless.

What you need

Setup

Local

  1. Run npm install
  2. Copy config.sample.yml to config.prod.yml and edit to your needs
  3. Run serverless deploy
  4. Run serverless invoke updateHTML to generate the HTML files (this is only needed after config changes).
  5. Run serverless invoke updatePublish to generate publish page (done at 00:00 every day)

AWS

  1. Enable Static Website Hosting (which is currently not possible with serverless) and set Index Document to index.html and Error Document to error.html.
  2. Create an IAM user with a policy (example below)
  3. Add the bucket URLs and credentials of the user to your config.prod.yml
  4. If you want to use a custom domain, you need to enable CORS (example below)

Example IAM policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::my-bucket/*"
            ]
        }
    ]
}

Example 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>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
    </CORSRule>
    <CORSRule>
        <AllowedOrigin>domain.com</AllowedOrigin>
        <AllowedMethod>POST</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
    </CORSRule>
</CORSConfiguration>

Usage

Go to http://mybucket.com/publish.html, fill out the fields and click publish. It's that easy.

License

This project is licensed under MIT, for more information see the LICENSE file.