tcpfiletransfer 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/sendfile +6 -4
- data/lib/filetransfer/httpserver.rb +5 -0
- data/lib/filetransfer/notifier.rb +1 -1
- data/lib/filetransfer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e05f1f2443f8672ad35b72d470ebaee0c906cf686d9e94fb010757d1d62dcb42
|
4
|
+
data.tar.gz: af5dcbb81340ddc9794f94c64401adccaba2fe0d2c39666016adb01d979c6644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adc96bd9d1709741b31603b6874f61028ccb92b032dc0b4351fc010c00974adeb0138d3ea0111c29c904225a711460f3673568ef156c93abed835ea846b4960b
|
7
|
+
data.tar.gz: bb99ab26bca1a85e3d760cbcc63a47f2fe1d6f3c41d8763c2f603d0b79762968f361bb472e0f7fb48c4be6167793220644c233d14675cf273f9ee80240ba745f
|
data/bin/sendfile
CHANGED
@@ -10,13 +10,15 @@ name = originalpath.split("/").last.gsub(" ", "_")
|
|
10
10
|
|
11
11
|
recipient = ""
|
12
12
|
loop do
|
13
|
-
recipient = ARGV[1] || `zenity --text="Recipient\\n(Leave blank to
|
13
|
+
recipient = ARGV[1] || `zenity --text="Recipient\\n(Leave blank to search for available recipients)" --entry --title='Send File'`.chomp
|
14
14
|
exit(1) if $?.exitstatus == 1
|
15
15
|
|
16
16
|
if recipient == ""
|
17
|
-
`
|
18
|
-
hosts =
|
19
|
-
`zenity --
|
17
|
+
`nmap -Pn -p8021 --open 192.168.0.0/24 | grep -oP '([\\w-]+\\s\\(((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}\\)|((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4})' | tee ~/.tmphosts | zenity --progress --pulsate --no-cancel --text="Searcing for available devices" --title="Searching..." --auto-close`
|
18
|
+
hosts = File.read("#{Dir.home}/.tmphosts")
|
19
|
+
recipient = `zenity --list --title="Avalable recipients" --text="Choose a device" --column="Available Recipients" #{hosts.split("\n").map{|h|"'#{h}'"}.join(" ")}`.match(/((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}/).to_s
|
20
|
+
break if recipient != ""
|
21
|
+
exit(1) if $?.exitstatus == 1
|
20
22
|
else
|
21
23
|
break
|
22
24
|
end
|
@@ -4,7 +4,10 @@ module FileTransfer
|
|
4
4
|
path = initdata[1].split("/")
|
5
5
|
decline = (path[2] == "decline")
|
6
6
|
path = ?/ + path[1]
|
7
|
+
sock_domain, remote_port, remote_hostname, remote_ip = client.peeraddr
|
8
|
+
|
7
9
|
if decline
|
10
|
+
`zenity --error --title="Transfer Declined" --text="Your transfer to #{remote_hostname} has been declined." --no-wrap`
|
8
11
|
$active_transfers.delete(path)
|
9
12
|
client.puts "HTTP/1.0 200\r\nContent-Type: text/plain\r\n\r\nTransfer declined"
|
10
13
|
client.close
|
@@ -23,6 +26,8 @@ module FileTransfer
|
|
23
26
|
client.close
|
24
27
|
return
|
25
28
|
end
|
29
|
+
|
30
|
+
`zenity --info --title="Transfer Accepted" --text="Your transfer to #{remote_hostname} has been accepted." --no-wrap`
|
26
31
|
client.puts "HTTP/1.0 200\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename=\"#{file[:name]}\"\r\n\r\n#{File.read(file[:path])}"
|
27
32
|
$active_transfers.delete(path)
|
28
33
|
client.close
|
@@ -9,7 +9,7 @@ module FileTransfer
|
|
9
9
|
|
10
10
|
x=system("zenity --question --icon-name=document-save-symbolic.symbolic --no-wrap --text=\"#{notification_body}\" --title='#{notification_title}'")
|
11
11
|
if x
|
12
|
-
file_location = `zenity --file-selection --save --filename=#{filename}
|
12
|
+
file_location = `zenity --title="Save file" --file-selection --save --filename=#{filename.chomp}`.chomp
|
13
13
|
if file_location == ""
|
14
14
|
f=open(accept_link + "/decline")
|
15
15
|
f.read
|
data/lib/filetransfer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcpfiletransfer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An easy way to transfer files over TCP between linux computers
|
14
14
|
email: matthias@matthiasclee.com
|