Commit Graph

70 Commits

Author SHA1 Message Date
da812e682b mimetype is now called content_type 2016-05-14 19:49:12 +02:00
350b936e58 Prefix cross-application imports with pgweb
As required by the new project layout.
2016-05-14 19:49:12 +02:00
856dbd31a2 Update for new transaction handling in newer django versions 2016-05-14 19:49:12 +02:00
498e786c0e Move files and directories for new project layout
Move manage.py up one step, set up a new wsgi.py file, and adjust
relative paths that refer to other directories for the new project
layout that we need to use in django 1.8.
2016-05-14 19:49:12 +02:00
2f8bbc40dd Replace pgq with trivial local queue implementation
The queue used for varnish purges has so few entries that it's really
not worth paying the management overhead for skytools/pgq. Instead we
can use a very simple local deamon using LISTEN/NOTIFY to fire them off.

Now include a proper nagios plugin in this package, so we can get rid
of the not-very-nice munin plugin currently used in the deployment.
2016-05-14 19:49:12 +02:00
9c8006364e Add a system_information view available through SSL 2015-12-17 17:34:31 +01:00
40d3ed798e IP restrictions don't currently work on SSL
Since we pipe all SSL through frontends, and explicitly reject directly
accessing the main host. However, this call has no payload, so we can
safely allow it without SSL through the frontends. Do that for now, while
we should look at fixing the SSL issue sometime in the future
2014-04-13 14:53:48 +02:00
b39a87fa5f Add API url that drops a trigger file for updates
The idea is a git repository hook will send a POST to this URL, which
will drop a trigger file somewhere. A cronjob (or inotify listener if
we want to be really fancy sometiem in the future) will pick up that
cronjob and run the update script. The goal being to shorten the time
required to process an update.
2014-04-13 14:11:19 +02:00
c2b6d459e9 Wrong order of decorators
We really need to clean the code up so this does not matter...
2014-01-02 12:04:54 +01:00
048a17ae4b Don't redirect dynamic CSS from https to http
This can break things (d'uh).

Do this by introducing a new decorator, @ssl_optional. When this is
present, no SSL redirection will happen, regardless of whether the
access comes in over http or https.

This decorator overrides @ssl_required, but for redability's sake,
never use both at the same time.
2014-01-02 12:00:32 +01:00
137d4295f3 Remove unused code causing warnings 2014-01-01 16:41:27 +01:00
756aa6ffbe Clean up imports
Remove unused imports and some other completely unused code.
2014-01-01 15:42:30 +01:00
48410d04fa Enable cache-busting URLs for CSS and JS
This will allow us to increase the cache times in the browser for our
CSS, which almost never changes.

Enables a new value to be used in templates, {{gitrev}}, which can be
used to bust pretty much any URL. We could do this for all the images
in the templates as well, but since most of them almost never change,
we'll just enable it manually for each individual image as it becomes
necessray - or just use a ?1, ?2 etc for those.

Enabled by default for CSS and JavaScript links, since those are much
more likely to be changed without having the URL changed.

Cache times aren't increased yet - we'll do that later one we're sure
that all existing caches are expired first.
2014-01-01 15:24:51 +01:00
6dfd884f16 Dynamically merge CSSes into a single one
This will make CSS downloading a single request, instead of making
6-7 requests for each page as it is now. It also moves all the definitions
of URLs for CSS into the templates and not in the raw CSS itself, which
will make it possible to enable client side caching in the future.

Fixes #91
2013-12-28 17:24:47 +01:00
3c543b357e List 5 events on homepage; move navigation / RSS feed links for events above "Upcoming Training"
List 5 events on homepage; move navigation / RSS feed links for events above "Upcoming Training"
To maintain the balance of the end columns, this patch also extends the list of
News articles and Planet postings to 7
2013-10-29 15:55:23 +00:00
d1535febb9 Make the varnish queue id configurable
This is required if the queue is dropped and recreated in pgq as it
gets a new id, which needs to be used when viewing the current status
of the queue in the admin interface.
2013-09-10 13:54:54 +02:00
bacb51e839 Don't have bots index /search/
We don't link statically to it anywhere, but people can link to it from
emails or other places around the world, that sets the search engines
on it's trail.
2013-09-05 18:16:43 +02:00
f31c58ddaa Fix beta versioning to be more generic test versioning
This allows us to specify both beta and rc versions.

Requires SQL:

ALTER TABLE core_version RENAME COLUMN beta TO testing;
ALTER TABLE core_version ALTER COLUMN testing TYPE integer USING CASE WHEN testing THEN 2 ELSE 0 END;
2013-08-22 14:45:33 +02:00
beaa87f162 Don't generate broken links to /docs/0.0/ in the sitemap
Generate proper /devel/ URLs, and then exclude them again in robots.txt
so we don't include them in google results, but we do include them in
our own.
2013-08-17 16:32:37 +02:00
8be717d99d Use a proper database field for beta releases
This replaces the previous ugly hack where beta versions had a negative number
as latestminor, giving a much cleaner model.

Requires SQL:
ALTER TABLE core_version ADD COLUMN beta boolean NOT NULL DEFAULT 'f';
ALTER TABLE core_version ALTER COLUMN beta DROP DEFAULT;

(Yes, we really need to move to something that can do automatic migrations)
2013-08-17 15:37:45 +02:00
4d773d447f Exclude some URLs from the archives in robots.txt
This makes no major changes from what was there before from a pure search
perspective:

* /message-id/flat/ was already flagged with a META tag to  be excluded from
  indexing, since it's the same data as /message-id/.
* /list/ was already flagged with a META tag to be excluded from indexing,
  since it carries no actual content, just links, and the links and descriptions
  of the lists is already available under /community/ as well.
* /message-id/raw/ required a login so it produced a bunch of 401's anyway,
  but this way we don't need to probe for that.

It's more efficient to block these things in robots.txt so we don't have to
spend the processing power to render a page that's not going to get indexed
anyway.
2013-07-10 09:59:23 +02:00
53cd5a83f5 Show purge type in list of recent varnish purges 2012-11-30 16:23:54 +09:00
a923f93b17 CSRF verification failure now returns HTTP 403 Forbidden, not 200 OK 2012-11-11 16:07:42 +01:00
6008f93843 Fix small bug in api_varnish_purge error path
HttpServerError is a function that returns HttpResponse, not an
exception.
2012-11-11 16:07:40 +01:00
6ba4f789ed Fix CSRF verification in /admin/mergeorg/ and /admin/purge/
All templates using {% csrf_token %} need to be rendered with a
RequestContext.

This reverts most of commit 58a08f2590

Also permit POST requests to /search/ -- these aren't relevant to the
site itself, but this used to be allowed before.
2012-11-11 13:19:29 +01:00
0a69f0b831 Add specific view for handling CSRF failures
This generates the error in a bit nicer way inside our framework,
instead of throwing the default django error.
2012-11-07 20:57:22 +01:00
58a08f2590 Remove csrf from more views that were broken 2012-11-07 18:43:45 +01:00
ef711553b9 Add (protected) API to queue varnish purge requests
We want an API for this so they end up in the queue with all the other
requests, and get delivered to all our frontends without needing each node
to know about which frontends exist.
2012-10-03 14:19:28 +02:00
33ed40343b Add support for varnish purging based on expressions
Previously we would only purge based on URLs, but some of the upcoming
new work requires arbitrary expression purging.

NOTE! Require the creation of the new SQL procecure in the database,
either from varnish.sql or varnish_local.sql depending on if it's prod
or dev.
2012-10-03 12:48:47 +02:00
1678c93db6 Oops, missed a number of references to publisher :O 2012-06-26 14:59:35 +02:00
de108bfa7c Allow the use of -1 as minor version to indicate pre-release 2012-05-14 17:05:14 -04:00
c2d330939f Include events that end today in the listing on the frontpage
Make check "greater-than-or-equal" instead of "greater-than".
2012-05-10 13:19:17 +02:00
3442fdde57 Allow all staff users (= admin login users) to purge things from varnish
Previously we required superuser, but that seems a bit excessive. We could
limit it based on specific groups, but for now, we'll allow all staff users.
2012-03-06 10:53:10 +01:00
78ab264578 Include last modified date in sitemap 2012-01-14 16:55:53 +01:00
08b9ac643f Render list of supported versions on the main page
Now that we have more metadata, we can render this on the main page instead of
on the wiki. This commit copies all the text from the current wiki page, and
uses the new fields in the Version model to render the table on the same URL
as the reference was on before.
2012-01-07 13:09:20 +01:00
8042d5a8bc Avoid crashing the frontpage when there are zero quotes
This won't happen in production since we don't delete quotes, but it
happens on empty dev environments. It still renders a pretty ugly
frontpage, but it doesn't crash...
2011-12-15 22:14:07 +01:00
f07c0db120 Include list of 20 latest purges in the varnish purging page (in /admin)
It's a way to keep track of what the system is doing, I guess...
2011-12-04 14:54:59 +01:00
3523989223 Pending page should require staff access, not superuser 2011-12-03 16:49:16 +01:00
e712f987ac Ensure that files we look for in the filesystem are ASCII filenames
We don't have any utf8 or latin1 in the filenames at this point, and
there's no reason to start adding it....

Fixes #111
2011-11-28 18:55:21 +01:00
74d8bdd647 Make account editing forms redirect back to list of objects
Instead of like previously, redirect back to the list of object
types.
2011-11-09 22:16:13 +01:00
afa81021b3 Make it possible to add and remove managers from an organisation
(from the general interface, not just from /admin/)
2011-11-09 22:16:12 +01:00
9e710e5456 For multilanguage pages, use english as default language
So we search both for <url>.html, and <url>/en.html. This is consistent
with how we access non-english languages.
2011-11-08 14:40:42 +01:00
1ab63a3d51 Ensure we always set Content-Length when getting the web_sync_timestamp
This is required by our own automirror scripts...
2011-11-07 16:04:47 +01:00
7874abc24d Add a sync_timestamp URL to point automirror at 2011-11-05 18:51:10 +01:00
961359bdab Validate superuser on "hidden" admin views 2011-08-18 10:46:36 +02:00
248d940c7e Implement proper mergeing of organisations 2011-08-18 10:46:25 +02:00
4ac854a2b0 Only include supported versions on the frontpage 2011-07-12 14:50:23 +01:00
09eb4f1d40 Properly quote URLs in the sitemap 2011-07-12 14:14:18 +01:00
121b336792 Remove print statement that cannot be used when running under a server 2011-06-14 19:51:00 +02:00
f92709d2a6 Implement basic varnish purging
This allows all models inherited from PgModel to specify which
URLs to purge by either setting a field or defining a function
called purge_urls, at which point they will be purged whenever
the save signal is fired.

Also implements a form under /admin/purge/ that allows for manual
purging. This should probably be extended in the future to show
the status of the pgq slaves, but that will come later.

Includes a SQL function that posts the expires to a pgq queue. For
a local deployment, this can be replaced with a simple void function
to turn off varnish purging.
2011-06-14 19:48:48 +02:00