Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.1.0 #4098

Draft
wants to merge 28 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c820d5e
Merge pull request #4097 from alephdata/release/4.0.3
stchris Jan 10, 2025
a50a874
servicelayer 1.23.3
stchris Jan 10, 2025
e2bb30a
Bump version: 4.1.0-rc4 → 4.1.0-rc5
stchris Jan 10, 2025
8f23001
Add additional validation checks (#4104)
tillprochaska Jan 20, 2025
340d221
Do not delete API key to enable rollbacks to previous version.
tillprochaska Jan 20, 2025
d9bbd6f
Merge pull request #4105 from alephdata/allow-rollbacks-api-keys
stchris Jan 20, 2025
9a2ccfd
Bump version: 4.1.0-rc5 → 4.1.0-rc6
stchris Jan 20, 2025
dc0b5e7
bugfix: reenable email preview
stchris Jan 22, 2025
bb068f5
Bump version: 4.1.0-rc6 → 4.1.0-rc7
stchris Jan 22, 2025
6349abd
servicelayer 1.24.0-rc1
stchris Feb 4, 2025
a1e285f
Bump version: 4.1.0-rc7 → 4.1.0-rc8
stchris Feb 4, 2025
a4416ce
servicelayer 1.24.0-rc2
stchris Feb 12, 2025
a0fd24b
Bump version: 4.1.0-rc8 → 4.1.0-rc9
stchris Feb 12, 2025
7e7fec7
log when aleph inits the sentry sdk
stchris Feb 13, 2025
a93dcbe
servicelayer 1.24.0-rc3
stchris Feb 13, 2025
2a52189
Bump version: 4.1.0-rc9 → 4.1.0-rc10
stchris Feb 13, 2025
6c843e0
add missing import
stchris Feb 13, 2025
7e47813
Bump version: 4.1.0-rc10 → 4.1.0-rc11
stchris Feb 13, 2025
af3f506
bugfix: remove local_queue override
stchris Feb 14, 2025
1479d09
Bump version: 4.1.0-rc11 → 4.1.0-rc12
stchris Feb 14, 2025
0502893
Bump version: 4.1.0-rc12 → 4.1.0-rc13
stchris Feb 14, 2025
9352ad2
servicelayer 1.24.0-rc4
stchris Feb 18, 2025
a2e7d61
Bump version: 4.1.0-rc13 → 4.1.0-rc14
stchris Feb 18, 2025
530a6d7
servicelayer 1.24.0
stchris Feb 18, 2025
79a63a2
Bump version: 4.1.0-rc14 → 4.1.0-rc15
stchris Feb 18, 2025
d7812f6
Bump version: 4.1.0-rc15 → 4.1.0
stchris Feb 24, 2025
c3bef9a
fix: incorrect local queue size calculation
stchris Mar 7, 2025
53103b6
Merge pull request #4160 from alephdata/bugfix/rmq-queue-capacity
stchris Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.1.0-rc4
current_version = 4.1.0
tag_name = {new_version}
commit = True
tag = True
Expand Down
1 change: 0 additions & 1 deletion aleph/logic/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def hash_plaintext_api_keys():
for index, partition in enumerate(results.partitions()):
for role in partition:
role.api_key_digest = hash_api_key(role.api_key)
role.api_key = None
db.session.add(role)
log.info(f"Hashing API key: {role}")
log.info(f"Comitting partition {index}")
Expand Down
11 changes: 8 additions & 3 deletions aleph/model/role.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from datetime import datetime, timezone
from normality import stringify
from sqlalchemy import or_, not_, func
from sqlalchemy import and_, or_, not_, func
from itsdangerous import URLSafeTimedSerializer
from werkzeug.security import generate_password_hash, check_password_hash

Expand Down Expand Up @@ -197,13 +197,18 @@ def by_email(cls, email):

@classmethod
def by_api_key(cls, api_key):
if api_key is None:
if api_key is None or not len(api_key.strip()):
return None

q = cls.all()

digest = hash_api_key(api_key)
q = q.filter(cls.api_key_digest == digest)
q = q.filter(
and_(
cls.api_key_digest != None, # noqa: E711
cls.api_key_digest == digest,
)
)

utcnow = datetime.now(timezone.utc)
# TODO: Exclude API keys without expiration date after deadline
Expand Down
7 changes: 6 additions & 1 deletion aleph/tests/test_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ def test_hash_plaintext_api_keys(self):
hash_plaintext_api_keys()

db.session.refresh(user_1)
assert user_1.api_key is None

# Do not delete the plaintext API key to allow for version rollbacks.
# `api_key` column will be removed in the next version at which point all
# plaintext keys will be deleted.
assert user_1.api_key == "1234567890"

assert user_1.api_key_digest == hash_api_key("1234567890")

db.session.refresh(user_2)
Expand Down
12 changes: 12 additions & 0 deletions aleph/tests/test_view_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def test_authz_header_api_key_invalid(self):
res = self.client.get(f"/api/2/roles/{self.role.id}", headers=headers)
assert res.status_code == 403

headers = {"Authorization": "ApiKey "}
res = self.client.get(f"/api/2/roles/{self.role.id}", headers=headers)
assert res.status_code == 403

headers = {"Authorization": ""}
res = self.client.get(f"/api/2/roles/{self.role.id}", headers=headers)
assert res.status_code == 403
Expand All @@ -83,6 +87,10 @@ def test_authz_header_api_key_invalid(self):
res = self.client.get(f"/api/2/roles/{self.role.id}", headers=headers)
assert res.status_code == 403

headers = {"Authorization": " "}
res = self.client.get(f"/api/2/roles/{self.role.id}", headers=headers)
assert res.status_code == 403

def test_authz_url_param_api_key(self):
query_string = {"api_key": "1234567890"}
res = self.client.get(f"/api/2/roles/{self.role.id}", query_string=query_string)
Expand All @@ -97,3 +105,7 @@ def test_authz_url_params_api_key_invalid(self):
query_string = {"api_key": ""}
res = self.client.get(f"/api/2/roles/{self.role.id}", query_string=query_string)
assert res.status_code == 403

query_string = {"api_key": " "}
res = self.client.get(f"/api/2/roles/{self.role.id}", query_string=query_string)
assert res.status_code == 403
10 changes: 7 additions & 3 deletions aleph/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time
import threading
import functools
import queue
import copy
from typing import Dict, Callable
import sqlalchemy
Expand Down Expand Up @@ -116,7 +115,13 @@ def __init__(
version=None,
prefetch_count_mapping=defaultdict(lambda: 1),
):
super().__init__(queues, conn=conn, num_threads=num_threads, version=version)
super().__init__(
queues,
conn=conn,
num_threads=num_threads,
version=version,
prefetch_count_mapping=prefetch_count_mapping,
)
self.often = get_rate_limit("often", unit=300, interval=1, limit=1)
self.daily = get_rate_limit("daily", unit=3600, interval=24, limit=1)
# special treatment for indexing jobs - indexing jobs need to be batched
Expand All @@ -125,7 +130,6 @@ def __init__(
# run of all available indexing tasks
self.indexing_batch_last_updated = 0.0
self.indexing_batches = defaultdict(list)
self.local_queue = queue.Queue()
self.prefetch_count_mapping = prefetch_count_mapping

def on_signal(self, signal, _):
Expand Down
4 changes: 4 additions & 0 deletions aleph/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import logging

from aleph.core import create_app
from aleph.settings import SETTINGS
from aleph import __version__ as aleph_version

import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

log = logging.getLogger(__name__)

if SETTINGS.SENTRY_DSN:
sentry_sdk.init(
Expand All @@ -17,4 +20,5 @@
environment=SETTINGS.SENTRY_ENVIRONMENT,
send_default_pii=False,
)
log.info("aleph.wsgi initialized Sentry SDK")
app = create_app()
8 changes: 4 additions & 4 deletions contrib/aleph-traefik-minio-keycloak/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
- "traefik.enable=false"

worker:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: aleph worker
restart: on-failure
links:
Expand All @@ -79,7 +79,7 @@ services:
- "traefik.enable=false"

shell:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: /bin/bash
depends_on:
- postgres
Expand All @@ -99,7 +99,7 @@ services:
- "traefik.enable=false"

api:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: gunicorn -w 6 -b 0.0.0.0:8000 --log-level debug --log-file - aleph.wsgi:app
expose:
- 8000
Expand All @@ -121,7 +121,7 @@ services:
- "traefik.enable=false"

ui:
image: ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
depends_on:
- api
- traefik
Expand Down
8 changes: 4 additions & 4 deletions contrib/keycloak/docker-compose.dev-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
elasticsearch:
build:
context: services/elasticsearch
image: ghcr.io/alephdata/aleph-elasticsearch:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph-elasticsearch:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
hostname: elasticsearch
environment:
- discovery.type=single-node
Expand Down Expand Up @@ -55,7 +55,7 @@ services:
app:
build:
context: .
image: alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
hostname: aleph
command: /bin/bash
links:
Expand Down Expand Up @@ -83,7 +83,7 @@ services:
api:
build:
context: .
image: alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: aleph run -h 0.0.0.0 -p 5000 --with-threads --reload --debugger
ports:
- "127.0.0.1:5000:5000"
Expand Down Expand Up @@ -117,7 +117,7 @@ services:
ui:
build:
context: ui
image: alephdata/aleph-ui:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: alephdata/aleph-ui:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
links:
- api
command: npm run start
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
- aleph.env

worker:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: aleph worker
restart: on-failure
depends_on:
Expand All @@ -62,7 +62,7 @@ services:
- aleph.env

shell:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
command: /bin/bash
depends_on:
- postgres
Expand All @@ -80,7 +80,7 @@ services:
- aleph.env

api:
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
expose:
- 8000
depends_on:
Expand All @@ -97,7 +97,7 @@ services:
- aleph.env

ui:
image: ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG:-ALEPH_TAG:-4.1.0-rc4}
image: ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG:-ALEPH_TAG:-4.1.0}
depends_on:
- api
ports:
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/aleph/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: aleph
description: Helm chart for Aleph
type: application
version: 4.1.0-rc4
appVersion: 4.1.0-rc4
version: 4.1.0
appVersion: 4.1.0
2 changes: 1 addition & 1 deletion helm/charts/aleph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Helm chart for Aleph
| global.amazon | bool | `true` | Are we using AWS services like s3? |
| global.google | bool | `false` | Are we using GCE services like storage, vision api? |
| global.image.repository | string | `"alephdata/aleph"` | Aleph docker image repo |
| global.image.tag | string | `"global.image.tag | string | `"4.1.0-rc4"` | Aleph docker image tag |
| global.image.tag | string | `"global.image.tag | string | `"4.1.0"` | Aleph docker image tag |
| global.image.tag | string | `"Always"` | |
| global.namingPrefix | string | `"aleph"` | Prefix for the names of k8s resources |

