nirvik / iwant Goto Github PK
View Code? Open in Web Editor NEWCommandline tool for searching and downloading files in LAN network, without any central server
License: MIT License
Commandline tool for searching and downloading files in LAN network, without any central server
License: MIT License
Don't you think log have to go to /var/log rather than ~/.iWant/ ?
Why display the absolute path of the files when doing file search ?
Hi,
What are the security features?
Does it support authentication and encryption?
Cheers,
A joins
A is leader
B joins
B thinks A is the leader
A quits
B announces itself as the winner
Now the problem starts
A joins
A thinks no one is there in the network(this shouldn't happen in the first place) ๐
A announces itself as winner
This leads to a split brain scenario
B gets the message and decides to bully A and sends a FACE OFF message with leader(WL)
A gets the FACE OFF message with WL from B
B announces election and declares itself as the winner
Whereas in A, it never received the new election message.
I started the server and opened a new terminal for searching but its prompting Tracker is not available.
What could have gone wrong??
The local server ends up deleting file entries from .hindex and .pindex located at (/var/log/iwant) and updates the leader.
This happens when a file is removed, created or edited anywhere inside the shared folder. Even though the file entries belong to the folder the user is sharing, the logic of the program ends up deleting those entries.
The file hashes are computed in sequence. To make it faster, it would be better to process the hashes in parallel.
Iwant does not build on clean python3 venv
I checked the code and it seems to be written under python2.
Maybe it would be useful to sepcify it on the readme ?
cheers
Cool idea! Fuse interface when?
use deferToThread and register callbacks for ScanFolder in main.py
When downloading files from a windows machine , the files are stored in the name of their absolute path.
I've attached the log from the server side below.
Issue was noticed on doing the following :
1. Client downloaded a file
2. After download was completed (while server was logging "connecting to 192.168.112.173:1235 for hashdump" ), I deleted the file from the Download directory.
3. All hell broke lose!! Didn't cause the server to crash or anything, but thread exception generated and the thread running fileindexer failed due to KeyError
****** iWanto Download client_search.png **********
Downloading to: /home/adithya/Desktop/iWant/client_search.png
[=============================================================================] 100%
client_search.png downloaded
/home/adithya/Desktop/iWant/client_search.png created
/home/adithya/Desktop/iWant modified
Indexing files in the shared folder ] 0%
[========================================================================] 100%
/home/adithya/Desktop/iWant/client_search.png modified
connecting to 192.168.112.173:1235 for hashdump
connecting to 192.168.112.173:1235 for hashdump
connecting to 192.168.112.173:1235 for hashdump
/home/adithya/Desktop/iWant/client_search.png deleted
Indexing files in the shared folder ] 0%
[========================================================================] 100%
discarding /home/adithya/Desktop/iWant/client_search.png
/home/adithya/Desktop/iWant modified
Indexing files in the shared folder ] 0%
Exception in thread Thread-1: ] 9%
Traceback (most recent call last):
File "/home/adithya/anaconda2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/adithya/.local/lib/python2.7/site-packages/watchdog-0.8.3-py2.7.egg/watchdog/observers/api.py", line 199, in run
self.dispatch_events(self.event_queue, self.timeout)
File "/home/adithya/.local/lib/python2.7/site-packages/watchdog-0.8.3-py2.7.egg/watchdog/observers/api.py", line 368, in dispatch_events
handler.dispatch(event)
File "/home/adithya/.local/lib/python2.7/site-packages/watchdog-0.8.3-py2.7.egg/watchdog/events.py", line 446, in dispatch
self.on_any_event(event)
File "/home/adithya/Desktop/iWant/iWant/iwant/core/engine/monitor/watching.py", line 22, in on_any_event
self.process(event)
File "/home/adithya/Desktop/iWant/iWant/iwant/core/engine/monitor/watching.py", line 29, in process
idx.index()
File "/home/adithya/Desktop/iWant/iWant/iwant/core/engine/fileindexer/findexer.py", line 57, in index
self._create_file_index()
File "/home/adithya/Desktop/iWant/iWant/iwant/core/engine/fileindexer/findexer.py", line 114, in _create_file_index
self.compute_hash_diff_file(destination_file_path)
File "/home/adithya/Desktop/iWant/iWant/iwant/core/engine/fileindexer/findexer.py", line 89, in compute_hash_diff_file
if self.hash_index[md5_checksum][-1] != filesize:
KeyError: '3b7b2a84b8016ac95b625a8ebcebb966'
connecting to 192.168.112.173:1235 for hashdump
file size worth 0.044527 MB downloads partially only ๐
Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner self.run() File "/usr/lib/python2.7/site-packages/watchdog/observers/api.py", line 199, in run self.dispatch_events(self.event_queue, self.timeout) File "/usr/lib/python2.7/site-packages/watchdog/observers/api.py", line 368, in dispatch_events handler.dispatch(event) File "/usr/lib/python2.7/site-packages/watchdog/events.py", line 446, in dispatch self.on_any_event(event) File "build/bdist.linux-x86_64/egg/iwant/watching.py", line 21, in on_any_event self.process(event) File "build/bdist.linux-x86_64/egg/iwant/watching.py", line 26, in process idx = FHIndex.FileHashIndexer(event.src_path) File "build/bdist.linux-x86_64/egg/iwant/filehashIndex/FHIndex.py", line 46, in __init__ self._delete(files) File "build/bdist.linux-x86_64/egg/iwant/filehashIndex/FHIndex.py", line 132, in _delete if self.hash_index[checksum][0] == pathname: KeyError: '4cf2d64e44205fe628ddd534e1151b58'
Shared a folder which has a lot of sub-directories. Created a file inside one of the sub-directories. Then this KeyError is thrown
System: Host: -desktop Kernel: 5.4.0-72-generic i686 bits: 32 compiler: gcc v: 7.5.0
Desktop: Cinnamon 4.4.8 wm: muffin dm: LightDM Distro: Linux Mint 19.3 Tricia
base: Ubuntu 18.04 bionic
Machine: Type: Desktop Mobo: N/A model: 775i65G. serial: BIOS: American Megatrends
v: P3.00 date: 03/20/2007
CPU: Topology: Single Core model: Intel Celeron D bits: 64 type: MCP arch: Netburst Presler
rev: 5 L2 cache: 512 KiB
flags: lm nx pae sse sse2 sse3 bogomips: 6391
Speed: 3196 MHz min/max: N/A Core speed (MHz): 1: 3196
Graphics: Device-1: Intel 82865G Integrated Graphics vendor: ASRock driver: i915 v: kernel
bus ID: 00:02.0 chip ID: 8086:2572
Display: x11 server: X.Org 1.19.6 driver: intel unloaded: fbdev,modesetting,vesa
resolution: 1280x1024~60Hz
OpenGL: renderer: Mesa DRI Intel 865G x86/MMX/SSE2 v: 1.3 Mesa 20.0.8
direct render: Yes
Audio: Device-1: Intel 82801EB/ER AC97 Audio vendor: ASRock driver: snd_intel8x0 v: kernel
bus ID: 00:1f.5 chip ID: 8086:24d5
Sound Server: ALSA v: k5.4.0-72-generic
Network: Device-1: Realtek RTL-8100/8101L/8139 PCI Fast Ethernet Adapter vendor: ASRock
driver: 8139too v: 0.9.28 port: b800 bus ID: 01:05.0 chip ID: 10ec:8139
IF: enp1s5 state: down mac:
Device-2: Ralink RT2870/RT3070 Wireless Adapter type: USB driver: rt2800usb
bus ID: 1-6:3 chip ID: 148f:3070
IF: wlx00c0caacbd2a state: up mac:
IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Drives: Local Storage: total: 931.51 GiB used: 495.32 GiB (53.2%)
ID-1: /dev/sda vendor: Seagate model: ST1000DM003-1CH162 size: 931.51 GiB
speed: serial:
Partition: ID-1: / size: 914.21 GiB used: 494.44 GiB (54.1%) fs: ext4 dev: /dev/dm-1
ID-2: /boot size: 703.5 MiB used: 567.5 MiB (80.7%) fs: ext4 dev: /dev/sda1
ID-3: swap-1 size: 976.0 MiB used: 332.5 MiB (34.1%) fs: swap dev: /dev/dm-2
Sensors: Message: No sensors data was found. Is sensors configured?
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list
1: deb https: //dl.bintray.com/gerbera/gerbera bionic main
Active apt repos in: /etc/apt/sources.list.d/alexlarsson-flatpak-bionic.list
1: deb http: //ppa.launchpad.net/alexlarsson/flatpak/ubuntu bionic main
Active apt repos in: /etc/apt/sources.list.d/metasploit-framework.list
1: deb http: //downloads.metasploit.com/data/releases/metasploit-framework/apt lucid main
Active apt repos in: /etc/apt/sources.list.d/mikhailnov-pulseeffects-bionic.list
1: deb http: //ppa.launchpad.net/mikhailnov/pulseeffects/ubuntu bionic main
Active apt repos in: /etc/apt/sources.list.d/nilarimogard-webupd8-bionic.list
1: deb http: //ppa.launchpad.net/nilarimogard/webupd8/ubuntu bionic main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http: //packages.linuxmint.com tricia main upstream import backport #id:linuxmint_main
2: deb http: //archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
3: deb http: //archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
4: deb http: //archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
6: deb http: //archive.canonical.com/ubuntu/ bionic partner
Info: Processes: 208 Uptime: 20h 45m Memory: 1.95 GiB used: 1.26 GiB (64.5%) Init: systemd
v: 237 runlevel: 5 Compilers: gcc: 7.5.0 alt: 7 Client: Unknown python3.6 client
inxi: 3.0.32
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-QZNK6v/watchdog/
Rather than logging to a file , we are just printing information on the screen. That's utterly useless.
Empty code snippets observed for MAC.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.