13 years agoAdd an option to not error out when only a local IP address can be found.
Cameron Dale [Tue, 15 Jan 2008 22:36:19 +0000 (14:36 -0800)]
Add an option to not error out when only a local IP address can be found.

13 years agoScanning cache directories on startup waits for DHT storeValue to return.
Cameron Dale [Tue, 15 Jan 2008 22:08:14 +0000 (14:08 -0800)]
Scanning cache directories on startup waits for DHT storeValue to return.

This slows down the scanning a lot, but is more consistent for adding
values to the DHT (prevents flooding).

13 years agoLookup the hash in the cache database.
Cameron Dale [Tue, 15 Jan 2008 07:40:21 +0000 (23:40 -0800)]
Lookup the hash in the cache database.

If it's found, return that file.

Still need to implement copying the file to the cache if it's
not in there already (compare directory to cache_dir variable).

13 years agoAdded scanning of other directories for cached packages.
Cameron Dale [Tue, 15 Jan 2008 06:28:26 +0000 (22:28 -0800)]
Added scanning of other directories for cached packages.

13 years agoCacheManager scans the cache directory during initialization.
Cameron Dale [Tue, 15 Jan 2008 05:55:22 +0000 (21:55 -0800)]
CacheManager scans the cache directory during initialization.

Actually the scanning is done after a successful join so that
files can be added to the DHT.

The HashObjects can now hash a file in a separate thread.

The donwload cache is scanned for new files too, causing the
decompressed versions of compressed Packages files to be
hashed and added to the DHT. This isn't currently consistent
since they are not added when they are first downloaded
and decompressed.

13 years agoRemove a completed TODO item.
Cameron Dale [Tue, 15 Jan 2008 01:29:38 +0000 (17:29 -0800)]
Remove a completed TODO item.

13 years agoRemove the mirror name from the shared HTTP directory.
Cameron Dale [Mon, 14 Jan 2008 07:24:39 +0000 (23:24 -0800)]
Remove the mirror name from the shared HTTP directory.

13 years agoReset the HTTPServer subdirectories when a new cache directory is created.
Cameron Dale [Mon, 14 Jan 2008 06:58:46 +0000 (22:58 -0800)]
Reset the HTTPServer subdirectories when a new cache directory is created.

13 years agoUse FilePath everywhere and create new CacheManager module.
Cameron Dale [Mon, 14 Jan 2008 06:49:16 +0000 (22:49 -0800)]
Use FilePath everywhere and create new CacheManager module.

All cache related things moved from MirrorManager to the new

13 years agokhashmir's store value takes the origination date.
Cameron Dale [Sun, 13 Jan 2008 22:02:59 +0000 (14:02 -0800)]
khashmir's store value takes the origination date.

13 years agoAdd the ability to bencode datetime values.
Cameron Dale [Sun, 13 Jan 2008 21:49:27 +0000 (13:49 -0800)]
Add the ability to bencode datetime values.

13 years agobencode module now uses new BencodeError instead of ValueError.
Cameron Dale [Sun, 13 Jan 2008 21:11:44 +0000 (13:11 -0800)]
bencode module now uses new BencodeError instead of ValueError.

13 years agoAdded unittests to bencode module for boolean and unicode types.
Cameron Dale [Sun, 13 Jan 2008 21:05:21 +0000 (13:05 -0800)]
Added unittests to bencode module for boolean and unicode types.

13 years agoChanged bencode's test functions to trial unittests.
Cameron Dale [Sun, 13 Jan 2008 20:55:23 +0000 (12:55 -0800)]
Changed bencode's test functions to trial unittests.

13 years agoConvert the new bencode module to use apt-dht logging.
Cameron Dale [Sun, 13 Jan 2008 19:38:17 +0000 (11:38 -0800)]
Convert the new bencode module to use apt-dht logging.

13 years agoCopied the more advanced bencode module from DebTorrent.
Cameron Dale [Sun, 13 Jan 2008 19:19:04 +0000 (11:19 -0800)]
Copied the more advanced bencode module from DebTorrent.

13 years agoMove the main util functions to the new main util module.
Cameron Dale [Sat, 12 Jan 2008 19:28:13 +0000 (11:28 -0800)]
Move the main util functions to the new main util module.

