Commit Graph

736 Commits

Author SHA1 Message Date
Dan McGee
1c6099f4b2 Make general mirror list view public
Hide some columns when not logged in because they aren't relevant for the
general public, but this will work nicely as a base page for all of our
known mirrors.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-24 19:39:37 -05:00
Dan McGee
46dec16346 Add note about mean syncing delay
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-24 19:39:36 -05:00
Dan McGee
10fca82816 Give more information about mirror check runs and frequency
Show how many times the check has ran in the last 24 hours, as well as the
average interval between checks.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-24 19:39:36 -05:00
Dan McGee
e82e953aa2 Mirror status query refinements
Only show errors for active and public mirrors, and collapse two filter
calls into just one for our normal status query.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-24 13:26:08 -05:00
Dan McGee
00e9dce4db Fix news permission checking in templates
We were still looking at the permissions on the main application; these
need to be updated to point at the news application instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-24 11:12:31 -05:00
Dan McGee
d0170b7fc9 Update BBS and bugs links to use HTTPS
Since we only do HTTPS now on these services, no point in sending someone
through a useless redirect.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22 23:24:00 -05:00
Dan McGee
47c95a2821 Get secure/unsecure checking actually working
We need a bit more, like actually having something relevant in the
RequestContext object, in order for this to all work. Instead of putting the
full request in just populate a 'secure' key with a boolean value indicating
whether the request is secure.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22 23:16:13 -05:00
Dan McGee
66d6d33c9b Update newsletter/magazine link
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22 18:17:11 -05:00
Dan McGee
0dba93a9fc Switch mirror status delay display to average delay
This takes a bit more work to compute, but since we cache all of this anyway
it isn't too big of deal. Using average delay instead of last delay will be
a bit more fair on mirrors that have odd syncing schedules, as well as
exposing those that only sync once a day. Also fix an issue that will arise
with cutoff_time being calculated once, and adjust mirror score to treat
hours delay as a float rather than an integer.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22 13:28:12 -05:00
Dan McGee
550ef2eeeb Allow generated mirrorlist to take status info into account
By using the mirror score we calculate, we can sort the mirrors in the
generated mirrorlist for people.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 18:58:34 -05:00
Dan McGee
5b87b21ccd Allow caching of mirror status info
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 18:31:26 -05:00
Dan McGee
818028562d Fix self-closing anchor links for Chrome
Apparently it can't parse a very normal looking <a/> because they forgot
one of their original purposes doesn't require a body. Awesome.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 18:14:53 -05:00
Dan McGee
753329659e Prevent 500 if no mirror checks have ran
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 17:43:39 -05:00
Dan McGee
b3883820a2 Merge branch 'mirror-check' 2010-09-21 17:39:46 -05:00
Dan McGee
8ff8190c5c Add link to mirror status tool
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 17:39:39 -05:00
Dan McGee
2a296af10d Add ordering, sorting, and a lot more info to mirror status page
This should get this to the point where it is releasable to the general
public for their use and pleasure. Still not sure on how often the check
should be run, and we probably want to incorporate this mined data into some
other things like the mirror list generator.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 17:30:14 -05:00
Dan McGee
b8a78408ff Small updates to mirrorcheck command
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 17:29:45 -05:00
Dan McGee
4a99d313bf Allow serving jQuery via HTTPS if secure request detected
Handles the concerns in FS#19045.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:47:45 -05:00
Dan McGee
1f44788e1e Add debugger when having to parse lastsync file
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00
Dan McGee
40ac4818aa Add mirror status view
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00
Dan McGee
3d8bc07622 Add 'mirrorcheck' command
This does the actual work of going out and checking the mirror status. In
short, it polls every active mirror URL for the 'lastsync' file and then
records the appropriate details. These include the contents of that file,
how long the total time to retrieve took, and any errors encountered.

