summaryrefslogtreecommitdiff
path: root/pgweb/util/misc.py
AgeCommit message (Collapse)Author
2020-04-20Set headers for no auto response on most emailsMagnus Hagander
Most of our auto-generated emails should not ask for auto replies (like out of office messages or in particular, "held for moderation" notices from our own list server), so set this header by default, and also the header indicating if it's an auto submitted/auto replied message. Specifically allow auto replies on moderation notices, since that's a case where it might be really interesting for the moderator to see for example an out of office message. At least for now that seems like a good idea.
2020-01-09Fix a number of incorrect escapesMagnus Hagander
Pointed out by newer versions of pep8, but they were never correct.
2019-11-01Switch to using pycryptodome instead of pycryptoMagnus Hagander
pycrypto is not being maintained, and pycryptodome is theoretically a drop-in replacement (in practice, it seems it was close)
2019-01-17Fix deprecated comparison structsMagnus Hagander
2019-01-17Fix whitespace and indentation, per pep8Magnus Hagander
2019-01-17Tabs, meet your new overlords: spacesMagnus Hagander
In a quest to reach pep8, use spaces to indent rather than tabs.
2018-09-24Generate bug-specific messsageids when generating bug reportsMagnus Hagander
This makes the messageids shorter and easier to identify when linking to them in the archives.
2018-07-06Teach varnish purging code about xkey purgesMagnus Hagander
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-06-14Include link_root in mail templates, and useMagnus Hagander
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.
2017-12-18Add support for setting recipient name and sender nameMagnus Hagander
2017-12-18Send -bugs and -docs emails from noreply addressStephen Frost
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-10-13Attempt to fix version sorting in ftp browserMagnus Hagander
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-07-04cc bugreports to the original submitterMagnus Hagander
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.
2016-11-30Handle symlinks properly in the directory browser.Dave Page
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-05-24Remove the "is behind cache" functionalityMagnus Hagander
We're always behind cache now (we may or may not be cached, but that's not what this check was about)
2015-12-17Fix long standing bug in determining remote IPMagnus Hagander
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-01-21Add support for changing community account emailMagnus Hagander
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.
2014-03-01Fix indentationMagnus Hagander
Yay for spaces vs tabs!
2014-03-01Remove obvious debugging code left inMagnus Hagander
2014-02-28the sorting in the ftpbrowser for source tarballs has always been odd,Stefan Kaltenbrunner
this is a small hack to make it better for the most common usecases...
2014-01-11Track which emails are "user generated" for different antispam treatmentMagnus Hagander
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-11Switch email sending go through a queue table in the databaseMagnus Hagander
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.
2011-12-12Use a fully qualified path to the sendmail binaryMagnus Hagander
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-06-14Implement basic varnish purgingMagnus Hagander
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.
2010-06-17prettySize() is not used - we are already using the |filesize templateMagnus Hagander
tag, which does the same thing in a much nicer way.
2010-06-17Import required settings symbolMagnus Hagander
2010-06-17Implement is_behind_cache() and get_client_ip() functions to handleMagnus Hagander
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-01-12Factor out the sending of a templated mail to a function, we're sureMagnus Hagander
to want to use this in the future.
2009-12-28Break out sendmail() to a separate function, so we can use it fromMagnus Hagander
more places.
2009-09-14A first very basic import.Magnus Hagander
Contains basic functionality, and an import of most of the static content from the old site. There is still plenty more to do...