13 years agoMoved the finding IP address function to the util module.
Cameron Dale [Sat, 12 Jan 2008 18:16:32 +0000 (10:16 -0800)]
Moved the finding IP address function to the util module.

13 years agoUse the new DB in the main code.
Cameron Dale [Sat, 12 Jan 2008 18:06:11 +0000 (10:06 -0800)]
Use the new DB in the main code.

13 years agoHTTPServer now gets it's dictionary of subdirectories externally.
Cameron Dale [Sat, 12 Jan 2008 17:53:38 +0000 (09:53 -0800)]
HTTPServer now gets it's dictionary of subdirectories externally.

13 years agoMade the main DB track url top-level directories.
Cameron Dale [Sat, 12 Jan 2008 08:34:48 +0000 (00:34 -0800)]
Made the main DB track url top-level directories.

Need to change HTTPServer to use the DB, and the main code as

Don't forget to call reconcileDirectories periodically and
then if changed update the HTTPServer's directories.

13 years agoMain database finished for now, including unittests.
Cameron Dale [Sat, 12 Jan 2008 04:14:53 +0000 (20:14 -0800)]
Main database finished for now, including unittests.

13 years agoAdded new database module for the main code.
Cameron Dale [Sat, 12 Jan 2008 00:44:38 +0000 (16:44 -0800)]
Added new database module for the main code.

Still needs more functions, and the unittests are just
copied from khashmir's database.

13 years agoMake khashmir's db backwards compatible to pysqlite 2.0.x
Cameron Dale [Fri, 11 Jan 2008 22:58:18 +0000 (14:58 -0800)]
Make khashmir's db backwards compatible to pysqlite 2.0.x

13 years agoUpgrade the security in khashmir by using longer TIDs.
Cameron Dale [Fri, 11 Jan 2008 18:51:32 +0000 (10:51 -0800)]
Upgrade the security in khashmir by using longer TIDs.

13 years agoAdded some things to do for the future.
Cameron Dale [Fri, 11 Jan 2008 04:49:48 +0000 (20:49 -0800)]
Added some things to do for the future.

13 years agoWhen peer downloads fail, try direct downloads.
Cameron Dale [Fri, 11 Jan 2008 04:34:21 +0000 (20:34 -0800)]
When peer downloads fail, try direct downloads.

Also don't cache failed download results, just return them.

13 years agoAdds downloaded hashed files to the DHT.
Cameron Dale [Fri, 11 Jan 2008 03:53:47 +0000 (19:53 -0800)]
Adds downloaded hashed files to the DHT.

13 years agoAdded complicated testing to find our IP address.
Cameron Dale [Fri, 11 Jan 2008 03:31:06 +0000 (19:31 -0800)]
Added complicated testing to find our IP address.

13 years agoNew DHT method 'join' like 'ping' but returns our IP and port.
Cameron Dale [Fri, 11 Jan 2008 01:07:23 +0000 (17:07 -0800)]
New DHT method 'join' like 'ping' but returns our IP and port.

13 years agoMake downloaded files accessible via the HTTP server.
Cameron Dale [Fri, 11 Jan 2008 00:40:23 +0000 (16:40 -0800)]
Make downloaded files accessible via the HTTP server.

MirrorManager calls back to the main code, which adds an
appropriate ~ (tilde) directory to the web server.

13 years agoFixed the storage of binary strings in the database.
Cameron Dale [Thu, 10 Jan 2008 23:47:43 +0000 (15:47 -0800)]
Fixed the storage of binary strings in the database.

Errors were caused when a string stored in the database had
a NUL character in it. Now the DB uses base64 encoding for
all hash values, with automatic conversion using adapters
and converters.

Also added some unittests to the DB.

13 years agoUse function for sending krpc responses, and add spew parameter.
Cameron Dale [Thu, 10 Jan 2008 20:45:04 +0000 (12:45 -0800)]
Use function for sending krpc responses, and add spew parameter.

Sending a response in the krpc module now calls a function.

There is a new 'SPEW' config variable that causes the krpc
module to spew out all sent and received packet data
(previously called noisy).

Also changed all the tests to use failUnlessEqual instead
of assertEqual, and all assert() commands no longer use

