20 Commits

Author SHA1 Message Date
a92b26c821 Update requirements reflecting we're now on django 4.2 2024-05-08 10:45:05 +02:00
901a5465f7 Switch to using Django 3.2
3.2 is the next LTS, and the fixes to make it work went in some time
ago. Now pulling the trigger and updating the prod website.
2021-12-19 12:10:57 +01:00
d64030ee9b Update version of cvss module 2021-01-13 22:11:11 +01:00
4734156bbe Add a missing requirement to requirements.txt
This is default in most installations -- but clearly not all.
2021-01-01 16:18:55 +01:00
ea9becd746 Re-do markdown handling for better user experience and security
* Get rid of the django_markwhat dependency, and implement our own
  classes to get more control. In passing also remove django-markdown,
  because we never used that.
* Instead of trying to clean markdown with regexps, use the bleach
  library (NEW DEPENDENCY) with special whitelisting of allowed tags
  based off standard markdown. This means that one can input links or
  formatting in HTML if one prefers, as long as it renders to the same
  subset of tags that markdown allows.
* Replace javascript based client side preview with an actual call to a
  preview URL that renders the exact result using the same function,
  since the use of showdown on the client was increasingly starting to
  differ from the server, and since that cannot be kept secure the same
  way. Rewrite the client side javascript to work better with the now
  longer interval between updates of the preview.

Long in planning, but never got around to it.

Suggestion to use bleach for escaping from David Fetter.
2020-11-12 18:52:04 +01:00
568c8ffeb3 Fix Babel requirement in requirements.txt
Should be "==" instead of just a "="
2020-11-06 09:39:42 -05:00
f4d7c746fd Add a filter for getting language name from code
This adds a requirement on the Babel module in python.
2020-10-28 16:39:27 +01:00
e4453cdda9 Add support for sending out news as HTML email
When a news article is approved, it gets delivered as an email to the
pgsql-announce mailinglist. It will render the markdown of the news
article into a HTML part of the email, and include the markdown raw as
the text part (for those unable or unwilling to read html mail).

For each organisation, a mail template can be specified. Initially only
two templates are supported, one "default" and one "pgproject" which is
for official project news. The intention is *not* to provide generic
templates, but we may want to extend this to certain related projects in
the future *maybe* (such as regional NPOs).

These templates are stored in templates/news/mail/*.html, and for each
template *all* images found in templates/news/mail/img.<template>/ will
be attached to the email. "Conditional image inclusion" currently not
supported.

To do CSS inlining on top of the markdown output, module pynliner is now
required (available in the python3-pynliner package on Debian).

A testing script is added as news_send_email.py in order to easier test
out templates. This is *not* intended for production sending, so it will
for example send unmoderated news. By sending, it adds it to the
outgoing mailqueue in the system, so unless the cronjob is set up to
send, nothing will happen until that is run manually.

Support is included for tagged delivery using pglister, by directly
mapping NewsTags to pglister tags.

While at it, update the moderation preview forms to preview news items
using the HTML template for the email (while leaving other types of
items previewing without a particular stylesheet).
2020-09-10 14:52:41 +02:00
2e1321a1dc Update requirements.txt to match current production env 2020-08-25 13:23:56 +02:00
c53d88980a Update requirements versions
Update to django 2.2. Also update a number of older dependencies that
were actually already incorrect before the djago upgrade, and the
deployed versions were newer, but we forgot to update the requirements
file.
2020-04-03 19:08:37 +02:00
596503a1ae Bump pycodestyle version 2020-01-09 13:28:02 +01:00
12306255ad Switch to using pycryptodome instead of pycrypto
pycrypto is not being maintained, and pycryptodome is theoretically
a drop-in replacement (in practice, it seems it was close)
2019-11-01 14:52:35 +01:00
a7a7400d09 Update django version in requirements.txt
Update to one that says "django 1.11.<latest>", so we don't have to keep
updating it.
2019-11-01 12:02:34 +01:00
ff4d6de97a Update requirements.txt for new django version in prod 2019-06-28 14:22:25 +02:00
3c3a117b66 Added pycodestyle to requirements.txt and pre-commit hook. 2019-03-10 11:40:05 -07:00
c4cce24d7d Bring requirements.txt up-to-date for Python 3 libs.
Hopefully makes it easier for people to get up and running.
2019-01-26 14:22:03 -05:00
9a77d1747a Implement support for Oauth2 based login integrations
This creates Google, Github, Microsoft and Facebook login integrations.
Other providers can also be added if needed. Accounts still need to be
created in the community auth system, and will be automatically created
on first login, when the user also gets to pick a username. Once an
account exists, it will be matched on email address from the external
systems.

No methods are enabled by default, as they all require encryption keys
and identities configured in local_settings.py.

Review by Stephen Frost, Jonathan Katz and Daniel Gustafsson.
2017-08-28 16:31:57 +02:00
397fbe3c0d Updated "requirements.txt" with Django 1.8.13 and django_markwhat 1.4 referenced 2016-05-14 14:53:52 -04:00
51c10ee9df Replace simpljson imports with json
This has been in standard python since 2.6, and we don't really care
about supporting anything older than that (even our old and soon to
be upgraded environments use 2.7)
2015-12-12 17:44:22 +01:00
0782b2714f Add a pip requirements file for virtualenv deployments 2013-06-16 16:35:21 +02:00