Skip to content

Commit

Permalink
Merge pull request #222 from lcduong/sync-upstream-oct
Browse files Browse the repository at this point in the history
Sync upstream commit
  • Loading branch information
mariobehling authored Oct 7, 2024
2 parents cdbc117 + fc68344 commit 6813587
Show file tree
Hide file tree
Showing 385 changed files with 8,138 additions and 6,559 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
working-directory: ./doc
- name: Fail if there were spelling errors
run: '! find _build -type f -name "*.spelling" | grep -q .'
run: '! find _build -type f -name "*.spelling" | grep -q . || true'
working-directory: ./doc

linkcheck:
Expand All @@ -64,3 +64,10 @@ jobs:
- name: Linkcheck docs
run: make linkcheck
working-directory: ./doc
- name: Put linkcheck result into summary
run: |
echo "## Linkcheck results" >> $GITHUB_STEP_SUMMARY
sed 's/^/- /' < _build/linkcheck/output.txt >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
working-directory: ./doc
if: always()
15 changes: 15 additions & 0 deletions .github/workflows/matchers/black.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"problemMatcher": [
{
"owner": "black",
"severity": "error",
"pattern": [
{
"regexp": "^(would reformat) (.+)$",
"file": 2,
"message": 1
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
sudo apt update
sudo apt install gettext
- name: Install Python dependencies
run: python -m pip install -e ".[dev]"
run: python -m pip install -e ".[dev]" polib
- name: Compile locales
run: python manage.py compilemessages
working-directory: ./src
12 changes: 7 additions & 5 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
cache: "pip"
- name: Install Dependencies
run: python -m pip install -Ue ".[dev]"
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Run flake8
run: flake8 .
working-directory: ./src
Expand All @@ -56,11 +58,11 @@ jobs:
with:
python-version-file: ".github/workflows/python-version.txt"
cache: "pip"
- name: Install Dependencies
run: python -m pip install -Ue ".[dev]"
- name: Run black
run: black --check .
working-directory: ./src
- name: Add problem matcher for black
run: echo "::add-matcher::.github/workflows/matchers/black.json"
- uses: psf/black@stable
with:
src: "./src"
html:
name: HTML checks
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
database: [sqlite, postgres]
python-version: [ 3.11 ]
database: [ sqlite, postgres ]
steps:
- uses: actions/checkout@v4
- uses: harmon758/postgresql-action@v1
Expand Down Expand Up @@ -71,6 +71,7 @@ jobs:
PRETALX_CONFIG_FILE: 'tests/ci_${{ matrix.database }}.cfg'
- name: Show coverage as build info
working-directory: ./src
shell: bash # needed to make echo work as expected
run: |
python -m coverage json
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ spelling:
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
@echo
@echo "Spelling check finished, look at the results in " \
"$(BUILDDIR)/spelling/output.txt."
"$(BUILDDIR)/spelling/*."
2 changes: 1 addition & 1 deletion doc/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2>Project information</h2>

If you’d like to contribute to pretalx, you are most welcome! We have written
a little about how to get started
<a href="https://docs.pretalx.org/developer/index.html">here</a>.
<a href="https://docs.pretalx.org/developer/">here</a>.
</p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion doc/administrator/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The database section
- **Default:** ``sqlite3``

+------------+----------------------+-----------------------+
| Database | Configuration string | pip packag e |
| Database | Configuration string | pip package |
+============+======================+=======================+
| PostgresQL | ``postgresql`` | ``pretalx[postgres]`` |
+------------+----------------------+-----------------------+
Expand Down
94 changes: 24 additions & 70 deletions doc/administrator/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ and configuration here, but please have a look at the linked pages.

* **Python 3.11 or newer**
* An SMTP server to send out mails
* An HTTP reverse proxy like `nginx`_ to allow HTTPS connections
* * A database server: `PostgreSQL`_ 12+, or SQLite
Note: Support for MySQL and MariaDB has been removed to streamline compatibility and leverage advanced features available in PostgreSQL.
3. Given the choice, we’d recommend to use PostgreSQL.
* An HTTP reverse proxy like `nginx`_ to allow HTTPS connections and serve
files from the filesystem
* A database server: `PostgreSQL`_ 13+, or SQLite 3. Given the choice, we’d
recommend to use PostgreSQL.
* A `redis`_ server, if you want to use pretalx with an asynchronous task
runner or improved caching.
* `nodejs`_ and npm (usually bundled with nodejs). You’ll need a `supported
Expand Down Expand Up @@ -59,8 +59,8 @@ As we do not want to run pretalx as root, we first create a new unprivileged use
Step 2: Database setup
----------------------

pretalx runs with PostgreSQL or SQLite. If you’re using
SQLite, you can skip this step, as there is no need to set up the database.
pretalx runs with PostgreSQL or SQLite. If you’re using SQLite, you can skip
this step, as there is no need to set up the database.

We recommend using PostgreSQL. This is how you can set up a database for your
pretalx installation – if you do not use PostgreSQL, please refer to the
Expand All @@ -73,8 +73,6 @@ Make sure that your database encoding is UTF-8. You can check with this command:

# sudo -u postgres psql -c 'SHOW SERVER_ENCODING'

.. highlight:: sql


Step 3: Package dependencies
----------------------------
Expand Down Expand Up @@ -138,7 +136,7 @@ Now, upgrade your pip and then install the required Python packages::
+=================+========================================================================+
| SQLite | ``pip install --user --upgrade-strategy eager -U pretalx`` |
+-----------------+------------------------------------------------------------------------+
| PostgreSQL | ``pip install --user --upgrade-strategy eager -U "pretalx[postgres]"`` |
| PostgreSQL | ``pip install --upgrade-strategy eager -U "pretalx[postgres]"`` |
+-----------------+------------------------------------------------------------------------+

If you intend to run pretalx with asynchronous task runners or with redis as
Expand Down Expand Up @@ -211,73 +209,29 @@ You can now run the following commands to enable and start the services::
# systemctl enable pretalx-web pretalx-worker
# systemctl start pretalx-web pretalx-worker

Step 7: SSL
-----------

.. highlight:: nginx
Step 7: Reverse proxy
---------------------

You’ll need to set up an HTTP reverse proxy to handle HTTPS connections. It doesn’t
particularly matter which one you use, as long as you make sure to use `strong
encryption settings`_. Your proxy should
You’ll need to set up an HTTP reverse proxy to handle HTTPS connections. It
does not particularly matter which one you use, as long as you make sure to use
`strong encryption settings`_. Your proxy should

* serve all requests exclusively over HTTPS
* set the ``X-Forwarded-For`` and ``X-Forwarded-Proto`` headers
* set the ``Host`` header
* serve all requests exclusively over HTTPS,
* follow established security practices regarding protocols and ciphers.
* optionally set best-practice headers like ``Referrer-Policy`` and
``X-Content-Type-Options``,
* set the ``X-Forwarded-For`` and ``X-Forwarded-Proto`` headers,
* set the ``Host`` header,
* serve all requests for the ``/static/`` and ``/media/`` paths from the
directories you set up in the previous step, without permitting directory
listings or traversal
* pass requests to the gunicorn server you set up in the previous step

The following snippet is an example on how to configure an nginx proxy for pretalx::

server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
server_name pretalx.mydomain.com;
}
server {
listen 443 default_server;
listen [::]:443 ipv6only=on default_server;
server_name pretalx.mydomain.com;

ssl on;
ssl_certificate /path/to/cert.chain.pem;
ssl_certificate_key /path/to/key.pem;

gzip off;
add_header Referrer-Policy same-origin;
add_header X-Content-Type-Options nosniff;

location / {
proxy_pass http://localhost:8345/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
}

location /media/ {
gzip on;
alias /var/pretalx/data/media/;
add_header Content-Disposition 'attachment; filename="$1"';
expires 7d;
access_log off;
}

location /static/ {
gzip on;
alias /path/to/static.dist/;
access_log off;
expires 365d;
add_header Cache-Control "public";
}
}
listings or traversal. Files in the ``/media/`` directory should be served
as attachments. You can use fairly aggressive cache settings for these URLs, and
* pass all other requests to the gunicorn server you set up in the previous step.


Step 8: Check the installation
-------------------------------

.. highlight:: console

You can make sure the web interface is up and look for any issues with::

# journalctl -u pretalx-web
Expand All @@ -297,7 +251,7 @@ Step 9: Provide periodic tasks
------------------------------

There are a couple of things in pretalx that should be run periodically. It
doesn’t matter how you run them, so you can go with your choice of periodic
does not matter how you run them, so you can go with your choice of periodic
tasks, be they systemd timers, cron, or something else entirely.

In the same environment as you ran the previous pretalx commands (e.g. the
Expand Down Expand Up @@ -328,10 +282,10 @@ If you want to read about updates, backups, and monitoring, head over to our
.. _nginx: https://botleg.com/stories/https-with-lets-encrypt-and-nginx/
.. _Let’s Encrypt: https://letsencrypt.org/
.. _PostgreSQL: https://www.postgresql.org/docs/
.. _redis: https://redis.io/documentation
.. _redis: https://redis.io/docs/latest/
.. _ufw: https://en.wikipedia.org/wiki/Uncomplicated_Firewall
.. _strong encryption settings: https://mozilla.github.io/server-side-tls/ssl-config-generator/
.. _docker-compose setup: https://github.com/pretalx/pretalx-docker
.. _pretalx.com: https://pretalx.com
.. _pretalx.com: https://pretalx.com/p/about/
.. _nodejs: https://github.com/nodesource/distributions/blob/master/README.md
.. _supported version of nodejs: https://nodejs.org/en/about/previous-releases
15 changes: 7 additions & 8 deletions doc/administrator/maintenance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ Backups
There are two things which you should create backups of:

Database
Your SQL database (SQLite, PostgreSQL). This is critical and you
must **always always create automatic backups of your database**. There are
tons of tutorials on the internet on how to do this, and the process
depends on the choice of your database.
For PostgreSQL, see the ``pg_dump`` tool. For SQLite, it is sufficient to
create a backup of the database file. You should create a cronjob or
timer that does the backups for you on a regular schedule. Do not forget to
add another one to rotate your backups.
Your SQL database (SQLite or PostgreSQL). This is critical and you must
**always always create automatic backups of your database**. There are tons
of tutorials on the internet on how to do this, and the process depends on
the choice of your database. For PostgreSQL, see the ``pg_dump`` tool. For
SQLite, it is sufficient to create a backup of the database file. You
should create a cronjob or timer that does the backups for you on a regular
schedule. Do not forget to add another one to rotate your backups.

Data directory
The data directory of your pretalx configuration may contain files that you
Expand Down
2 changes: 1 addition & 1 deletion doc/api/resources/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Field Type Description
===================================== ========================== =======================================================
tag string The actual tag name.
description multi-lingual string The description of the tag.
color string The tag’s color as hex string.
``color`` string The tag’s colour as hex string.
===================================== ========================== =======================================================

Endpoints
Expand Down
Loading

0 comments on commit 6813587

Please sign in to comment.