serverless-podcast
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
- An AWS account
- serverless installed and configured
Setup
Local
- Run
npm install
- Copy
config.sample.yml
toconfig.prod.yml
and edit to your needs - Run
serverless deploy
- Run
serverless invoke updateHTML
to generate the HTML files (this is only needed after config changes). - Run
serverless invoke updatePublish
to generate publish page (done at 00:00 every day)
AWS
- Enable Static Website Hosting (which is currently
not possible
with serverless) and set Index Document to
index.html
and Error Document toerror.html
. - Create an IAM user with a policy (example below)
- Add the bucket URLs and credentials of the user to your
config.prod.yml
- 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.