Commit Graph

23 Commits

Author SHA1 Message Date
76900b7657 Teach varnish purging code about xkey purges
It's just another  type of purge, so it's added as an extra option with
'K' as the key (as 'X' was already taken).
2018-07-06 15:32:14 +02:00
01f2dc496b Include link_root in mail templates, and use
Instead of hardcoding www.postgresql.org, include the link_root variable
the same way we do in the global context when rendering pages, and use
that from the mail templates. Makes for a lot smoother workings in test
environments.
2018-06-14 16:31:06 +02:00
7d9ed68b46 Add support for setting recipient name and sender name 2017-12-18 16:21:01 +01:00
dfd46afae4 Send -bugs and -docs emails from noreply address
Sending from the submitters address runs afoul to DMARC and other
restrictions. Instead, send the email from a defined noreply address.
Instead, add the original submitter to both the Cc and the Reply-To
header, to make sure they receive followups.

Patch by Stephen, minor changes by Magnus
2017-12-18 15:59:18 +01:00
c06ece5dd8 Attempt to fix version sorting in ftp browser
There was already an ugly hack to handle this, so make it a bit uglier
with even more hardcoded assumptions. Seems to be working for the site
as it is now, but may definitely need further ugly hacks in the future.
2017-10-13 15:56:25 +02:00
097a732031 cc bugreports to the original submitter
This gives the submitter a chance to respond to their own message even
if it's not delivered through the list (for example, because they are
not subscribed, or because it's caught in moderation for other reasons).

Per discussion at the developer meeting.
2017-07-04 16:57:51 +01:00
92dcb0a23d Handle symlinks properly in the directory browser.
This change properly handles symlinks by expanding any it finds in the path
and issuing a redirect to the canonical location.

Whilst we're here, display links as such on the pages, sort directory listings
so the parent link is always at the top, and avoid unnecessary redirects caused
by missing /'s on URLs.
2016-11-30 17:51:33 +09:00
9bcaa6ab33 Remove the "is behind cache" functionality
We're always behind cache now (we may or may not be cached, but that's
not what this check was about)
2016-05-24 21:14:33 +02:00
7de55adb97 Fix long standing bug in determining remote IP
The check was for is_behind_cache without the (), meaning it always
returned true, which in turn meant we trusted all x-forwarded-for
headers. It was pretty hard to get them into the system, and
we didn't actually use it for anything other than locking survey
submissions, so it's not a big problem.

However, the basic logic was also wrong, as it assumes that all
SSL connections terminate directly at the backend server, which is
not necessarily true anymore.

The new version of the function will trust an X-Forwarded-For as
long as it's set on one of our frontend servers, regardless of if
it's an encrypted connection or not.
2015-12-17 17:36:00 +01:00
49643c4ab5 Add support for changing community account email
When changing an email, we generate a random token and send it to the
new email (the old email is verified by the fact that the user is
already logged in). Once the link in the email is clicked, we update
the actual email.
2015-01-21 21:22:16 +01:00
ffaccf95c0 Fix indentation
Yay for spaces vs tabs!
2014-03-01 14:08:43 -05:00
07902d6eda Remove obvious debugging code left in 2014-03-01 14:06:56 -05:00
1be7fe8e0c the sorting in the ftpbrowser for source tarballs has always been odd,
this is a small hack to make it better for the most common usecases...
2014-02-28 21:51:50 +01:00
bfa9b2a105 Track which emails are "user generated" for different antispam treatment
Basically, user generated email (bug report form) will be sent to the mail
frontends for antispam. Any errors generated there will be ignored and
the mails "dropped on the floor". Other emails keep entering the system
through localhost and delivered there.
2014-01-11 20:46:48 +01:00
8f0b7e6b50 Switch email sending go through a queue table in the database
Import the code from the PostgreSQL Europe website to handle this, since it's
well proven by now.

Any points that send email now just write them to the database using the
functions in queuedmail.util. This means we can now submit notification
emails and such things within transactions and have them properly roll bcak
if something goes wrong (so no more incorrect notifications when there is
a database error).

These emails are picked up by a cronjob that runs frequently (typically
once per minute or once every 2 minutes) that submits them to the local
mailserver. By doing it out of line, this gives us a much better way of
dealing with cases where mail delivery is really slow.

The submission from the cronjob is now done with smtp to localhost instead
of opening a pipe to the sendmail command - though this should have no
major effects on anything.

This also removes the setting SUPPRESS_NOTIFICATIONS, as no notifications
are actually ever sent unless the cronjob is run. On development systems
they will just go into the queuedmail table, and can be deleted from there.
2014-01-11 12:33:06 +01:00
6cef11c63c Use a fully qualified path to the sendmail binary
For some reason, it appears to work fine without it when used from
inside django, but fails when the cronjobs use the same function.
2011-12-12 16:01:45 +01: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
90f84636bf prettySize() is not used - we are already using the |filesize template
tag, which does the same thing in a much nicer way.
2010-06-17 15:05:11 +02:00
f17bb0219e Import required settings symbol 2010-06-17 14:14:53 +02:00
12cdc90e3e Implement is_behind_cache() and get_client_ip() functions to handle
the fact that when pages are served through Varnish, the request will come
from the Varnish server and not from the client.

Create a /system_information page that shows some information about the
connection to help diagnose how the caches work.
2010-06-17 14:11:50 +02:00
6c498a47a3 Factor out the sending of a templated mail to a function, we're sure
to want to use this in the future.
2010-01-12 19:50:50 +01:00
770ef1689e Break out sendmail() to a separate function, so we can use it from
more places.
2009-12-28 18:52:35 +01:00
90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00