5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-01-30 22:14:00 +00:00

fix: all dp sites are public by default

This commit is contained in:
f 2025-01-24 13:40:55 -03:00
parent 7139eb3c8c
commit 4f8bf1c1d9
No known key found for this signature in database
3 changed files with 28 additions and 0 deletions

View file

@ -512,6 +512,9 @@ en:
storage network may continue retaining copies of the data
indefinitely.
Also, your site will be featured on the [Distributed
Press directory](https://explore.distributed.press/).
[Learn more](https://sutty.nl/learn-more-about-publish-to-dweb-functionality/)
deploy_social_distributed_press:
title: 'Publish on the Fediverse'

View file

@ -516,6 +516,9 @@ es:
nodos en la red de almacenamiento distribuida puedan retener
copias de tu contenido indefinidamente.
Además, tu sitio aparecerá en el [directorio de Distributed
Press](https://explore.distributed.press/)
[Saber más](https://sutty.nl/saber-mas-sobre-publicar-a-la-web-distribuida/)
deploy_social_distributed_press:
title: 'Publicar al Fediverso'

View file

@ -0,0 +1,22 @@
# frozen_string_literal: true
# Los sitios alojados en Distributed Press son públicos por defecto y no
# tienen HTTP, porque lo hace Sutty
class DistributedSitesArePublic < ActiveRecord::Migration[6.1]
def up
require 'distributed_press/v1/schemas/update_site'
DeployDistributedPress.all.reject do |deploy|
deploy.values.dig(*%w[remote_info distributed_press public]).present?
end.map do |deploy|
update_site = DistributedPress::V1::Schemas::UpdateSite.new.call(id: deploy.hostname, public: true, protocols: { http: false, hyper: true, ipfs: true })
deploy.send(:site_client).update(update_site)
updated_site = deploy.send(:site_client).show(update_site)
deploy.remote_info[:distributed_press] = updated_site.to_h
deploy.save
end
end
def down; end
end