In order to finish up a bit faster, we spawn several threads to do the
actual work. This parallelization allows the whole check process to take
around 30 seconds rather than several minutes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00
Dan McGee
7c88e3e1a2 Rename generate mirrorlist view
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00
Dan McGee
0776b440b5 Add new MirrorLog model and associated migration
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00
Dan McGee
1b6cf5261c Auto-populate slug on news item creation
And make sure it is unique through a few queries and some magic.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
41dc37c812 Update news views to use slug instead of ID
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
7c92ddbd3c Add migrations to populate the news slug and make it non-null
These should get us all set to have more useful URLs for the news items.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
190d0fc154 Add news slug field
Initially, this needs to allow null so that we can add in slugs for all of
our old news items.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:09:01 -05:00
Dan McGee
a288066faf Update news permission required string
When moving the news model and updating the content type, I forgot to update
these strings to reflect the new permission name. Whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-20 10:33:31 -05:00
Dan McGee
7409e1155f Fix package differences pkgrel comparison
Using the right index in the array might help; we were comparing pkgver
again and not pkgrel at all.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-20 10:33:20 -05:00
Dan McGee
445bd7c80b Remove some leftover print statements
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-16 17:11:02 -05:00
Dan McGee
8a3bd1ad8a Spruce up news admin view
Add last modified date as a column, and fix up some other small display,
sorting, and ordering issues.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15 09:04:00 -05:00
Dan McGee
b084936ad9 Ensure consistent date formatting everywhere
Set up a default DATE_FORMAT in settings.py and use it everywhere we do the
'|date' template filter rather than hardcoding the value in the template.
This also fixes a regression with news date/time now that we changed the
field to store both date and time.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 18:47:12 -05:00
Dan McGee
3394a94a40 Re-enable etags
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 18:41:29 -05:00
Dan McGee
5dc5688d97 Improve request handling for feeds that haven't changed
By using the condition decorator (in a slightly odd way because these are
class-based views), we can cut down a lot on the response time for returning
304 status code for feeds that haven't changed. The decorator means we no
longer have to completely render the view to see if we can return a 304
status code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:42:12 -05:00
Dan McGee
6c54cdb9ca Reorder middleware to be more inline with Django defaults
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:41:46 -05:00
Dan McGee
1a18ca4771 Add last modified date to news
This will come in handy when determining whether resources are out of date,
such as our news RSS feed. Also bump the Date fields to DateTime fields for
sake of sorting and if we have more than one news item on the same date.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:39:17 -05:00
Dan McGee
2432227b66 Bump requirements for Django security release
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 19:15:35 -05:00
Dan McGee
5ca2cea388 reporead: revamp database parsing code
This needed a little sprucing up as it has grown quite organically over the
life of this script. Make things a bit more pythonic through the use of
iterators rather than collection indexing, and try to generalize the special
cases of things a bit.

Also catch encoding problems early and fail gracefully rather than blow up
the entire package parser. A failed decode of a file should cause us to just
skip it rather than stop the entire parser.  Worst case, this leaves that
package out of the web interface.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 12:32:13 -05:00
Dan McGee
51fca0c98d Check for correct permission when creating users
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 10:20:00 -05:00
Dan McGee
fa4f5c15c8 Restore flagged package count by maintainer in dashboard
We need to do a little dropping into SQL to accomplish this, but it isn't
all that bad to actually do and we can do the whole thing in one query.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 18:27:18 -05:00
Dan McGee
d6f29d5031 reporead: allow traceback on USR1 signal as well
When I have caught reporead behaving badly on the production box, I haven't
been able to successfully get a traceback without killing the process.
Hopefully using a different signal will allow me to actually capture some
data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 10:23:17 -05:00
Dan McGee
2470fb92e9 Remove SomethingFishyException
Just use a plain Exception instead since we don't get any added value by
subclassing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 10:11:14 -05:00
Dan McGee
eaa76ae758 Improve todo list view page
Add total package count and incomplete package count columns. Also reduce
the number of total queries by killing the query per row that was happening
before.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 13:36:41 -05:00
Dan McGee
ffdf7fec99 Remove redundant text from groups package count column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 13:35:48 -05:00
Dan McGee
6dece4b18b After moving models, update content type table
The one thing that people forget to mention when moving models from one
Django app to another. I was fooled here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 06:46:25 -05:00
Dan McGee
1e4a9e159c Hide multilib by default
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 06:30:19 -05:00
Dan McGee
601b63ad10 Update arch fixture with new column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 11:14:33 -05:00
Dan McGee
04da5f03b2 Use arch.agnostic flag everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 11:12:43 -05:00
Dan McGee
5c78ad7469 Add metadata to Arch table
Add a column flagging whether this architecture is agnostic (e.g. 'any') or
not. This will remove the hardcoded name checks we have all over the place
and replace it with a boolean.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 10:50:55 -05:00
Dan McGee
e0bf193c55 Fix download links to work with package pools
With package pooling we don't put things in the '/any/' folder anymore under
each repository; they only show up in the actual architectures. Use a 'real'
architecture as part of the download link to rectify this. Fixes FS#20779.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 10:42:44 -05:00