diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4c302e984..b093099a5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.15.6 +current_version = 3.17.0 tag_name = {new_version} commit = True tag = True diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f53ef5edc..4e2ea8b7e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,6 +6,8 @@ on: - "docs/**" branches: - "**" + pr: + - "docs/**" workflow_dispatch: {} jobs: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f7ec9fd43..44fb3f036 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -30,6 +30,12 @@ jobs: docker --version docker-compose --version + - name: Build e2e image + run: make build-e2e + + - name: Pull and start services + run: make services-e2e + - name: Run tests run: make e2e diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 990ae1590..4b0853773 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,9 +16,9 @@ If you're trying to install Aleph and need help, or if you are running Aleph and 1. [Read the Aleph Support Policy](https://github.com/alephdata/aleph/blob/main/SUPPORT.md) and understand under what rules we provide support to others. If you feel you fall within that - group, please [get in touch](https://docs.alephdata.org/get-in-touch). + group, please [get in touch](https://docs.aleph.occrp.org/get-in-touch). -2. Make sure you've [read the documentation](https://docs.alephdata.org), +2. Make sure you've [read the documentation](https://docs.aleph.occrp.org), especially the technical troubleshooting sections. 3. Only once you're **certain that the problem you are seeing is a bug** @@ -30,7 +30,7 @@ If you're trying to install Aleph and need help, or if you are running Aleph and A great place to start when looking for something to work on is our [project board](https://github.com/orgs/alephdata/projects/10). For experienced Aleph developers feel free to check our the [workboard](https://github.com/orgs/alephdata/projects/10/views/1). If this is your first time working on Aleph then it's probably a good idea to pick [something easy to work on](https://github.com/orgs/alephdata/projects/10/views/10). You can also find these issues on our [contribute page](https://github.com/alephdata/aleph/contribute). Regardless, once you've selected an issue please take a moment to assign it to yourself, this will stop anyone else from working on your issue. -If, after reviewing the list (or selecting an issue to work on) you'd like to reach out and talk to us then [get in touch](https://docs.alephdata.org/get-in-touch). +If, after reviewing the list (or selecting an issue to work on) you'd like to reach out and talk to us then [get in touch](https://docs.aleph.occrp.org/get-in-touch). ### Forking and Branching diff --git a/Dockerfile b/Dockerfile index fbb40cb8c..709c6b56a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,4 +49,4 @@ ENV ALEPH_ELASTICSEARCH_URI=http://elasticsearch:9200/ \ RUN mkdir /run/prometheus # Run the green unicorn -CMD gunicorn --config /aleph/gunicorn.conf.py --workers 5 --log-level info --log-file - aleph.manage:app +CMD gunicorn --config /aleph/gunicorn.conf.py --workers 6 --log-level debug --log-file - diff --git a/Makefile b/Makefile index 1c4cbab5e..8e279d69d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ COMPOSE_E2E=docker-compose -f docker-compose.dev.yml -f docker-compose.e2e.yml APPDOCKER=$(COMPOSE) run --rm app UIDOCKER=$(COMPOSE) run --no-deps --rm ui ALEPH_TAG=latest -BLACK_FLAGS=--exclude aleph/migrate +BLACK_OPTS=--extend-exclude aleph/migrate all: build upgrade web @@ -29,13 +29,13 @@ lint-ui: $(UIDOCKER) npm run lint format: - black $(BLACK_FLAGS) aleph/ + black $(BLACK_OPTS) aleph/ format-ui: $(UIDOCKER) npm run format format-check: - black --check $(BLACK_FLAGS) aleph/ + black --check $(BLACK_OPTS) aleph/ format-check-ui: $(UIDOCKER) npm run format:check @@ -112,7 +112,7 @@ e2e: services-e2e e2e/test-results $(COMPOSE_E2E) run --rm app aleph upgrade $(COMPOSE_E2E) run --rm app aleph createuser --name="E2E Admin" --admin --password="admin" admin@admin.admin $(COMPOSE_E2E) up -d api ui worker - BASE_URL=http://ui:8080 $(COMPOSE_E2E) run --rm --build-arg PLAYWRIGHT_VERSION=$(shell awk -F'==' '/^playwright==/ { print $$2 }' e2e/requirements.txt) e2e pytest -s -v --output=/e2e/test-results/ --screenshot=only-on-failure --video=retain-on-failure e2e/ + BASE_URL=http://ui:8080 $(COMPOSE_E2E) run --rm e2e pytest -s -v --output=/e2e/test-results/ --screenshot=only-on-failure --video=retain-on-failure e2e/ e2e-local-setup: dev python3 -m pip install -q -r e2e/requirements.txt diff --git a/README.rst b/README.rst index 90821e0dc..bf86375d8 100644 --- a/README.rst +++ b/README.rst @@ -15,9 +15,8 @@ companies) against watchlists, e.g. from prior research or public datasets. For further details on the software, how to use it, install it or manage data imports, please check the documentation at: -* https://docs.alephdata.org -* Installation: https://docs.alephdata.org/developers/installation -* Changes: https://docs.alephdata.org/developers/changelog +* https://docs.aleph.occrp.org +* Installation: https://docs.aleph.occrp.org/developers/installation Support @@ -28,7 +27,7 @@ If you're interested in participating in this process, please read the support policy (`SUPPORT.md`), the contribution rules (`CONTRIBUTING.md`), and the code of conduct (`CODE_OF_CONDUCT.md`) and then get in touch: -* https://docs.alephdata.org/get-in-touch +* https://docs.aleph.occrp.org/get-in-touch Release process --------------- diff --git a/aleph/logic/html.py b/aleph/logic/html.py index f716036c2..e8d70a64d 100644 --- a/aleph/logic/html.py +++ b/aleph/logic/html.py @@ -58,7 +58,7 @@ def sanitize_html(html_text, base_url, encoding=None): if el.tag == "a": el.set("target", "_blank") el.set("rel", "nofollow noreferrer external noopener") - return tostring(doc) + return tostring(doc, method="html", encoding="unicode") except Exception as exc: log.warning("HTML sanitizer failure [%s]: %s", type(exc), exc) return gettext("[HTML removed: could not be sanitized]") diff --git a/aleph/pages/about.en.md b/aleph/pages/about.en.md index 13034cabc..bef2ee1c7 100644 --- a/aleph/pages/about.en.md +++ b/aleph/pages/about.en.md @@ -6,4 +6,4 @@ menu: true Aleph is a powerful tool for people who follow the money. It helps investigators to securely access and search large amounts of data - no matter whether they are a government database or a leaked email archive. -Please refer to the [documentation](https://docs.alephdata.org/) for more details. +Please refer to the [documentation](https://docs.aleph.occrp.org/) for more details. diff --git a/aleph/tests/test_view_util.py b/aleph/tests/test_view_util.py index 371834609..a834ef9f5 100644 --- a/aleph/tests/test_view_util.py +++ b/aleph/tests/test_view_util.py @@ -36,6 +36,11 @@ def test_sanitize_html(self): assert html.find(".//a").get("target") == "_blank", html assert "nofollow" in html.find(".//a").get("rel"), html + def test_sanitize_html_no_self_closing_tags(self): + html_str = '