5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 01:16:23 +00:00

feat: fedipact

This commit is contained in:
f 2024-03-19 09:47:24 -03:00
parent 979f3c1b3a
commit b90f886446
No known key found for this signature in database
2 changed files with 27 additions and 2 deletions

View file

@ -31,8 +31,8 @@ class ActivityPub
class FediblockDownloadError < ::StandardError; end
validates_presence_of :title, :url, :download_url, :format
validates_inclusion_of :format, in: %w[mastodon fediblock]
validates_presence_of :title, :url, :format
validates_inclusion_of :format, in: %w[mastodon fediblock none]
HOSTNAME_HEADERS = {
'mastodon' => '#domain',

View file

@ -0,0 +1,25 @@
# frozen_string_literal: true
# Agrega threads.net a las listas de bloqueo
class AddFedipactToFediblocks < ActiveRecord::Migration[6.1]
def up
fedipact =
ActivityPub::Fediblock.create(
hostnames: %w[threads.net],
title: 'Fedipact',
url: 'https://fedipact.online/',
format: 'none'
)
DeploySocialDistributedPress.find_each do |deploy|
FediblockState.create(site: deploy.site, fediblock: fedipact, aasm_state: 'disabled').tap do |f|
f.enable!
end
end
end
def down
fedipact = ActivityPub::Fediblock.find_by(url: 'https://fedipact.online/').delete
FediblockState.where(fediblock_id: fedipact.id).delete_all
end
end