summaryrefslogtreecommitdiffstats
path: root/mirrors
AgeCommit message (Collapse)AuthorFilesLines
2014-06-11Use last element in args tuple as error messageDan McGee1-1/+1
When things blow up in low-level C code, the tuple is sometimes of length one, such as when it contains this error message: _ssl.c:495: The handshake operation timed out Just use the last element of the tuple, which works for all of the cases. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-05-31Convert ~~~ to date/username text when editing mirror notesDan McGee1-0/+8
Requested by Florian to make leaving notes on mirrors a bit easier. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-03-29Protect ORM migration portion in db.dry_runDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-03-29Add last_modified column to mirrorsDan McGee3-1/+89
This will make it easier in the future to clear out inactive mirrors that haven't been touched in a while. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-02-22Upgrade django-countries to 2.0Dan McGee3-4/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-01-11Add a 'last_modified' function for mirror status pagesDan McGee1-0/+7
We can use this on both the HTML and JSON views of this data to prevent recomputation for smart clients that respect the modified date header. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-23Set all attributes to default values on status URL fetchDan McGee1-0/+2
We were missing two duration-related attributes here, causing some 500 errors to happen if we had cached status_data around that didn't agree with our current list of checked mirrors. Don't blow up on the JSON data fetch by ensuring we provide a value, even if it is out of date. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-23Change import location of django_countries fieldsDan McGee1-1/+1
This will work with both the newer and older versions. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-15Use select_related() in new mirror URL details viewDan McGee1-2/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-15Add mirror URL details pageDan McGee3-0/+22
This will allow those that care about mirrors to zoom into URL-level details for each mirror and examine the individual check results. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-15Add delay function to MirrorLog modelDan McGee1-0/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-15Use stable parameters for cacheable functionDan McGee1-2/+3
It doesn't do much good to mark a function as cacheable if we call it every single time with different arguments due to using the current date and time. Fix it by passing the offset in instead. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-14Add update query for extracting Flyspray bug numberDan McGee1-0/+8
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-14Add Flyspray Bug field to mirror modelDan McGee3-1/+86
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-14Show all mirror status data to authorized usersDan McGee2-14/+24
Regardless of whether the mirror URL is active or not, we often have data we can show the end user, especially if mirror admins care to see the data we've been gathering. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-27Stop using Django-provided floatformat template tagDan McGee1-3/+8
It turns out this is a HUGE part of our slow mirror status template rendering, due to the internal workings. Everything is converted to a Python decimal object which is way slower than just staying in native floating point. Given we are always dealing with floats when we need to do our formatting, a home-rolled template tag can accomplish this much faster. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-07Django 1.6 upgrade, deprecation cleanupDan McGee1-1/+1
PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-07Django 1.6 upgrade, deprecation cleanupDan McGee1-0/+6
PendingDeprecationWarning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form needs updating Signed-off-by: Dan McGee <dan@archlinux.org>
2013-07-13Fix completion percentage calculation in mirror statusDan McGee1-2/+2
We sometimes record a duration even on a failed fetch attempt, such as if we get an HTTP 404. However, we never record a last_sync value on a failed fetch. Use this field instead to sum up the total number of successful checks. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-20Re-enable caching for somewhat expensive mirror status queryDan McGee1-1/+1
This should be a small enough chunk of data that it isn't super expensive to put into and pull out of memcached. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01Guard logging operation to prevent needless text joinDan McGee1-2/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01Ensure only active mirror URLs are listedDan McGee2-1/+2
This fixes things up on the download page as well as the individual mirror details page. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01Whoops, committed a little bit too muchDan McGee1-3/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01Honor mirror URL active attribute in several placesDan McGee4-7/+14
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01Add active column to mirror URLsDan McGee2-0/+84
2013-05-22Begin removal of FTP mirror supportDan McGee5-35/+10
FTP is a terrible protocol these days compared to HTTP. IPv6 support is spotty at best, it is much slower for the connect/begin transfer cycle, and overall just doesn't provide anything HTTP does better. Start killing bits that we've added to treat FTP as a first-class protocol and regulate it to the back seat. The expectation here is once this commit goes live to the production site, the FTP mirror URLs themselves will get removed completely from the database, and the FTP protocol object itself will get deleted. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-05-11Add mirror error logs to mirror details pageDan McGee1-2/+9
Give a window of 7 days for logs here rather than the default 24 hours we do on the main status page since we are only retrieving details for a single mirror with a handful of URLs. This should make it easier to have all information regarding one mirror in a single location. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-20Fix some None issues with sqlite3 and mirror statusDan McGee1-2/+4
If certain attributes came back from the database as NULL, we had issues parsing them. Pass None/NULL straight through rather than trying to type-convert. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-17Various minor code cleanups and fixesDan McGee3-13/+7
Most of these were suggested by PyCharm, and include everything from little syntax issues and other bad smells to dead or bad code. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-17Remove COUNTRY_LOOKUP global variableDan McGee1-3/+3
This is only used in one place, so it makes more sense for it to not be globally accessible. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-14Tweaks to mirror status chart generationDan McGee1-10/+12
* Use 'jQuery' rather than '$' * Use same colors for URLs in every chart for clarity Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-14Draw one mirror status graph per check locationDan McGee2-20/+51
Rather than lump it all together and have odd spikes depending on which side of the Atlantic checked a mirror in a given timeslot, draw a chart per check location. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-14Add a JSON view for retrieving mirror check locationsDan McGee2-2/+32
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-14Remove cache_function decorator from a few spotsDan McGee1-2/+0
The benefit of these storage operations might be outweighed by the cost, especially given how infrequently these functions are called. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-14Reduce mirror status query madnessDan McGee1-55/+91
Move completely to custom SQL for this logic. The Django ORM just doesn't play nice with the kind of query we are looking to do, so it is easier to do using raw SQL. The biggest pain factor here is in supporting sqlite as it doesn't have nearly the capabilities in handling datetime types directly in the database, as well as having some different type conversion necessities. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-13Support only a single mirror ID in error/status retrievalDan McGee2-11/+11
This simplifies things and makes injecting this single mirror ID into custom SQL a whole lot easier. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-13Calculate average URL delay in the databaseDan McGee1-19/+30
Rather than doing this in the Python code and needing 12,000+ rows returned from the database, we can do it in the database and get fewer than 300 rows back. If I recall correctly, the reason this was not done originally was due to our usage of MySQL and some really bad date math/overflow stuff it did when the interval between last_sync and check_time were greater than about a week. Luckily, we have switched to using a more sane database. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-11Allow mirror rsync IPs to be IPv4/IPv6 addresses or networksDan McGee4-15/+136
This gives us a bunch more flexibility on this field, and now supports all the options that the rsync config file supports. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-29Add IP family lookup to CheckLocation modelDan McGee1-0/+9
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-13mirrorcheck: s/if/elif/ when determining what check function to runDan McGee1-1/+1
This was a silly thinko here; it caused the logs to fill up with a bunch of 'unknown url type: rsync' errors. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-13Don't check FTP + IPv6 combinationDan McGee1-1/+15
Very few, if any, FTP servers support connections over IPv6. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Don't add blank options to rsync command lineDan McGee1-1/+5
Rsync doesn't like this so much: Unexpected remote arg: rsync://mirror.example.com/archlinux/lastsync rsync error: syntax or usage error (code 1) at main.c(1214) [sender=3.0.9] Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Teach mirrorcheck management command about check locationsDan McGee1-17/+46
This adds the -l/--location argument to the command in order to pass in a check location that we are currently running from. This locks the IP address family to the one derived from the address on that location, and stores any check results tagged with a location ID. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add location ID to mirror logsDan McGee2-0/+84
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add family property to mirror check locationDan McGee1-0/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Revert "mirrorcheck: Don't use bulk_create on sqlite3"Dan McGee1-6/+1
This reverts commit 3c4ceb16. We don't need this anymore as bulk_create gets automatic batching now on sqlite3 so it is safe to use. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add mirror CheckLocationAdminDan McGee1-1/+17
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add 'created' field to more mirror modelsDan McGee2-2/+104
We have been better about doing this to most of our models, but the ones here didn't have a created field. Add it where appropriate and set a reasonably old default value. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add mirror check locations modelDan McGee2-1/+105
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-05Add HTTPS mirror protocol fixtureDan McGee1-2/+11
For now, it is not included in the default selection, but we have a few existing mirrors that do support it. Signed-off-by: Dan McGee <dan@archlinux.org>