Updated some of the downloading tests for the new file sizes
on camrdale.org (need a better solution here).

13 years agoFixed some bugs in the new hashing scheme and tests.
Cameron Dale [Thu, 10 Jan 2008 07:07:24 +0000 (23:07 -0800)]
Fixed some bugs in the new hashing scheme and tests.

13 years agoPass the new HashObjects around everywhere (untested).
Cameron Dale [Thu, 10 Jan 2008 00:54:20 +0000 (16:54 -0800)]
Pass the new HashObjects around everywhere (untested).

13 years agoModified the HashObject to do dummy hashing if the hash has already been verified.
Cameron Dale [Thu, 10 Jan 2008 00:53:34 +0000 (16:53 -0800)]
Modified the HashObject to do dummy hashing if the hash has already been verified.

13 years agoAdded a new Hash Object for tracking lots of hash details.
Cameron Dale [Thu, 10 Jan 2008 00:15:32 +0000 (16:15 -0800)]
Added a new Hash Object for tracking lots of hash details.

13 years agoAdded more debug printing to noisy krpc protocol.
Cameron Dale [Wed, 9 Jan 2008 05:49:34 +0000 (21:49 -0800)]
Added more debug printing to noisy krpc protocol.

13 years agoProxyFileStream also calculates hash while downloading.
Cameron Dale [Wed, 9 Jan 2008 05:47:48 +0000 (21:47 -0800)]
ProxyFileStream also calculates hash while downloading.

Needs a better implementation with a HashObject type.

13 years agoMake the MultiDHT test_store work for large number of nodes.
Cameron Dale [Wed, 9 Jan 2008 04:45:21 +0000 (20:45 -0800)]
Make the MultiDHT test_store work for large number of nodes.

It generated errors before as all the requests for get/store
were sent out simultaneously, and some got lost (probably due
to network queue lengths). Instead, send each request and
wait for it to complete.

13 years agoImprove the creation of nodes and move all to the main khashmir class.
Cameron Dale [Wed, 9 Jan 2008 03:11:59 +0000 (19:11 -0800)]
Improve the creation of nodes and move all to the main khashmir class.

Nodes are now initialized with their id, host and port
(optionally stored in a dict) instead of needing 2 steps.

All other classes now call the main khashmir Node() constructor
which adds the udp connection and table.

Previous actions that called insertNode on the table now
call it on the main khashmir class, so that if buckets are
full they can have a chance of being added.

13 years agoImprove the stopping of the krpc protocol so no timeouts are left.
Cameron Dale [Wed, 9 Jan 2008 03:08:21 +0000 (19:08 -0800)]
Improve the stopping of the krpc protocol so no timeouts are left.

13 years agoAvoid repetition, use a function for updating nodes when they contact us.
Cameron Dale [Tue, 8 Jan 2008 23:08:18 +0000 (15:08 -0800)]
Avoid repetition, use a function for updating nodes when they contact us.

13 years agoSwitch from the time module to the datetime module.
Cameron Dale [Tue, 8 Jan 2008 22:48:21 +0000 (14:48 -0800)]
Switch from the time module to the datetime module.

13 years agoUpgrade pysqlite from 1.0 to 2.x (now uses sqlite3).
Cameron Dale [Tue, 8 Jan 2008 21:40:44 +0000 (13:40 -0800)]
Upgrade pysqlite from 1.0 to 2.x (now uses sqlite3).

13 years agoNo need to look at the DEFAULT section when parsing the config.
Cameron Dale [Tue, 8 Jan 2008 20:38:58 +0000 (12:38 -0800)]
No need to look at the DEFAULT section when parsing the config.

13 years agoAdd back the updatedFile method to the MirrorManager.
Cameron Dale [Tue, 8 Jan 2008 20:38:18 +0000 (12:38 -0800)]
Add back the updatedFile method to the MirrorManager.

13 years agoMove all the khashmir database operations to a separate module.
Cameron Dale [Tue, 8 Jan 2008 20:33:18 +0000 (12:33 -0800)]
Move all the khashmir database operations to a separate module.

