Commit Graph

375 Commits

Author SHA1 Message Date
Jelle van der Waa
700afd84c0 Remove CDN configuration option
Remove the unused CDN configuration option for JQuery.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
2017-06-29 16:32:44 +02:00
Angel Velásquez
cb80360a23 Merge pull request #30 from jelly/signoffs
Signoffs
2017-06-12 14:27:41 -04:00
Jelle van der Waa
c1bfb31c07 visualize: add tests 2017-06-11 18:43:14 +02:00
Jelle van der Waa
f6afd724fb Add fixtures for the signoff testers group
Add the fixtures corresponding to the signoff testers group on the live
server.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
2017-06-05 21:58:52 +02:00
jelle van der Waa
bd90570ab7 main: Add basic tests for pgp template functions (#28) 2017-05-29 20:47:43 -04:00
jelle van der Waa
767d9d190b main: Clean up unused option in pgp_fingerprint (#29)
The autoescape option is always true in our codebase so remove the
unused non escaping option.
2017-05-29 20:47:20 -04:00
Jelle van der Waa
8d74f8c3a5 main: remove unused imports 2017-05-28 20:25:06 +02:00
Jelle van der Waa
9ae767cb4f port templates/packages to pure django 2017-05-02 21:13:56 +02:00
Jelle van der Waa
6489bd1a2e Port mirrors to pure django template 2017-05-02 21:13:56 +02:00
Evangelos Foutras
e4381ff3b7 Allow linking to the PGP server over HTTPS
Signed-off-by: Evangelos Foutras <evangelos@foutrelis.com>
2015-12-31 03:26:35 +02:00
Dan McGee
60327d96a6 Upgrade to python-markdown 2.5.2
safe_mode is now deprecated, so adjust things accordingly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-12-08 19:52:55 -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
87e8a16d65 Update fixtures for new staff groups
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-03 18:32:15 -06:00
Dan McGee
0c72812fde Mirror view tweaks and enhancements
* Add country column to main mirror list overview page. Most mirrors are
  strictly in one country, so do a little magic to show the right
  country if it makes sense.
* Use new way of getting country names so we respect the overrides now
  present in the django_countries package.
* Make the country selection box on the mirrorlist generation page a lot
  taller by default so it is easier to use.

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-02 09:42:52 -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
1ff2e37e04 Simplify last modified and etags processing for feeds
We had this elaborate system set up with caching and invalidation, which
is overkill since we cache the result of the view anyway. Just hit the
database when needed to find the last change to the respective model
class and be done with it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-10-19 14:19:05 -05:00
Dan McGee
0896b5697a Add auto-generated migrations from new Django migrations framework
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01 18:26:05 -05:00
Dan McGee
5232b186dc Remove dependency on South
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01 18:26:05 -05:00
Dan McGee
51d90e23c9 Remove old south migrations
Django 1.7 has built-in migrations support, so we no longer want these
around. All existing installs should be fully migrated at this point to
the latest schema.

Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01 18:26:05 -05:00
Dan McGee
cd7222047b Make filename and directory name fields accept longer values
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-03-22 12:25:09 -05:00
Dan McGee
3b1b677b49 Speed up master key listing page
We were spending a lot of time getting the developer name for a given
key on this page, which involved sending one query per key ID. Use the
cache to our advantage here and save ourselves the "expensive" lookups.
This eliminates ~100 queries per page load.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-12-14 10:52:51 -06:00
Dan McGee
954b61ee3a Syntax cleanups to main admin
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-27 17:08:42 -05:00
Dan McGee
efd1bd15ef Capitalize URL properly in Django admin
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-25 21:31:31 -06:00
Dan McGee
fab8d43792 Merge branch 'cleaned-reqdby' 2013-11-25 21:11:35 -06:00
Dan McGee
833798f4fb Filtered requiredby list for non-primary depends
For something like gambas3 which has a makedepend on postgresql, we end
up getting every single split package listed in the required by list for
postgresql. This is a bit crazy and unnecessary, so slim it down a bit
when possible by using a slightly crazy groupby function and some smarts
in our get_requiredby function.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-11 16:28:34 -06:00
Dan McGee
071bd6bd71 Drop old base64-ed PGP signature column
We've moved onto bytes only now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-06 22:08:01 -06:00
Dan McGee
a4cf77ba24 Move signature data from base64 string to bytes type
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-06 22:05:18 -06:00
Dan McGee
cf27baf519 Add new signature_bytes field on package model
Now that we have a BinaryField option in Django 1.6, put it to use.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-06 21:48:52 -06:00
Dan McGee
fa647734a2 Use the unicode char representation of &nbsp;
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-07-13 10:07:16 -05:00
Dan McGee
007b8d7573 Add 'required_signoffs' field to Arch model
This will indicate how many signoffs are required for packages of the
given architecture. Set the default to 2 as it currently stands.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-22 09:13:12 -05:00
Dan McGee
81821d2b47 Sort required by entries by dependency type
We were doing this for depends entries already, and we can do the same
for required by entries via some absolutely awesome SQL query magic and
injecting a few more things to our already crazy query.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16 23:24:33 -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
31d39e75ee Add shortcut for HEAD requests on slower views
We sometimes see some web bots and crawlers make HEAD requests to verify
existence of certain pages in the application. However, they are less
than kind as 20-50 requests might arrive at the same time, and package
search and details pages are some of the slowest rendering pages we have
due to the Django template engine.

Rather than waste time generating the content only to throw it away,
response as soon as we can with either a 404 or 200 response as
appropriate, omitting the 'Content-Length' header completely, which
seems to be acceptable by the HTTP spec.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16 21:59:32 -05:00
Dan McGee
f357a39a49 Remove cache_function decorator from a few spots
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-14 13:21:20 -05:00
Dan McGee
d98ab844a0 Disable more @cache_function usage
Seems the Django caching layer has changed quite a bit and is doing all
sorts of funky s**t at this point. Yay for errors!

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-27 09:00:17 -06:00
Dan McGee
d5a6446964 Remove caching on reverse_conflicts
We started seeing this in production with memcached usage and the
upgrade to Django 1.5:

    PicklingError: Can't pickle <class 'devel.models.UserProfile_allowed_repos'>: attribute lookup devel.models.UserProfile_allowed_repos failed

Without having time to investigate further, something changed, likely
due to the whole user profile/configurable user model shenanigans done
in Django 1.5. For now, simply don't cache this attribute to work around
the problem.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-27 08:40:23 -06:00
Dan McGee
8524a6057c Change caching strategy on package.applicable_arches
Rather than use the Django cache for this (aka memcached), just do it on
a per-object instantiation basis. This means no external services calls
except the first time to the database, which should be quite a bit
faster.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-09 16:20:38 -06:00
Dan McGee
271d1babbf Revert "Reduce query count when retrieving satisfiers and providers"
This reverts commit 20b64e4267.

Django 1.5 fixed this issue and now parent objects are automatically
attached to their children when queries go through the related manager.
See "Caching of related model instances" in the release notes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-09 16:20:38 -06:00
Dan McGee
8d79a1ea84 Minify static files when running collectstatic
This doesn't do any super optimizations, but does run the very basic
cssmin and jsmin Python tools over the static resources we serve up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-08 21:03:52 -06:00
Dan McGee
cfa2798880 Update exception to DeveloperKey.DoesNotExist
We aren't looking up users; we are looking up developer keys.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-04 17:01:58 -06:00
Dan McGee
508d06af81 Use DeveloperKey model on package page and reports
This introduces the new model to the package page so subkey signings
show up as attributed to the original developer. We also teach the
mismatched signatures report to recognize all keys and subkeys of a
given developer, cutting down on some of the bogus results.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-03 15:08:21 -06:00
Dan McGee
d63a800348 Update user_pgp_key_link template tag to use DeveloperKey model
The first of several small updates to use the new data we have
available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-03 14:40:41 -06:00
Dan McGee
53484c45ea Fix error in get_requiredby() when checking provides
The query refactor in commit 1b1b516bd removed a queryset I didn't
realize was getting used elsewhere in the function.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20 15:28:17 -06:00
Dan McGee
45108ea497 Remove AlwaysCommitMiddleware
Let's just go with the Django database option for PostreSQL autocommit
mode instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20 15:09:18 -06:00
Dan McGee
1b1b516bd8 Query performance enhancements in get_requiredby()
For packages with particularly long lists of provides (e.g. perl), the
query was getting a bit out of control with the list of names passed in.
However, changing it to simply do a subquery resulted in some really
poor planning by PostgreSQL. Doing this as a custom 'WHERE' clause
utilizing the 'UNION ALL' SQL operator works very well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20 15:01:13 -06:00
Dan McGee
0b930fd921 Convert all usages of flag icons to new sprite
This uses a new template tag to avoid repeating construction of the
necessary HTML element all over the place. The site should look exactly
as it did before, except now you don't have to download 20+ images to
see some pages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16 00:36:17 -06:00
Dan McGee
f106379b53 Clean up and make several migrations modern
This moves most migrations to the v2 format that have been presenting
some issues. One missing depends_on relationship has been added, and we
allow an index to not be dropped if it does not exist due to the
shittyness in sqlite3 actually keeping indexes across DDL on that table.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-15 21:29:30 -06:00
Dan McGee
3a6398f42d Add new AlwaysCommitMiddleware to the stack
The reason for this is documented in the middleware itself. Without
this, pgbouncer is of little use to us since it has to throw away every
connection we try to route through it because of unclean disconnects.

In theory, with the switch to using pgbouncer for all WSGI originating
connections and adding this middleware, we should see a notable decrease
in connection time to the database.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-15 21:27:37 -06:00
Dan McGee
c37fe10728 Minor coding style tweaks
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-31 10:24:21 -06:00
Dan McGee
04f23a040a Add 'created' field to packages model
This will be used to eventually implement the UI side of FS#13441, but
to do that, we first need the data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-31 10:17:22 -06:00