mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-31 04:59:58 +00:00
fix: all dp sites are public by default
This commit is contained in:
parent
7139eb3c8c
commit
4f8bf1c1d9
3 changed files with 28 additions and 0 deletions
|
@ -512,6 +512,9 @@ en:
|
||||||
storage network may continue retaining copies of the data
|
storage network may continue retaining copies of the data
|
||||||
indefinitely.
|
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/)
|
[Learn more](https://sutty.nl/learn-more-about-publish-to-dweb-functionality/)
|
||||||
deploy_social_distributed_press:
|
deploy_social_distributed_press:
|
||||||
title: 'Publish on the Fediverse'
|
title: 'Publish on the Fediverse'
|
||||||
|
|
|
@ -516,6 +516,9 @@ es:
|
||||||
nodos en la red de almacenamiento distribuida puedan retener
|
nodos en la red de almacenamiento distribuida puedan retener
|
||||||
copias de tu contenido indefinidamente.
|
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/)
|
[Saber más](https://sutty.nl/saber-mas-sobre-publicar-a-la-web-distribuida/)
|
||||||
deploy_social_distributed_press:
|
deploy_social_distributed_press:
|
||||||
title: 'Publicar al Fediverso'
|
title: 'Publicar al Fediverso'
|
||||||
|
|
22
db/migrate/20250123203140_distributed_sites_are_public.rb
Normal file
22
db/migrate/20250123203140_distributed_sites_are_public.rb
Normal 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
|
Loading…
Reference in a new issue