13 years agoMove the translating of hashes from hex into the MirrorManager.
Cameron Dale [Mon, 7 Jan 2008 19:37:41 +0000 (11:37 -0800)]
Move the translating of hashes from hex into the MirrorManager.

13 years agoDHT normalizes key lengths by chopping or adding 0.
Cameron Dale [Mon, 7 Jan 2008 19:28:14 +0000 (11:28 -0800)]
DHT normalizes key lengths by chopping or adding 0.

13 years agoDecompress needed files while downloading them.
Cameron Dale [Mon, 7 Jan 2008 08:00:57 +0000 (00:00 -0800)]
Decompress needed files while downloading them.

Decompress the files so they can be tracked by AptPackages
and used to generate hashes.

13 years agoCall the AptPackages file_updated when files complete downloading.
Cameron Dale [Mon, 7 Jan 2008 05:10:21 +0000 (21:10 -0800)]
Call the AptPackages file_updated when files complete downloading.

Added a defer to the strem proxy to file to facilitate.
Moved the modtime updating out of the proxy as it makes
more sense to do it in the MirrorManager.

13 years agoFix an error that occurred when there were no Sources in AptPackages.
Cameron Dale [Mon, 7 Jan 2008 05:08:17 +0000 (21:08 -0800)]
Fix an error that occurred when there were no Sources in AptPackages.

Also add an errback to the findHash call to trap future errors.

13 years agoUnhexify the returned hashes from the AptPackages lookup.
Cameron Dale [Mon, 7 Jan 2008 05:06:48 +0000 (21:06 -0800)]
Unhexify the returned hashes from the AptPackages lookup.

13 years agoAdded modification time tracking to the MirrorManager cache.
Cameron Dale [Mon, 7 Jan 2008 04:20:09 +0000 (20:20 -0800)]
Added modification time tracking to the MirrorManager cache.

Had to switch the HTTPServer to use renderHTTP() instead of
render() so that the last-modified HTTP header would be set.

13 years agoAdded caching of downloaded files to the MirrorManager.
Cameron Dale [Mon, 7 Jan 2008 02:55:31 +0000 (18:55 -0800)]
Added caching of downloaded files to the MirrorManager.

