Skip to content

Commit

Permalink
Merge pull request #203 from SUNET/masto-steaming
Browse files Browse the repository at this point in the history
Masto streaming
  • Loading branch information
mickenordin authored Oct 14, 2024
2 parents 982a69d + dc7130a commit 2187bae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions manifests/mastodon/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
String $db_port = '5432',
String $db_user = 'postgres',
String $interface = 'ens3',
String $mastodon_image = 'ghcr.io/mastodon/mastodon',
String $mastodon_version = 'latest',
String $redis_host = 'redis',
String $redis_port = '6379',
Expand All @@ -19,6 +20,8 @@
String $smtp_openssl_verify_mode = 'none',
String $smtp_port = '587',
String $smtp_server = 'smtp.sunet.se',
String $streaming_image = 'ghcr.io/mastodon/mastodon-streaming',
String $streaming_version = 'latest',
String $vhost = 'social.sunet.se',
) {

Expand All @@ -29,6 +32,9 @@


# Must set in hiera eyaml
$active_record_encryption_primary_key = safe_hiera('active_record_encryption_primary_key')
$active_record_encryption_key_derivation_salt = safe_hiera('active_record_encryption_key_derivation_salt')
$active_record_encryption_deterministic_key = safe_hiera('active_record_encryption_deterministic_key')
$aws_access_key_id=safe_hiera('aws_access_key_id')
$aws_secret_access_key=safe_hiera('aws_secret_access_key')
$db_pass=safe_hiera('db_pass')
Expand Down
14 changes: 7 additions & 7 deletions templates/mastodon/web/docker-compose.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ services:
restart: unless-stopped

web:
image: tootsuite/mastodon:<%= @mastodon_version %>
image: <%= @mastodon_image %>:<%= @mastodon_version %>
container_name: web
restart: always
restart: unless-stopped
env_file:
- mastodon.env
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
Expand All @@ -74,8 +74,8 @@ services:

streaming:
container_name: streaming
image: tootsuite/mastodon:<%= @mastodon_version %>
restart: always
image: <%= @streaming_image %>:<%= @streaming_version %>
restart: unless-stopped
env_file: mastodon.env
command: node ./streaming
dns:
Expand All @@ -94,8 +94,8 @@ services:

sidekiq:
container_name: sidekiq
image: tootsuite/mastodon:<%= @mastodon_version %>
restart: always
image: <%= @mastodon_image %>:<%= @mastodon_version %>
restart: unless-stopped
env_file: mastodon.env
command: bundle exec sidekiq
dns:
Expand All @@ -111,7 +111,7 @@ services:
files:
container_name: files
image: nginx:latest
restart: always
restart: unless-stopped
dns:
- 89.32.32.32
networks:
Expand Down
3 changes: 3 additions & 0 deletions templates/mastodon/web/mastodon.env.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=<%= @active_record_encryption_primary_key %>
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=<%= @active_record_encryption_key_derivation_salt %>
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=<%= @active_record_encryption_deterministic_key %>
LOCAL_DOMAIN=<%= @vhost %>
REDIS_URL=redis://default:<%= @redis_pass %>@<%= @redis_host %>:6379
DB_HOST=<%= @db_host %>
Expand Down

0 comments on commit 2187bae

Please sign in to comment.