Expand Down
2 changes: 1 addition & 1 deletion helm/charts/aleph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ global:

image:
repository: ghcr.io/alephdata/aleph
tag: "4.1.0-rc4"
tag: "4.1.0"
pullPolicy: Always

commonEnv:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ followthemoney==3.5.9
followthemoney-store[postgresql]==3.1.0
followthemoney-compare==0.4.4
fingerprints==1.2.3
servicelayer[google,amazon]==1.23.3-rc7
servicelayer[google,amazon]==1.24.0
normality==2.5.0
pantomime==0.6.1

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="aleph",
version="4.1.0-rc4",
version="4.1.0",
description="Document sifting web frontend",
classifiers=[
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aleph-ui",
"version": "4.1.0-rc4",
"version": "4.1.0",
"private": true,
"dependencies": {
"@alephdata/followthemoney": "^3.5.5",
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/Entity/EntityViews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ class EntityViews extends React.Component {

// The view mode is the default mode. It is rendered for almost all document-like
// entities (except folders) and renders an empty state if no viewer is available
// for a specific file type.
if (entity.schema.isA('Folder')) {
// for a specific file type. Email is special cased, because it inherits from Folder,
// but still has a normal view.
if (entity.schema.isA('Folder') && !entity.schema.isA('Email')) {
return;
}

Expand Down