emesene forum
February 08, 2010, 04:55:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: REPORT ANY ISSUE HERE - PLEASE CHECK IF THE PROBLEM HAS ALREADY BEEN REPORTED FIRST -- THANKS
 
  Home   Forum   Help Search Login Register  
Pages: [1] 2 3 ... 6
  Print  
Author Topic: [NEW] WebSender: send your files fast & easily!  (Read 11283 times)
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« on: August 29, 2008, 07:07:49 AM »

Hi all, "inspired" by this topichttp://emesene.org/smf/index.php/topic,1486.0.html , I wrote a plugin that runs a basic webserver and send files through it, sending a link in chat.
It's available from emesene-plugins, and it's still far from complete, but it should be decently usable.

Features:
* Opens a webserver on a custom port
* Puts a "websend" button on the conversation toolbar: it's like the normal send, but it will send a link to the contact you are talking to
* Or, if you prefer, you can use "/websend /path/of/the/file"
* The link are randomly generated, so only you and the right person can get that file (privacy is reasonably ok)
* It SHOULD be very fast
* The transfer continues normally even if you close the conversation (but it doesn't if you close emesene)
* You can _receive_ files using the websend button and then clicking "offer for receiving" (Aug 31th)

TODO:
* resume will be great, but I know nothing of http: can someone help me?
* saving downloads so that they can use (and resume) them even after you close emesene
« Last Edit: August 31, 2008, 08:24:07 AM by boyska » Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #1 on: August 29, 2008, 08:51:52 AM »

Not working for me, it makes my emesene freeze.
I will post more debug soon.
emesene trunk (msnp15) here
Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #2 on: August 29, 2008, 09:16:31 AM »

Quote
Not working for me, it makes my emesene freeze.
mmm very strange, seems to be a thread+gtk problem, but I don't use gtk inside a thread.
try to update, I did some commits already

Quote
I will post more debug soon.
thanks, it will be really useful. The main info I need are:
* does it freezy immediately or when you do X?
* of course, logs

PS: I'm working on the receiver part Wink but of course bugfixing has an higher priority!
Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #3 on: August 31, 2008, 08:18:11 AM »

1. I worked on the "receiver" part: now, if you get to yo.ur.i.p:port/send  you'll get an upload form.
So, simply click on that horrible "WebSend" button (yes, I need to choose an icon) and you'll get a filechooser with an extra button "offer for receiving": clicking on them, the upload URL will be sent in conversation, so that you can easily receive files.

2. Previously, we were using www.whatismyip.org to get our IP. I couldn't find a way to get our IP without using an external site, but I created a lists of sites we can fetch this information from. In case the first fails, we'll try the second and so on. ATM there are 3 sites, of course we can add others. (I use a simple regexp that matches an IP, so simple html page are ok. I prefer not to use overloaded ones, like this: http://whatismyipaddress.com/ )

3. Now urls aren't increasing ID, but randomly generated 6-chars strings like U7aFG2  in this way, your friends can't try every number, trying to get files you sent to someone else (Privacy)

Everything has already been commited, you just need to update that
Logged
Cruster
Full Member
***

l33tness: 5
Offline Offline

Posts: 24


View Profile
« Reply #4 on: September 01, 2008, 07:39:42 AM »

About the ip thing try to use http://checkip.dyndns.org it's the less loaded website I know...
Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #5 on: September 01, 2008, 07:52:09 AM »

About the ip thing try to use http://checkip.dyndns.org it's the less loaded website I know...
already using that Wink thank you for your suggestion
Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #6 on: September 01, 2008, 10:10:38 AM »

Ok, sorry if I was late, I was busy last days.
Now, I tried websender with debug activated and I got this behaviours:
In plugin manager window, clicking "refresh" after loading the plugin, makes it uncheck, and it is impossible to use again that port.
Code:
WebSender: problem when initializing server
response -5 <enum GTK_RESPONSE_OK of type GtkResponseType>
dialog returned: 8499.0
new port:  8499.0
[Do we need to open the ports we're using or it makes it automatically?]

Activating the plugin with a conversation already opened, doesn't make the button appear, and closing the window recalls an exception:
Code:
Exception
You are using emesene trunk, so don't complain
Traceback (most recent call last):

  File "/home/makko210/.config/emesene1.0/pluginsEmesene/WebSender.py", line 403, in remove_button
    button = self.buttons[conversation]

KeyError: <Conversation object at 0x903f694 (Conversation+Conversation at 0x8f351c0)>

Reopening the conversation, the button appears, but the toolbar is now weird: all the buttons have a lot of space between them. I don't know if this is normal, just reporting.

Now, sending, the dialog is opened, and I can select a file, BUT now it freezes everything works fine, while first time I tried it freezed.
If this happens again I will try to catch debug code.

Even receiving seems to work.

Nice work buddy Smiley



Uh, another thing, with a simple script in python, you can easily extract IP from "ifconfig", not using external sites, why don't you use it?

Update: receiving works like a charm, while sending doesn't work, and an exception is shown in console:
Code:
Exception happened during processing of request from ('ip.ip.ip.ip', port)
Traceback (most recent call last):
  File "/usr/lib/python2.5/SocketServer.py", line 222, in handle_request
    self.process_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 241, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
  File "/home/makko210/.config/emesene1.0/pluginsEmesene/WebSender.py", line 142, in do_GET
    file_to_send = open(self.server.files[self.path[1:]])
TypeError: coercing to Unicode: need string or buffer, NoneType found
« Last Edit: September 01, 2008, 10:47:03 AM by Miles_Teg » Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #7 on: September 01, 2008, 11:32:47 AM »

Ok, sorry if I was late, I was busy last days.
no problem, I have to thank you!
Quote
Now, I tried websender with debug activated and I got this behaviours:
In plugin manager window, clicking "refresh" after loading the plugin, makes it uncheck, and it is impossible to use again that port.
That's because I don't know if there is a way to "free" that port: I know it's odd, it IS a bug.
Quote
[Do we need to open the ports we're using or it makes it automatically?]
you have to open them

Quote
Activating the plugin with a conversation already opened, doesn't make the button appear, and closing the window recalls an exception:
uh, thanks. I'll work on it
Quote
Reopening the conversation, the button appears, but the toolbar is now weird: all the buttons have a lot of space between them. I don't know if this is normal, just reporting.
That's because I'm not using an Icon, but a text, and the toolbar has a weird configuration.

Quote
Now, sending, the dialog is opened, and I can select a file, BUT now it freezes everything works fine, while first time I tried it freezed.
If this happens again I will try to catch debug code.
I hope it'll never happen Tongue

Quote
Even receiving seems to work.

Nice work buddy Smiley
thank you Cheesy

Quote
Uh, another thing, with a simple script in python, you can easily extract IP from "ifconfig", not using external sites, why don't you use it?
1. because ifconfig is linux-only
2. because it's not the public address. If you are behind a router, it's wrong.

Quote
Update: receiving works like a charm, while sending doesn't work, and an exception is shown in console:
[ snip ]
uh, this is a unicode bug. WIll work on this, but can you help me reproducing the bug? What was the filename? Has it "special" characters?

Thank you again, you have been great in bugreporting Wink
Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #8 on: September 01, 2008, 01:44:25 PM »

Quote
[Do we need to open the ports we're using or it makes it automatically?]
you have to open them
What a nice feature would be opening them using the plugin.
Well, I know it would be too OS-dependent, what a pity...

Quote
Citazione
Uh, another thing, with a simple script in python, you can easily extract IP from "ifconfig", not using external sites, why don't you use it?
1. because ifconfig is linux-only
2. because it's not the public address. If you are behind a router, it's wrong.
Uh, now I get it. Number two is a strong motivation, I guess Smiley

Quote
Update: receiving works like a charm, while sending doesn't work, and an exception is shown in console:
[ snip ]
uh, this is a unicode bug. WIll work on this, but can you help me reproducing the bug? What was the filename? Has it "special" characters?
not at all, "Heraldic.eps"
Quote
Thank you again, you have been great in bugreporting  Wink
One is happy to help (semiquote)  Grin

Well I guess I found another bug...really strange, though: the port I opened and I set is 8499, but file is sent through 8564, which shows up even setting again the port in configuration...tomorrow I will give you debug Smiley
Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #9 on: September 02, 2008, 02:15:38 AM »

Quote
[Do we need to open the ports we're using or it makes it automatically?]
you have to open them
What a nice feature would be opening them using the plugin.
Well, I know it would be too OS-dependent, what a pity...
It would not just be OS-dependent, but even firewall-dependent. I listened of UPnP, but I can't remember if this is exactly what we need.

Quote
Quote
Citazione
Uh, another thing, with a simple script in python, you can easily extract IP from "ifconfig", not using external sites, why don't you use it?
1. because ifconfig is linux-only
2. because it's not the public address. If you are behind a router, it's wrong.
Uh, now I get it. Number two is a strong motivation, I guess Smiley
yes Smiley
Quote
Quote
uh, this is a unicode bug. WIll work on this, but can you help me reproducing the bug? What was the filename? Has it "special" characters?
not at all, "Heraldic.eps"
O_O well, I'll try to reproduce this

Quote
Quote
Thank you again, you have been great in bugreporting  Wink
One is happy to help (semiquote)  Grin
Haven't understood the quotation, but it's fine Cheesy

Quote
Well I guess I found another bug...really strange, though: the port I opened and I set is 8499, but file is sent through 8564, which shows up even setting again the port in configuration...tomorrow I will give you debug Smiley
Oh god, how many bugs!
Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #10 on: September 02, 2008, 03:27:57 AM »

Quote
Oh god, how many bugs!
Yours is a young plugin, of course it needs some time to improve Wink

Suggestion/Question: would it be possible to choose the directory of download?
Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #11 on: September 02, 2008, 04:19:05 AM »

Quote
Oh god, how many bugs!
Yours is a young plugin, of course it needs some time to improve Wink
Of course, but I'm known on IRC as the bug-creator guy! (due to lots of bugs during the refactoring of PluginManager)

Quote
Suggestion/Question: would it be possible to choose the directory of download?
ATM it's a folder inside your default download folder, but I was thinking about the same thing.
My idea was to use URL like yo.ur.i.p:port/send/user@hotmail.it
This way, the file you are uploading will be put in the right folder.
The bad thing about this is that someone could fill up your downloads directory of other directories he created.
This shouldn't be so much a problem, anyway.

So, my current TODO is:
* Bugfixing!
* Custom folder thing
* Notify when someone has sent you a file/he has received a file/etc
* Resume
Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #12 on: September 02, 2008, 07:12:41 AM »

Again that exception, and this time with another file:
Code:
Exception happened during processing of request from ('ip.ip.ip.ip', port)
Traceback (most recent call last):
  File "/usr/lib/python2.5/SocketServer.py", line 222, in handle_request
    self.process_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 241, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
  File "/home/makko210/.config/emesene1.0/pluginsEmesene/WebSender.py", line 142, in do_GET
    print self.server.files[self.path[1:]]
TypeError: coercing to Unicode: need string or buffer, NoneType found

Now I'm thinking that this could be a problem with Fluxbox, which already gave me problems with unicode/UTF-8 etc...
could it be?

Add to TODO list: multi-transfer (enable selecting multiple files to send/receive) Wink

Uh, and that bug about the port that is not changed...doesn't print any code in console, so...no debug Undecided
« Last Edit: September 02, 2008, 07:20:29 AM by Miles_Teg » Logged
boyska
Hero Member
*****

l33tness: 13
Offline Offline

Posts: 300


winston89@fastwebnet.it
View Profile
« Reply #13 on: September 02, 2008, 07:21:01 AM »

Quote
Now I'm thinking that this could be a problem with Fluxbox, which already gave me problems with unicode/UTF-8 etc...
could it be?
no, I easily reproduced that bug and I've already solved & commited it Wink
I solved the other bug (that about already opened conversations), too.
Enjoy!
Logged
Miles_Teg
Hero Member
*****

l33tness: 8
Offline Offline

Posts: 495


View Profile
« Reply #14 on: September 02, 2008, 09:28:48 AM »

Ok, I tried and I can send that file now, the bug has gone, great  Cheesy

An improvement: my contact couldn't see any information about the file that I was sending (a part, I guess, from the name), so she couldn't see any progress bar using the download manager because there was no file size info...
maybe you have to improve this part, or maybe this is a bug...don't know Smiley
Logged
Pages: [1] 2 3 ... 6
  Print  
 
Jump to:  

TinyPortal v.1.0.6 beta 2 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!