Jelte Fennema-Nio [Tue, 24 Sep 2024 20:55:49 +0000 (22:55 +0200)]
Accept a Message-ID contained in < > characters
At least GMail will show the Message-ID including the < > characters.
Magnus Hagander [Thu, 11 Apr 2024 12:12:24 +0000 (14:12 +0200)]
Update to support django 4.2
Jonathan S. Katz [Sat, 19 Aug 2023 19:41:40 +0000 (15:41 -0400)]
Temporary remove Slack link
This was missed when pgweb@
8b420bfd4 was added.
Reported-by: Sehrope Sarkuni <sehrope@jackdb.com>
Magnus Hagander [Wed, 7 Jun 2023 20:21:31 +0000 (22:21 +0200)]
Sync up to latest version of pgweb auth plugin
Magnus Hagander [Tue, 16 May 2023 13:54:43 +0000 (15:54 +0200)]
Set a http header indicating which message an attachment came from
When an attachment is downloaded, add the http header
X-attached-to-message with the message-id of the message that the
attachment belongs to.
Célestin Matte [Tue, 11 Apr 2023 08:57:10 +0000 (10:57 +0200)]
Add JIS encodings to message loading
Magnus Hagander [Thu, 23 Mar 2023 09:44:27 +0000 (10:44 +0100)]
Replace reference to pep8 with pycodestyle
pep8 has been a deprecated name for a long time...
Célestin Matte [Thu, 23 Mar 2023 09:44:20 +0000 (10:44 +0100)]
Fix typo
Magnus Hagander [Mon, 19 Dec 2022 18:14:55 +0000 (19:14 +0100)]
Set rel=nofollow on link to "infinite" pages
Magnus Hagander [Fri, 15 Jul 2022 19:04:03 +0000 (21:04 +0200)]
Use as_bytes() instead of as_string() to generate mbox
We're supposed to feed django bytes, and by feeding it a string it got
converted bytes->string by the mail end and then string->bytes by
django. Which promptly blew up on bad encodings. By keeping it as bytes
all the way, the problem is ignored.
Magnus Hagander [Mon, 20 Jun 2022 16:05:05 +0000 (18:05 +0200)]
Switch to using community authentication for downloading raw messages
Too many browsers have changed the wrong way and doesn't actually prompt
people properly, which means they try to log in with a bunch of random
things, none of them being "archives/antispam". So instead, send them
off to do a community login, now that we have support for this (which
was added when we added message re-sending).
If the request comes in with the authentication header already on it and
it being a valid archives/antispam combination, keep allowing that so we
don't break scripts and plugins that we don't have to break.
Magnus Hagander [Fri, 1 Apr 2022 14:00:50 +0000 (16:00 +0200)]
Fix bytes/str handling of secondary text parts in messages
This was broken in the python 2->3 migration, but is apparently an
uncommon enough case that it wasn't properly spotted until now.
Reported and pointers in the right direction from Andres Freund
Magnus Hagander [Sun, 30 Jan 2022 12:16:55 +0000 (13:16 +0100)]
Ensure pglister_sync includes a value for subscriber_access
This has a default=False set in the django model, but django does not
propagate that into the database which would cause the insert of new
lists to fail with a not-null-violation.
Spotted by Célestin Matte
Célestin Matte [Sat, 15 Jan 2022 17:48:04 +0000 (18:48 +0100)]
Fix default authentication configuration
Add the required authentication backend configuration and include an
example for how to set up the pgauth plugin.
Magnus Hagander [Sat, 15 Jan 2022 17:36:29 +0000 (18:36 +0100)]
Allow configuration of upstream pgweb address
Search forms currently point to the hardcoded address of www.postgresql.org.
Add a parameter in the settings to make it possible to configure the domain
hosting the /search/ function.
Originally from Célestin Matte, but in the end not his patch
Célestin Matte [Tue, 30 Nov 2021 20:03:00 +0000 (21:03 +0100)]
Allow use of IP ranges for API_CLIENTS
Célestin Matte [Mon, 25 Oct 2021 15:01:03 +0000 (17:01 +0200)]
Add pglister section in archives.ini.sample
This section is expected by pglister_sync.py but missing from the sample file
Magnus Hagander [Sun, 7 Nov 2021 14:11:43 +0000 (15:11 +0100)]
Add DEFAULT_AUTO_FIELD for Django 3.2
Magnus Hagander [Thu, 4 Nov 2021 10:35:48 +0000 (11:35 +0100)]
Fix ancient error fromt he 2to3 conversion
Spotted by Célestin Matte
Célestin Matte [Wed, 27 Oct 2021 13:40:45 +0000 (15:40 +0200)]
Allow use of IP ranges for SEARCH_CLIENTS
Allows the use of IP ranges in CIDR format in the SEARCH_CLIENTS
parameter. Individual addresses can still be specified and continue to
work like before.
Magnus Hagander [Sat, 23 Oct 2021 14:25:38 +0000 (16:25 +0200)]
Clean up accidentally commited files
Back in 2018, commit
4d159ca accidentally included unrelated
functionality which was not completed. This causes the database to be
out of sync with the models defined in the code.
This commit reverts those parts that were not supposed to be included
and leaves the changes that actually were. The code can be re-added once
completed...
Spotted by Célestin Matte
Magnus Hagander [Mon, 24 May 2021 10:48:16 +0000 (12:48 +0200)]
Properly quote URL in link to resend an email
The lack of this would result in a 404 for any users who clicked a
resend link when (1) they were not logged in, and (2) the messageid
cotnained a plus character. This would then end up getting unescaped
one too many times in the authentication flow and came out as a space on
the other end instead of a plus.
Reported by Justin Pryzby (and several others, but Justin was persistant
in tracking down good examples)
Magnus Hagander [Tue, 2 Mar 2021 09:25:53 +0000 (10:25 +0100)]
Replace @postgresql.org with @lists.postgresqql.org
When suggesting which lists people should use first, we should use the
recommended name for the list.
Magnus Hagander [Fri, 26 Feb 2021 10:23:06 +0000 (11:23 +0100)]
Add EOT format of fa fonts
This was done in pgweb at
a0583746, but should be done here as well to
serve the browsers with what they primarily ask for.
Jonathan S. Katz [Fri, 8 Jan 2021 19:05:03 +0000 (14:05 -0500)]
Do not set fixed width for thread selector dropdown box
There were cases that the fixed width for this box would cause the
thread selector to explode outside of the email header table in the
thread viewer. We should keep the select dropdown itself to the width
of the overall list of email addresses in the chain.
Magnus Hagander [Mon, 2 Nov 2020 20:00:04 +0000 (21:00 +0100)]
Fix description of systemd service in template
Magnus Hagander [Thu, 29 Oct 2020 16:50:21 +0000 (17:50 +0100)]
Properly quote URL for login redirect in private archives
Without the proper quoting, having a + sign in a message-id would get
unquoted to a space before sending the user off to the community
authentication, which in turn would then redirect back to the incorrect
url.
Reported by Noah Misch
Magnus Hagander [Wed, 21 Oct 2020 17:01:48 +0000 (19:01 +0200)]
Use article:author instead of og:article:author
The specification is a bit unclear on which it should be and completely
unclear about what should go in the field, but at least it seems most
implementations use article:author rather than og:article:author, so try
changing it.
Also change og:published_time to be article:published_time.
Magnus Hagander [Wed, 21 Oct 2020 09:38:33 +0000 (11:38 +0200)]
Add opengraph metatags to messages
This makes for nicer "previews" on for example twitter when posting
links.
Suggested by Andres Freund
Magnus Hagander [Tue, 11 Aug 2020 10:21:18 +0000 (12:21 +0200)]
Update to latest version of community auth plugin
This includes support for receiving updates through the push api.
Magnus Hagander [Tue, 11 Aug 2020 10:21:02 +0000 (12:21 +0200)]
Remove unused import
Magnus Hagander [Thu, 16 Jul 2020 13:47:14 +0000 (15:47 +0200)]
Updaate regexp escaping syntax to please pep8
Magnus Hagander [Thu, 16 Jul 2020 13:46:51 +0000 (15:46 +0200)]
Update exception catching syntax to please pep8
Stephen Frost [Wed, 15 Jul 2020 13:29:02 +0000 (09:29 -0400)]
Improvements to main lists page
Rename title above Tips to be about Tips, add paragraph talking about
how to Unsubscribe.
Jonathan S. Katz [Tue, 2 Jun 2020 18:40:37 +0000 (14:40 -0400)]
Update reference to Archives Policy
This was pointing to the Wiki page, which was pointing to
a different page on .org
Magnus Hagander [Mon, 1 Jun 2020 14:40:01 +0000 (16:40 +0200)]
Support overwriting messages in load_messages.py
Previously overwriting was only allowed from reparse_messages.py, in
which case it would only reparse the existing message. For the usecase
of overwriting the raw contents and then also reparsing the result, the
--overwrite switch can now be passed to load_messages.py.
Magnus Hagander [Tue, 14 Apr 2020 15:57:58 +0000 (17:57 +0200)]
Extra quote the url from 'next' in authentication
If the next URL contained a + django would helpfully change that into a
space, which broke things further down the chain. So put back this
escaping, in the hope that the redirect will be correct down the road.
This fixes is for spaces, let's hope it doesn't instead break it for
something else.
Magnus Hagander [Fri, 3 Apr 2020 11:20:58 +0000 (13:20 +0200)]
Fix rendering of attachments and raw messages
It seems older django implicitly added a bytes() around bytea fields
returned from psycopg2. The actual change happened around the python3
move, but django painted over the differences so we didn't realize it
needed to be changed.
Magnus Hagander [Wed, 1 Apr 2020 18:43:44 +0000 (20:43 +0200)]
Update middleware and config for Django 2.2
Magnus Hagander [Wed, 1 Apr 2020 18:43:26 +0000 (20:43 +0200)]
is_authenticated is no longer a callable in newer Django
Magnus Hagander [Wed, 1 Apr 2020 18:35:45 +0000 (20:35 +0200)]
Use OneToOne field for unique Foreign Key
Magnus Hagander [Wed, 1 Apr 2020 18:34:05 +0000 (20:34 +0200)]
Mark all ForeignKeys as on_delete=CASCADE
Magnus Hagander [Mon, 30 Mar 2020 19:51:25 +0000 (21:51 +0200)]
Set a timeout for sendinv Varnish purge requests
Timeout error is better than hanging forever. Set a timeout for 30
seconds which is with a big margin longer than should ever be needed.
Magnus Hagander [Wed, 29 Jan 2020 09:32:51 +0000 (10:32 +0100)]
Fix logging of load errors
Broken in python3 migration, shows how often we have load errors these
days.
Magnus Hagander [Wed, 29 Jan 2020 09:32:45 +0000 (10:32 +0100)]
Fixes for newer pep8
Magnus Hagander [Sat, 13 Jul 2019 17:05:33 +0000 (19:05 +0200)]
Ensure permissions check on "resend complete"
This page just says the resend has completed, but a user having the
messageid but subscribed to a *different* list on the same server could
leak the existance of the email.
Magnus Hagander [Thu, 20 Jun 2019 18:08:44 +0000 (20:08 +0200)]
Fix copy/paste error
Magnus Hagander [Thu, 20 Jun 2019 11:05:51 +0000 (13:05 +0200)]
Don't issue xkey headers for private archives
Magnus Hagander [Thu, 20 Jun 2019 08:42:16 +0000 (10:42 +0200)]
Remove headers for legacy purging
Now that we use xkey for purging, no need to keep the old headers
around.
Magnus Hagander [Wed, 19 Jun 2019 20:44:25 +0000 (22:44 +0200)]
Remove extra : at end of xkey
Magnus Hagander [Wed, 19 Jun 2019 20:32:10 +0000 (22:32 +0200)]
Fix typo
Magnus Hagander [Wed, 19 Jun 2019 19:39:20 +0000 (21:39 +0200)]
Use xkey instead of regexp when purging threads and lists
Magnus Hagander [Wed, 19 Jun 2019 19:14:19 +0000 (21:14 +0200)]
Re-think rate limiting for resending
The way it was done ended up defeaeting the service sending things right
away for people who did *not* violate the rate limit.
So instead, keep track of exactly when the last email was sent for each
user, and rate-limit based on that.
Magnus Hagander [Wed, 19 Jun 2019 16:48:38 +0000 (18:48 +0200)]
Fix incorrect sign
Magnus Hagander [Wed, 19 Jun 2019 16:46:55 +0000 (18:46 +0200)]
Actually enforce rate limiting
Forgot to commit the changes to the sender
Magnus Hagander [Tue, 18 Jun 2019 20:25:59 +0000 (22:25 +0200)]
Fix typo
Magnus Hagander [Tue, 18 Jun 2019 20:12:45 +0000 (22:12 +0200)]
Implement basic rate limiting for sending email
Per-user limit that says how many seconds must go between each email.
Outgoing emails are also delayed by this much (or we'd miss it)
Magnus Hagander [Tue, 18 Jun 2019 19:52:48 +0000 (21:52 +0200)]
Don't allow duplicate requests for the same email to be resent
To the same user, that is.
Magnus Hagander [Tue, 18 Jun 2019 17:21:57 +0000 (19:21 +0200)]
Eat initial "From" line when sending from archives
Magnus Hagander [Tue, 18 Jun 2019 16:37:06 +0000 (18:37 +0200)]
Ensure session and csrf cookies are secure
Magnus Hagander [Tue, 18 Jun 2019 16:08:20 +0000 (18:08 +0200)]
Only require a user to be subcsribed on hidden archives
For hidden archives, it makes sense to require a subscription in order
to be allowed to log in. But for public archives, any user should be
able to log in to request a re-send of a message.
Magnus Hagander [Tue, 18 Jun 2019 14:55:47 +0000 (16:55 +0200)]
Allow authentication urls under /list/_auth/
This allows the authentication to work even when used behind a varnish
proxy that eats all other URLs than those directly to the archives.
To make use of this, LOGIN_URL must also be changed to point to
/list/_auth/accounts/login/, and the entry in the community
authentication system must point to /list/_auth/auth_receive/.
Magnus Hagander [Tue, 18 Jun 2019 12:24:06 +0000 (14:24 +0200)]
Add xkey headers to outgoing emails
Instead of just our own x-pglm and x-pgthread, add specific xkey
headers. These are used by our Varnish frontends to purge more
efficiently.
For the time being, leave the older headers in place -- we need to have
the entire contents of the cache containing xkey headers before we can
start using xkey for purging, and only once that is done we will be able to
remove the non-xkey headers.
Magnus Hagander [Tue, 18 Jun 2019 11:41:58 +0000 (13:41 +0200)]
Implement email resending in the list archives
This allows a logged-in user to get an email delivered to their mailbox,
thereby making it easy to reply to even if they haven't got it already
(and don't have a MUA capable of handling mbox files).
The email body will go out unmodified (including any list headers that
are stored in the archives, but this does not include for example the
unsubscribe link). Envelope sender is set to one configured in the ini
file, and envelope recipient is set to the email address of the user.
Magnus Hagander [Tue, 18 Jun 2019 11:18:54 +0000 (13:18 +0200)]
Remove settings entry from sample that are not used
Magnus Hagander [Tue, 18 Jun 2019 09:38:53 +0000 (11:38 +0200)]
Unicode fixes in migrations
Missed in py3 migration
Magnus Hagander [Fri, 17 May 2019 12:03:14 +0000 (14:03 +0200)]
Ensure array of usernames are text[]
Empty arrays otherwise have no types in PostgreSQL, which would cause an
error.
Magnus Hagander [Tue, 2 Apr 2019 13:57:24 +0000 (15:57 +0200)]
Make sure permissions check on individual messages checks subscriber_access
We already did that check in the list of emails, but not on the
individual email.
Magnus Hagander [Sat, 23 Feb 2019 21:32:53 +0000 (22:32 +0100)]
Fix URLs for attachments
Previous commit forgot to move the rules for attachment up, which
basically broke them. Oops.
In passing also fix for legacy redirects, though they're not really in
use anymore.
Magnus Hagander [Fri, 22 Feb 2019 14:09:51 +0000 (15:09 +0100)]
Fix URL matchiong for messages with slash in msgid
Our URL patterns assumed that there would never be a slash in a
messageid. It's been extremely uncommon, so this case has been missed
before, but now it turns out GitHub have started doing that with their
commit messages so it becomes more common.
Jonathan S. Katz [Mon, 4 Feb 2019 16:40:42 +0000 (11:40 -0500)]
Pin the navigation bar to the top of the page.
From user feedback, the scrolling navigation bar would cause problems with
readability, especially in larger font views. This keeps the navigation bar
pinned to the top, until we can find a way to more easily handle this.
In the context of pgarchives, this is one bit of "future-proofing" as we do not
currently show the shout box in pgarchives, but may do so in the near future.
Magnus Hagander [Tue, 8 Jan 2019 10:05:14 +0000 (11:05 +0100)]
Fix date parsing to be even more forgiving
In particular, if parsing the date either fails or if it results in a
date that's in the future, fall back to parsing the dates out of the
Received: headers instead, because at some point there we will find a
parsable date for sure (if not before then when it hit one of our own
servers)
Magnus Hagander [Mon, 7 Jan 2019 11:34:10 +0000 (12:34 +0100)]
Detect and show date changes in reparse message
Magnus Hagander [Mon, 7 Jan 2019 11:30:25 +0000 (12:30 +0100)]
Remove clean_date.py, because it relied on the old archives
Magnus Hagander [Fri, 4 Jan 2019 20:03:31 +0000 (21:03 +0100)]
Don't crash on authenticaiton with colon in the password
It's supposed to be archives/antispam, but if a password with an actual
colon sign in it was used, it'd crash instead of asking for auth again.
Magnus Hagander [Fri, 4 Jan 2019 15:06:19 +0000 (16:06 +0100)]
Remove placeholder base.css
Haven't used this for ages since we load dynamically.
Magnus Hagander [Fri, 4 Jan 2019 15:05:33 +0000 (16:05 +0100)]
Load stylesheet using link instead of import
Magnus Hagander [Fri, 4 Jan 2019 15:02:25 +0000 (16:02 +0100)]
Remove jquery-ui selectmenu plugin as it's not used
Magnus Hagander [Fri, 4 Jan 2019 14:58:55 +0000 (15:58 +0100)]
Get rid of inline javascript
This moves the javascript out to the main.js file like we already had
done for the main website.
This also removes attempts to use the selectmenu plugin for the
dropdown. This has not worked since the new design was put in place,
because the appropriate scripts were simply never loaded. As people
seems to be happy with that, stop *trying* to load them causing
javascript failures on every webpage.
Magnus Hagander [Fri, 4 Jan 2019 12:44:16 +0000 (13:44 +0100)]
Fix variable reference in thread API
This should never have worked, but as the old python version would leak
the last message in the previous loop, it did work. As all messages have
the same threadid (when they're on teh same thread), just us the one in
the known-existing message instead.
Magnus Hagander [Thu, 3 Jan 2019 21:00:32 +0000 (22:00 +0100)]
Add pep8 commit hook and config file
Magnus Hagander [Thu, 3 Jan 2019 20:57:48 +0000 (21:57 +0100)]
Fix comparison operators
Magnus Hagander [Thu, 3 Jan 2019 20:56:31 +0000 (21:56 +0100)]
Fix incorrect import
Magnus Hagander [Thu, 3 Jan 2019 20:56:09 +0000 (21:56 +0100)]
Fix bad multi-command lines
Magnus Hagander [Thu, 3 Jan 2019 20:52:58 +0000 (21:52 +0100)]
Whitespace fixes
Magnus Hagander [Thu, 3 Jan 2019 20:30:45 +0000 (21:30 +0100)]
Fix indentation
Per pep8 warnings, adjust indentation for consistency
Magnus Hagander [Thu, 3 Jan 2019 20:15:38 +0000 (21:15 +0100)]
Tabs to 4 spaces
pep8 standard for indentation
Magnus Hagander [Thu, 3 Jan 2019 10:59:40 +0000 (11:59 +0100)]
Update django app to python 3
Magnus Hagander [Thu, 3 Jan 2019 10:14:30 +0000 (11:14 +0100)]
Trap internal AssertionError from python libraries
For some really broken messages, we end up in a cannot-happen codepath.
Trap this one and just consider that MIME part empty, and try again
later.
In passing, also change it so we continue loading after failures of parsing.
We continued in the mode where we just generated diffs, but not when
making updates. Now continue in both cases, but of course don't do the
actual update if the parsing failed.
Magnus Hagander [Thu, 3 Jan 2019 10:04:29 +0000 (11:04 +0100)]
Update loader scripts to use python3 syntax
Some minor cleanups as well, but mostly just the output of the 2to3 tool
and some manual changes.
Magnus Hagander [Thu, 3 Jan 2019 10:01:56 +0000 (11:01 +0100)]
Use "in" syntax instead of has_key()
has_key() has been deprecated for a while and will be gone in Python3.
The in syntax is available in both the old and the new versions.
Magnus Hagander [Sat, 29 Dec 2018 13:40:50 +0000 (14:40 +0100)]
Fix bad indentation
Magnus Hagander [Mon, 3 Dec 2018 15:18:21 +0000 (16:18 +0100)]
Track load date of messages
Magnus Hagander [Fri, 30 Nov 2018 02:36:02 +0000 (03:36 +0100)]
Switch to using tidylib rather than tidy
tidylib (http://countergram.github.io/pytidylib/) is maintained,
the old tidy one (https://cihar.com/software/utidylib/) is not. And in
particular, python3 support is in the new one.
Generates some minor changs in the existing archives, but it seems to be
just whitespace and some actual incorrectness in the old output.
Magnus Hagander [Thu, 29 Nov 2018 16:01:22 +0000 (17:01 +0100)]
Use advisory lock around load_message.py
Avoid loading two messages at the same time. In particular this can
cause issues if it's two copies of the same message on different lists,
which can cause a UNIQUE violation in the loader. It could also be a
problem if two messages on a new thread arrives in parallel, which could
cause two separate threads to be created.
This could be made more efficient by properly ordering the operations on
storage and using ON CONFLICT, but it's a very rare occassion and it
doesn't matter that we have to wait for a second or two for a previous
storage to complete.
Magnus Hagander [Tue, 20 Nov 2018 20:44:56 +0000 (21:44 +0100)]
Actually return the response when rendering raw view of hidden message
Magnus Hagander [Tue, 20 Nov 2018 20:29:22 +0000 (21:29 +0100)]
Remove spaces in messageids
They shouldn't be there in the first place. Sigh. But if they're there
just pretend they don't exist, so we get a working messageid.
Magnus Hagander [Tue, 20 Nov 2018 19:57:02 +0000 (20:57 +0100)]
Proper attempt at correctly updating header fields
Magnus Hagander [Tue, 20 Nov 2018 19:52:59 +0000 (20:52 +0100)]
Revert "Actually update header fields when they have changed"
That commit was backwards. Oops.
Magnus Hagander [Tue, 20 Nov 2018 14:18:25 +0000 (15:18 +0100)]
Fix accidental reversing of printed manual header diffs