Boilerplate for running Mastodon on AWS using Terraform and CircleCI.
┌---------------┐
| Web Browser |
└---------------┘
▲ ▲
| |
(HTTPS) (WSS)
| |
▼ |
┌------------┐ |
| CloudFront | |
└------------┘ |
▲ |
| |
(HTTP) |
| |
▼ ▼
┌---------------┐
| ALB |
└---------------┘
▲ ▲
| |
(HTTP) (WS)
| |
▼ ▼
┌------------------------┐
| ┌-Docker-┐ ┌-Docker--┐ |
| | Puma | | Express | |
| └--------┘ └---------┘ |
| ┌-Docker--┐ |
| | Sidekiq | EC2 |
| └---------┘ |
└------------------------┘
▲ ▲
| |
▼ ▼
┌----------------┐ ┌-------------┐
| ┌------------┐ | | ┌-------┐ |
| | PostgreSQL | | | | Redis | |
| └------------┘ | | └-------┘ |
| RDS | | Elasticache |
└----------------┘ └-------------┘
rails db:setup
by running custom ECS task on AWS consoleAWS IAM User access key ID for Terraform.
e.g. ABCDEFGHIJKLMNOPQRST
AWS region that the resources will be located in.
e.g. ap-northeast-1
AWS IAM User secret access key for Terraform.
e.g. abcdefghijklmnopqrstuvwxyz0123456789/+AB
The domain that your terraform state file will be stored.To run Terraform from CircleCI, you need to prepare a private AWS S3 bucket to store your terraform state file.
e.g. your-s3-bucket-name
Where to locate the terraform state file on the specified AWS S3 bucket.
e.g. terraform.tfstate
(recommended)
A valid S3 bucket name for uploading files (e.g. user profile images).
e.g. my-mastodon
The domain for the CloudFront distribution where uploaded files will be provided from.
e.g. cdn.example.com
Database password.
e.g. Generate a long random value like this:
ruby -r securerandom -e "puts SecureRandom.hex(64)"
Mastodon Docker image tag to detect which image to be deployed on ECS.If you are using mastodon-docker to build and push it to ECR,the CircleCI build number will be the Docker image tag.
e.g. 123
Note: this variable is not required at the 1st time because we need to create ECR repository before building Mastodon Docker image.
Mastodon Docker image tag to detect which image to be deployed on ECS for db:migrate
task.Why this value exists is because sometimes you may want to apply database migration before deploying new revision of application.
e.g. 124
Note: this variable is not required at the 1st time because we need to create ECR repository before building Mastodon Docker image.
The domain that your Mastodon instance will run on.
e.g. mastodon.example.com
One-time password secret
e.g. Generate a long random value like this:
ruby -r securerandom -e "puts SecureRandom.hex(64)"
The secret key base.
e.g. Generate a long random value like this:
ruby -r securerandom -e "puts SecureRandom.hex(64)"
If you want to use HTTPS,create free SSL certificate for your domain on Amazon Certificate Manager on us-east-1 region,then set its ARN to this environment variable.
e.g. arn:aws:acm:us-east-1:123456789012:certificate/12345678-90ab-cdef-1234-567890abcdef
For using secure WebSocket connection,create free SSL certificate for your domain on Amazon Certificate Manager on your region,then set its ARN to this environment variable too.
e.g. arn:aws:acm:ap-northeast-1:123456789012:certificate/12345678-90ab-cdef-1234-567890abcdef
AWS RDS DB instance class.
default: db.t2.micro
FYI: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html.
Memory size for node_streaming ECS task.
default: 300
Memory size for rails_db_migration ECS task.
default: 300
Memory size for rails_db_set_up ECS task.
default: 300
Memory size for rails_mastodon_make_admin_memory ECS task.
default: 300
Memory size for rails_puma ECS task.
default: 300
Memory size for rails_sidekiq ECS task.
default: 300
AWS Elasticache Cluster node type.
default: cache.t2.micro
FYI: https://aws.amazon.com/jp/elasticache/pricing/.
AWS EC2 instance type.
default: t2.micro
FYI: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html.
Administrator user name for the mastodon_rails_mastodon_make_admin
ECS task.
AWS IAM user access key ID for Rails to access to AWS API.
AWS IAM user secret access key for Rails to access to AWS API.
DB name.
default: mastodon
DB user name.
default: root
Default locale.
default: en
Email domain blacklist.
Email domain whitelist.
The base URL of Streaming API endpoint.
e.g. https://mastodon-streaming.example.com:4000
default: 1
Should the instance run in single user mode? (Disable registrations, redirect to front page)
default: false
TF_VAR_mastodon_paperclip_root_path
TF_VAR_mastodon_paperclip_root_url
TF_VAR_mastodon_paperclip_secret
TF_VAR_mastodon_prepared_statements
TF_VAR_mastodon_smtp_auth_method
TF_VAR_mastodon_smtp_delivery_method
TF_VAR_mastodon_smtp_domain
TF_VAR_mastodon_smtp_enable_starttls_auto
TF_VAR_mastodon_smtp_from_address
TF_VAR_mastodon_smtp_login
TF_VAR_mastodon_smtp_openssl_verify_mode
TF_VAR_mastodon_smtp_password
TF_VAR_mastodon_smtp_port
TF_VAR_mastodon_smtp_server
This boilerplate will create the following resources:
Pull Requests are welcome if you found bugs or features you think are missing.
Mastodon 是开源且免费的社交网络服务器,任何人都可以基于它创建类似推特/微博的产品(可以理解为搭建“私服微博/推特”)。但 Mastodon 与常见的社交网络不一样,其定位是去中心化的社交平台——可作为商业平台的替代方案,避免了单个公司垄断你沟通的风险。 基于 Mastodon 搭建的站点被称为“实例 (instance)”,这些“实例”既相互独立,又彼此关联(因为不同站点的用户可以毫无阻
Mastodon on AWS with Terraform Terraform module for mastodon service deploy Will deploy an ec2 instance with mastodon and run the service. Requirements AWS account EC2 domain with Route53 Terraform Us
Mastodon Material Language | 言語 日本語 (Japanese) Overview Mastodon Material is the native theme for Mastodon, which based on Material Design. Development policy is here (Japanese). Screenshots show/hide
A bot posting the Hacker News stories with 100+ points to Mastodon. https://hackertribe.io/@HackerNewsBot Usage Create an account for the bot. For convenience you can use youremail+hnbot@gmail.com, to
Code has been removed, there is no more need for follow bots, just use a relay like https://relay.mastodon.host for example.
Mastodon Bot Bots Hagh Hagh reblogs certain toots to itself creating a Hagh page. Users from local instance are able to make a toot hagh. Setup Have go and GNUMake installed. Copy the env var sample a