mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-28 01:36:21 +00:00
Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
992462c645
2 changed files with 30 additions and 2 deletions
|
@ -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',
|
||||
|
|
28
db/migrate/20240319124212_add_fedipact_to_fediblocks.rb
Normal file
28
db/migrate/20240319124212_add_fedipact_to_fediblocks.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Agrega threads.net a las listas de bloqueo
|
||||
class AddFedipactToFediblocks < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
change_column :activity_pub_fediblocks, :download_url, :string, null: true
|
||||
|
||||
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
|
||||
change_column :activity_pub_fediblocks, :download_url, :string, null: false
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue