Commit Graph

104 Commits

Author SHA1 Message Date
Jelle van der Waa
17a12f07fb Introduce planet functionality in archweb
This change introduces a replacment for planet.archlinux.org which uses
a python 2 project to generate static html from multiple RSS feed
sources. For archweb a set of 'static' feeds can be created in the
django admin view for the Arch forums and other static feeds, archweb
users can add their own blog rss feed in their profile which will create
a Feed model.

When running the update_planet command, all Feed models are iterated
over and the rss feed is parsed. The latest FeedItem is queried matching
the current Feed model and every newer entry in the RSS feed is added as
new FeedItem. Since the body is also stored in the FeedItem there is a
limit to the amount of FeedItems per Feed configured in settings.py of
which the default is 25.

When a user is marked as inactive his Feed model and items are
removed automatically to avoid keeping stale data around.

Closes: #261
2020-02-03 21:25:31 +01:00
Aleksandar Trifunovic
203506c9cc
remove unecessary list calls 2019-02-01 21:27:57 +01:00
Aleksandar Trifunovic
629b12da3f request.user.is_authenticated() -> request.user.is_authenticated 2019-01-21 21:19:58 +01:00
Jelle van der Waa
c612b19314 main: run 2to3 2019-01-21 21:19:58 +01:00
Johannes Löthberg
f442bc42f7 public/views: pgp_key is not a foreign relation, so cannot be select_related
Wonder how old this bug is..

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2018-04-08 12:51:19 +02:00
Jelle van der Waa
856fea01a9 public.views: remove unused import/variable 2017-07-11 22:01:58 +02:00
Jelle van der Waa
e33e845238 public.utils: remove unused variable arch 2017-07-11 21:56:10 +02:00
Daniel Hahler
17d2823011 Fix RemovedInDjango19Warning
> Passing callable arguments to queryset is deprecated.
2017-06-29 01:35:46 +02:00
Jelle van der Waa
f2ada514b2 urls.py: remove legacy urls
The legacy urls where introduced in 2011 get rid of them since it's
2017.
2017-06-12 20:39:13 +02:00
Jelle van der Waa
22acfa3391 tests: add tests for sitemaps 2017-06-11 20:54:21 +02:00
Jelle van der Waa
e2741c209a public: test missing urls
Test the urls which are part of public but where not tested yet due to
missing fixtures.
2017-06-11 18:43:14 +02:00
Thomas Bächler
b246b751dc Add information and ipxe images for the new netboot system 2016-06-03 22:28:27 +02:00
Dan McGee
becb5b2356 Fix error in test where HTTP_HOST doesn't exist
Signed-off-by: Dan McGee <dan@archlinux.org>
2015-04-15 17:23:18 -05:00
Dan McGee
6897f44fa7 Shore up some failing tests
We really need to add a bunch of new ones for views that have been added
and/or changed, such as all the people stuff, but fix the response code
here to reflect the new and current reality.

Signed-off-by: Dan McGee <dan@archlinux.org>
2015-04-15 17:12:32 -05:00
Dan McGee
0fd1bc9690 Add JSON-LD search engine configuration
Implemented as documented here:
http://googlewebmastercentral.blogspot.com/2014/09/improved-sitelinks-search-box.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2015-04-13 15:07:49 -05:00
Dan McGee
fe75e44d4c Fix thinko in leaving old code behind in keys_json
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-12-17 22:59:10 -06:00
Dan McGee
cd22bfd73b Master signing keys page improvements
* Don't show non-packagers
* Don't hardcode group names in view code
* Reduce number of database queries for all of the cross-signature
  developer name lookups

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-07 09:27:56 -06:00
Dan McGee
5bfe138a86 Add new StaffGroup object
This will allow us to be a bit more dynamic in showing the people
listings on the website. We'll be adding a Support Staff category to
recognize those that do things around here but aren't technically
developers.

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-02 10:44:03 -06:00
Dan McGee
7c46d07f64 Use varied prime numbers for caching lengths
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-10-19 18:12:58 -05:00
Dan McGee
3e70c8107b Remove now unnecessary empty models.py files
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-11 18:35:36 -05:00
Dan McGee
0b0e2b9d2a Fix some caching issues on the front page
The return value from get_recent_updates() was too big for memcached due
to all the attached objects, so the cache never actually worked. This
sucks, because we ended up doing all the work in this function and most
of the time we didn't use it because template fragment caching kicked
in.

Remove the cache_function decorator from this method, and instead
implement delayed calling of the function so we don't compute values we
aren't going to use. Template fragment caching will help us in most
cases.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-14 15:06:26 -06:00
Dan McGee
92136757bf Proper support for revoked signatures
The 'valid' column wasn't quite right. Add a new 'revoked' column that
works similar to the one we have on keys and use it instead, properly
parsing the output from `gpg` signature data and looking for the magic
prefix string.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-09-30 20:45:10 -05:00
Dan McGee
49bf498879 Ensure only active mirror URLs are listed
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-01 14:53:17 -05:00
Dan McGee
b7b2474064 Various minor code cleanups and fixes
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-16 22:12:01 -05:00
Dan McGee
f579f88e17 Don't link to a one-element listing page from recent updates
If a package is built as a split package where pkgname != pkgbase, but
only one actual split package is produced, the link on the recent update
screen requires an extra click to get to the single package. Fix this by
linking directly to the package itself.

(Examples in current repos: ntfs-3g, python2-south)

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-11 09:40:38 -05:00
Dan McGee
e969da2d40 Run pngcrush and optipng over most static content
The programs have improved a bit and found some room for optimization,
especially in the static logo content. Some files were reduced in size
by 50% or more.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-03 13:38:39 -06:00
Dan McGee
23ef118ac1 Don't redefine mirror_url function every call
If we pull this out and define it at the top level once, we save the
interpreter a fair amount of work.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19 10:37:16 -06:00
Dan McGee
cba22a378b Don't pull and sort mirror URLs unless we have to
On the download page, the explicit sorted() call was forcing evaluation
of the Django queryset, even if we never actually needed the results
because the template fragment was cached. Wrap it all in a callable
function which looks the same to the template, but saves us the cost of
evaluation every single page view.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-18 20:01:22 -06:00
Dan McGee
6f0ae6746b Drop country column from mirror table
We now always look for this information at the URL level, not the mirror
level. This simplifies quite a bit of code in and around the mirror
views.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14 01:05:54 -06:00
Dan McGee
66850026ca Use content_type and not mimetype on HttpResponse()
Bug #16519 in Django deprecates mimetype, so update our code
accordingly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-13 22:34:33 -06:00
Dan McGee
e7c331d361 Fix master key signing total counts
Commit 4c69911982 had an inadvertent side effect here; we need to
explicitly disable ordering for the annotate() to work correctly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-27 22:51:20 -06:00
Dan McGee
730ac948b5 Add a __unicode__ method for RecentUpdate
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-27 19:59:52 -06:00
Dan McGee
f7331a0eca Add Release model to releng
This should prevent the need for monthly template updates from Pierre
and Thomas; best to just let them enter the data themselves and have it
show up on the website.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-20 19:16:25 -06:00
Dan McGee
6dd4d54bb0 Use Python 2.7 dictionary comprehension syntax
Rather than the old idiom of dict((k, v) for <> in <>).

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16 16:37:52 -06:00
Dan McGee
45d81a9578 Move JSON keys view to public/ app
This seems like a more appropriate place, and now the visualization is
done here anyway so we should move the data backing it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-13 10:21:02 -06:00
Dan McGee
67fef06fe8 Only show staging feeds to logged-in users
This doesn't prevent unauthenticated users from accessing the feeds, but
it should reduce clutter and confusion on the feeds index page for users
unlikely to need these feeds.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25 00:49:54 -05:00
Dan McGee
3eed426027 Add structured data to developer listing pages
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25 00:30:05 -05:00
Dan McGee
3f0c024754 PGP key handling updates
* Import signatures for all known keys, not just active developers
* Ensure we are only showing and accounting for active developers on the
  master keys page
* Add a new table showing signatures between developers

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31 18:37:30 -05:00
Dan McGee
0cc369e985 Update several bits and pieces for staging packages
This will prevent [staging] packages from cluttering normal user's view
on the website, but allow us to still import everything from this
repository for developer use.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31 00:09:28 -05:00
Dan McGee
76c37ce3ac Replace deprecated direct_to_template() with render() shortcut
Now that Django actually provides a concise way to use a RequestContext
object without instantiating it, we can use that rather than the old
function-based generic view that worked well to do the same.
Additionally, these function-based generic views will be gone in Django
1.5, so might as well make the move now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24 19:57:20 -05:00
Dan McGee
640e0f5864 Finish django countries implementation
* Add a migration to drop the old countries field.
* Update all templates/views/utility methods to point at the new country
  field and dereference it as necessary.
* Add the flags images to a few views where it makes sense.
* Cleanup the download page layout quite a bit.
* Bump the mirror status JSON version to 3; add country_code attribute.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 01:51:58 -05:00
Dan McGee
116751e4ba Rename mirror country fields to country_old in prep for normalization
We're going to move to using ISO 2 character codes via django countries,
so start by moving the old data out of the way first.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 00:00:36 -05:00
Dan McGee
ef88f3d5ef Add developer status table to master keys page
This shows the cross-product of each master key with each developer key
so you can see who has been signed, where signatures are missing, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 11:37:07 -05:00
Dan McGee
7d8580b4b1 Add number of keys signed to master keys page
This really just makes me look bad, but an interesting fact none the
less for people to look at.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-21 15:52:40 -05:00
Dan McGee
749b044728 Ensure users only show up once on the Fellows page
If a user was in both Developer and TU groups, they would show up twice.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-09 11:26:00 -06:00
Dan McGee
6b16b9487a Adjust page and content caching lengths and decorators
Remove never_cache from many places now that we don't actually need it
since we aren't caching by default. Adjust our cache_function decorator
times be shorter values, and also randomize them a bit to make cache
invalidations not all line up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05 13:03:00 -06:00
Dan McGee
9ddbe26e4c Add a few cache headers and minor feed caching back in
Now that we aren't using the middleware, add cache headers on our
primary pages so we can prevent some repeat traffic, and cache all feeds
for five minutes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-03 15:00:49 -06:00
Dan McGee
a60801bb7d PyLint suggested cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-11 19:52:27 -06:00
Dan McGee
73cd4adf9f Add CSS classes to front page package update objects
This adds the repo name, 'staging', and 'testing' as appropriate to a
classes field on the package updates object. This means we don't have to
update the CSS stylesheet to include hardcoded names of repositories
(e.g., 'kde-unstable').

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-09 09:29:15 -06:00
Dan McGee
943ef2e8e4 Convert to and enable staticfiles contrib application
This moves our site static files into the sitestatic directory if they
are shared resources, and also moves a handful of things (such as the
artwork logos) into application-specific static/ directories. This
allows the staticfiles contrib app to work after a few settings tweaks,
a run of collectstatic, and massaging the hardcoded '/media/' prefix out
of our templates.

Django 1.4 is going to make this a lot easier to move things to a CDN
and provides better template tags; for now this is setting the stage
before we can move to that.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-05 23:06:10 -06:00