From 9e8c5710f2b504d44d91bcb409b239da433b5cd0 Mon Sep 17 00:00:00 2001
From: Nemo <commits@captnemo.in>
Date: Mon, 10 Jul 2023 17:01:50 +0530
Subject: [PATCH] upgrade mastodon and use persistent redis

---
 mastodon/db.tf     | 11 +++++++++++
 mastodon/locals.tf |  2 +-
 mastodon/main.tf   |  8 +++++---
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/mastodon/db.tf b/mastodon/db.tf
index 0b326e7..8bc0cc8 100644
--- a/mastodon/db.tf
+++ a/mastodon/db.tf
@@ -9,6 +9,17 @@
     memory      = 256
     memory_swap = 256
   }
+
+  # In case the cache dies,
+  # tootctl feeds build
+  # regenerates the feeds, run it from
+  # inside a mastodon container
+  volumes = [
+    {
+      host_path      = "/mnt/zwing/cache/mastodon-redis"
+      container_path = "/data"
+    }
+  ]
 }
 
 module "mastodon-db" {
diff --git a/mastodon/locals.tf b/mastodon/locals.tf
index 8ab26cf..c2806ab 100644
--- a/mastodon/locals.tf
+++ a/mastodon/locals.tf
@@ -1,5 +1,5 @@
 locals {
-  version = "4.1.2"
+  version = "4.1.4"
   env = [
     "LOCAL_DOMAIN=tatooine.club",
     "REDIS_HOST=mastodon-redis",
diff --git a/mastodon/main.tf b/mastodon/main.tf
index cf9af0a..b4e6e82 100644
--- a/mastodon/main.tf
+++ a/mastodon/main.tf
@@ -1,7 +1,7 @@
 module "mastodon-web" {
   name   = "mastodon-web"
   source = "../modules/container"
-  image  = "tootsuite/mastodon:v${local.version}"
+  image  = "ghcr.io/mastodon/mastodon:v${local.version}"
   keep_image = true
 
   networks = ["mastodon", "traefik", "external", "postgres"]
@@ -44,8 +44,9 @@
 module "mastodon-streaming" {
   name   = "mastodon-streaming"
   source = "../modules/container"
-  image  = "tootsuite/mastodon:v${local.version}"
+  image  = "ghcr.io/mastodon/mastodon:v${local.version}"
   keep_image = true
+
   # 24 threads for Streaming
   env = concat(local.env,[
     "DB_POOL=8",
@@ -68,12 +69,11 @@
     memory_swap = 512
   }
 }
-
 
 module "mastodon-sidekiq" {
   name   = "mastodon-sidekiq"
   source = "../modules/container"
-  image  = "tootsuite/mastodon:v${local.version}"
+  image  = "ghcr.io/mastodon/mastodon:v${local.version}"
   keep_image = true
   env = concat(local.env,[
     "DB_POOL=50"
--
rgit 0.1.5