about summary refs log tree commit diff
path: root/lib/tasks/mastodon.rake
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-11-14 18:33:13 -0600
committerStarfall <us@starfall.systems>2022-11-14 18:33:13 -0600
commitefa1bd9451c2aac68ce4576abdbbcdc266291f0f (patch)
tree4cfb9e485a912558e21032a77674562bf3fea635 /lib/tasks/mastodon.rake
parentb07b6b9f339b604f9af150eb10ac1486eca8f189 (diff)
parentceafd1f68f1f1b57c998adf693678059f9aaa70c (diff)
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'lib/tasks/mastodon.rake')
-rw-r--r--lib/tasks/mastodon.rake35
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index 3ec685c74..c1e5bd2b4 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -142,7 +142,40 @@ namespace :mastodon do
       prompt.say "\n"
 
       if prompt.yes?('Do you want to store uploaded files on the cloud?', default: false)
-        case prompt.select('Provider', ['Amazon S3', 'Wasabi', 'Minio', 'Google Cloud Storage'])
+        case prompt.select('Provider', ['DigitalOcean Spaces', 'Amazon S3', 'Wasabi', 'Minio', 'Google Cloud Storage'])
+        when 'DigitalOcean Spaces'
+          env['S3_ENABLED'] = 'true'
+          env['S3_PROTOCOL'] = 'https'
+
+          env['S3_BUCKET'] = prompt.ask('Space name:') do |q|
+            q.required true
+            q.default "files.#{env['LOCAL_DOMAIN']}"
+            q.modify :strip
+          end
+
+          env['S3_REGION'] = prompt.ask('Space region:') do |q|
+            q.required true
+            q.default 'nyc3'
+            q.modify :strip
+          end
+
+          env['S3_HOSTNAME'] = prompt.ask('Space endpoint:') do |q|
+            q.required true
+            q.default 'nyc3.digitaloceanspaces.com'
+            q.modify :strip
+          end
+
+          env['S3_ENDPOINT'] = "https://#{env['S3_HOSTNAME']}"
+
+          env['AWS_ACCESS_KEY_ID'] = prompt.ask('Space access key:') do |q|
+            q.required true
+            q.modify :strip
+          end
+
+          env['AWS_SECRET_ACCESS_KEY'] = prompt.ask('Space secret key:') do |q|
+            q.required true
+            q.modify :strip
+          end
         when 'Amazon S3'
           env['S3_ENABLED']  = 'true'
           env['S3_PROTOCOL'] = 'https'