Also made the MirrorManager work with full URLs (http://...).
Also added some log messages to the HTTPDownloader.

13 years agoLots of log messages and blocked non-local access to server.
Cameron Dale [Fri, 4 Jan 2008 02:58:53 +0000 (18:58 -0800)]
Lots of log messages and blocked non-local access to server.

Remote peers can still access the shared files, but not make
requests that result in lookups or see the stats.

Also fixed a bug in the main findHash routines.
Also changed to use splitHostPort rather than manual splitting.

13 years agoMade the DHT bootstrapping use IPs instead of DNS names.
Cameron Dale [Fri, 4 Jan 2008 01:43:14 +0000 (17:43 -0800)]
Made the DHT bootstrapping use IPs instead of DNS names.

Also added some logging messages.
Also fixed a problem that caused the application to be loaded twice.

13 years agoMove all url parsing into the PeerManager.
Cameron Dale [Fri, 4 Jan 2008 00:01:38 +0000 (16:01 -0800)]
Move all url parsing into the PeerManager.

Also added a lookupHash_done function to the main code.

13 years agoFixed some minor bugs.
Cameron Dale [Thu, 3 Jan 2008 23:51:22 +0000 (15:51 -0800)]
Fixed some minor bugs.

13 years agoMade the get and storeValue DHT functions work.
Cameron Dale [Thu, 3 Jan 2008 02:06:46 +0000 (18:06 -0800)]
Made the get and storeValue DHT functions work.

Also added tests for them.
Had to modify the callback from khashmir's get and storeValue functions
to include the key, and the key and value, respectively so multiple
calls can be tracked.

13 years agoUpdated the DHT join and leave to check if a join is in progress.
Cameron Dale [Wed, 2 Jan 2008 21:52:59 +0000 (13:52 -0800)]
Updated the DHT join and leave to check if a join is in progress.

13 years agoMade the DHT join method work and added tests for it.
Cameron Dale [Wed, 2 Jan 2008 21:45:40 +0000 (13:45 -0800)]
Made the DHT join method work and added tests for it.

13 years agoAdded a shutdown method to the khasmir DHT.
Cameron Dale [Wed, 2 Jan 2008 19:48:37 +0000 (11:48 -0800)]
Added a shutdown method to the khasmir DHT.

13 years agoAdd timeouts to some unittests.
Cameron [Mon, 24 Dec 2007 22:42:08 +0000 (14:42 -0800)]
Add timeouts to some unittests.

13 years agoFixed 2 broken AptPackages unittests.
Cameron [Mon, 24 Dec 2007 22:37:01 +0000 (14:37 -0800)]
Fixed 2 broken AptPackages unittests.

13 years agoDisable the deprecation warning for the khashmir tests.
Cameron Dale [Fri, 21 Dec 2007 03:52:43 +0000 (19:52 -0800)]
Disable the deprecation warning for the khashmir tests.

Need to rewrite the khashmir main functions to use Deferreds
or something.

13 years agoChange all unittests to use twisted's trial.
Cameron Dale [Fri, 21 Dec 2007 03:43:25 +0000 (19:43 -0800)]
Change all unittests to use twisted's trial.

Merge separate "test_*.py" files into their modules.

13 years agoModify khashmir's config system to not use the const module.
Cameron Dale [Fri, 21 Dec 2007 01:54:53 +0000 (17:54 -0800)]
Modify khashmir's config system to not use the const module.

Configuration variables are all passed in as a dictionary where needed.
The NULL_ID config option has been made a constant.
The ConfigParser now stores all keys as upper case.

13 years agoAdd more to khashmir's DHT implementation.
Cameron Dale [Wed, 19 Dec 2007 21:48:25 +0000 (13:48 -0800)]
Add more to khashmir's DHT implementation.

Still needs a massive rewrite for loading config values properly.

13 years agoAdd a MirrorError exception.
Cameron [Wed, 19 Dec 2007 00:24:57 +0000 (16:24 -0800)]
Add a MirrorError exception.

Fixes the deprecated use of calling errback with a string.

13 years agoUpdate all tests to add the deferred as both errback and callback.
Cameron [Wed, 19 Dec 2007 00:17:17 +0000 (16:17 -0800)]
Update all tests to add the deferred as both errback and callback.

13 years agoFix the MirrorManager tests to be dist-agnostic too.
Cameron [Wed, 19 Dec 2007 00:06:32 +0000 (16:06 -0800)]
Fix the MirrorManager tests to be dist-agnostic too.

13 years agoFix some broken AptPackages tests.
Cameron [Wed, 19 Dec 2007 00:01:06 +0000 (16:01 -0800)]
Fix some broken AptPackages tests.

13 years agoMade the AptPackages tests dist-agnostic so it works with Ubuntu.
Cameron [Tue, 18 Dec 2007 23:39:44 +0000 (15:39 -0800)]
Made the AptPackages tests dist-agnostic so it works with Ubuntu.

13 years agoAdded the new DHT interface and a bare implmentation of it.
Cameron Dale [Mon, 17 Dec 2007 02:41:27 +0000 (18:41 -0800)]
Added the new DHT interface and a bare implmentation of it.

13 years agoAdded the DHT starting to the application.
Cameron Dale [Mon, 17 Dec 2007 02:39:43 +0000 (18:39 -0800)]
Added the DHT starting to the application.

13 years agoRemoved the old .cvsignore from khashmir.
Cameron Dale [Sun, 16 Dec 2007 21:19:50 +0000 (13:19 -0800)]
Removed the old .cvsignore from khashmir.

13 years agoAdd some of the fetching logic.
Cameron Dale [Sun, 16 Dec 2007 09:09:41 +0000 (01:09 -0800)]
Add some of the fetching logic.

13 years agoFix up the application to work with then new structure.
Cameron Dale [Sun, 16 Dec 2007 04:02:15 +0000 (20:02 -0800)]
Fix up the application to work with then new structure.

13 years agoMoved the files to appropriate package directories.
Cameron Dale [Sun, 16 Dec 2007 03:53:41 +0000 (19:53 -0800)]
Moved the files to appropriate package directories.

13 years agoMake it also work from the command-line.
Cameron Dale [Sun, 16 Dec 2007 03:32:31 +0000 (19:32 -0800)]
Make it also work from the command-line.

13 years agoAdded the application control files.
Cameron Dale [Sun, 16 Dec 2007 03:27:41 +0000 (19:27 -0800)]
Added the application control files.

13 years agoAdd proper version numbers to the user-agent string.
Cameron Dale [Sun, 16 Dec 2007 03:24:01 +0000 (19:24 -0800)]
Add proper version numbers to the user-agent string.

13 years agoAdded a manager to the HTTPServer for it to call when a file is not found.
Cameron Dale [Sun, 16 Dec 2007 03:12:02 +0000 (19:12 -0800)]
Added a manager to the HTTPServer for it to call when a file is not found.

13 years agoMoved the HTTPDownloader to the new PeerManager.
Cameron Dale [Sat, 15 Dec 2007 22:30:37 +0000 (14:30 -0800)]
Moved the HTTPDownloader to the new PeerManager.

13 years agoAdded a mirror manager frontend for the AptPackages.
Cameron Dale [Sat, 15 Dec 2007 03:58:20 +0000 (19:58 -0800)]
Added a mirror manager frontend for the AptPackages.

13 years agoClean up the imports again.
Cameron Dale [Sat, 15 Dec 2007 02:43:09 +0000 (18:43 -0800)]
Clean up the imports again.

13 years agoAptPackages only takes a single cache directory.
Cameron Dale [Sat, 15 Dec 2007 02:37:19 +0000 (18:37 -0800)]
AptPackages only takes a single cache directory.

Also changed the path specific to use os.path.

13 years agoMoved the index file tracking inside the AptPackages _load method.
Cameron Dale [Sat, 15 Dec 2007 00:02:42 +0000 (16:02 -0800)]
Moved the index file tracking inside the AptPackages _load method.

13 years agoCleanup AptPackages code.
Cameron Dale [Fri, 14 Dec 2007 23:53:54 +0000 (15:53 -0800)]
Cleanup AptPackages code.

Cleanup and order the imports.
Remove unnnecessary parts.
Add comments and docstrings.

13 years agoImplemented cache loading with threads and deferreds.
Cameron Dale [Fri, 14 Dec 2007 23:26:06 +0000 (15:26 -0800)]
Implemented cache loading with threads and deferreds.

Fixed the stdout redirection to work with threads.
Added individual findHash tests and one large multipleFindHash test.

13 years agoAdd a findHash function to AptPackages that searches everywhere for a hash.
Cameron Dale [Fri, 14 Dec 2007 07:56:39 +0000 (23:56 -0800)]
Add a findHash function to AptPackages that searches everywhere for a hash.

Also added a test for it.

13 years agoAdd tracking of index file hashes from Release files.
Cameron Dale [Fri, 14 Dec 2007 06:43:44 +0000 (22:43 -0800)]
Add tracking of index file hashes from Release files.

Also added test for this.

13 years agoAdded support for source package hashes to AptPackages.
Cameron Dale [Fri, 14 Dec 2007 02:57:23 +0000 (18:57 -0800)]
Added support for source package hashes to AptPackages.

Also added a test for it.

13 years agoFix the architecture problem in the AptPackages config system.
Cameron Dale [Fri, 14 Dec 2007 02:19:17 +0000 (18:19 -0800)]
Fix the architecture problem in the AptPackages config system.

13 years agoAdded a unittest to make sure AptPackages gets the right SHA1 hash.
Cameron Dale [Fri, 14 Dec 2007 01:45:33 +0000 (17:45 -0800)]
Added a unittest to make sure AptPackages gets the right SHA1 hash.

13 years agoRemove the apt-proxy specific stuff from AptPackages.
Cameron Dale [Fri, 14 Dec 2007 00:59:16 +0000 (16:59 -0800)]
Remove the apt-proxy specific stuff from AptPackages.

13 years agoSwitched AptPackages to use twisted's logging facility
Cameron Dale [Thu, 13 Dec 2007 23:27:04 +0000 (15:27 -0800)]
Switched AptPackages to use twisted's logging facility

13 years agoRemove some apt-proxy specific stuff.
Cameron Dale [Thu, 13 Dec 2007 08:16:36 +0000 (00:16 -0800)]
Remove some apt-proxy specific stuff.