mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
add proxy dnslink adder
This commit is contained in:
parent
99cd5d1ab8
commit
0c54347d4d
2 changed files with 13 additions and 0 deletions
5
ext/mock_redis.rb
Normal file
5
ext/mock_redis.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class MockRedis
|
||||
def publish(channel, message)
|
||||
# TODO make actually useful
|
||||
end
|
||||
end
|
|
@ -730,6 +730,14 @@ class Site < Sequel::Model
|
|||
archives_dataset.where(ipfs_hash: ipfs_hash).first.update updated_at: Time.now
|
||||
end
|
||||
end
|
||||
|
||||
add_redis_proxy_dnslink
|
||||
end
|
||||
|
||||
def add_redis_proxy_dnslink
|
||||
if host =~ /(.+)\.neocities\.org/ && latest_archive
|
||||
$redis_proxy.hset "dns-#{host}", 'TXT', "dnslink=/ipfs/#{latest_archive.ipfs_hash}"
|
||||
end
|
||||
end
|
||||
|
||||
def latest_archive
|
||||
|
|
Loading…
Add table
Reference in a new issue