mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fixes for ipfs archiving
This commit is contained in:
parent
115580a18d
commit
2f7f5a5467
1 changed files with 3 additions and 5 deletions
|
@ -667,7 +667,7 @@ class Site < Sequel::Model
|
||||||
purge_cache path
|
purge_cache path
|
||||||
end
|
end
|
||||||
|
|
||||||
Rye::Cmd.add_command :ipfs, nil, 'add', :r
|
Rye::Cmd.add_command :ipfs, nil, 'add', :r, :Q
|
||||||
|
|
||||||
def add_to_ipfs
|
def add_to_ipfs
|
||||||
# Not ideal. An SoA version is in progress.
|
# Not ideal. An SoA version is in progress.
|
||||||
|
@ -680,17 +680,15 @@ class Site < Sequel::Model
|
||||||
rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user']
|
rbox = Rye::Box.new $config['ipfs_ssh_host'], :user => $config['ipfs_ssh_user']
|
||||||
begin
|
begin
|
||||||
response = rbox.ipfs "sites/#{self.class.sharding_dir self.username}/#{self.username.gsub(/\/|\.\./, '')}"
|
response = rbox.ipfs "sites/#{self.class.sharding_dir self.username}/#{self.username.gsub(/\/|\.\./, '')}"
|
||||||
output_array = response
|
|
||||||
ensure
|
ensure
|
||||||
rbox.disconnect
|
rbox.disconnect
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
line = Cocaine::CommandLine.new('ipfs', 'add -r :path')
|
line = Cocaine::CommandLine.new('ipfs', 'add -r -Q :path')
|
||||||
response = line.run path: files_path
|
response = line.run path: files_path
|
||||||
output_array = response.to_s.split("\n")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
output_array.last.split(' ')[1]
|
response.first
|
||||||
end
|
end
|
||||||
|
|
||||||
def purge_old_archives
|
def purge_old_archives
|
||||||
|
|
Loading…
Add table
Reference in a new issue