Commit Graph

1584 Commits

Author SHA1 Message Date
Klaas van Schelven
d155fa2bb2 Push User.language choices callable to the model
as per the comment: possible from Django 5.0 up
2025-08-28 21:44:57 +02:00
Klaas van Schelven
5cf4591166 Merge branch 'main' into django-5-2 2025-08-28 21:38:24 +02:00
Klaas van Schelven
6a523a6a67 Merge pull request #192
i18n support and Chinese translation
2025-08-28 20:23:54 +02:00
Klaas van Schelven
a0dc91c8c5 Push verbose_name to the model-level
at least for those fields where it is currently used.
this necessitates a patch to the migration machinery, which this commit adds

See #161
2025-08-28 16:03:27 +02:00
Klaas van Schelven
f38112f3df Pull markup out of translation files
it's bad enough that we do markup in views.py

See #161
2025-08-28 15:31:43 +02:00
Klaas van Schelven
a3cdeb9c8a Flake8 (including one breakage)
See #161
2025-08-28 15:01:05 +02:00
Klaas van Schelven
31fdf46a10 yesnomaybe translation fix
see https://code.djangoproject.com/ticket/36579

* remove workarounds; instead just provide a correctly formatted one in the .po file
* regen of .po file more generally

See #161
2025-08-28 14:17:31 +02:00
Klaas van Schelven
e8fb9556f7 Fix for Chinese yes,no,maybe
See #161
2025-08-28 14:17:31 +02:00
Klaas van Schelven
02c7c2e43d Clean up post-middleware language activation
See #161
2025-08-28 14:17:31 +02:00
Klaas van Schelven
ef126814bf Language choices: not in User.model
Having this as a model field is "annoying" because each added language
will trigger a (potentially costly) migration even though no real database
work is actually done for it.

Also implements a selector that shows languages in both their own language
and the currently activated language.

Correct spelling to "zh-hans" (lowercase); see https://stackoverflow.com/a/7729311

See #161
2025-08-28 14:17:25 +02:00
Klaas van Schelven
a7abde68a2 Language middleware: user and Accept-Language _only_
(as a matter of taste: I prefer to keep this as simple as possible)

See #161
2025-08-28 12:02:18 +02:00
Klaas van Schelven
044270aa6e Upgrade inotify_simple to 2.0
mainly: available as a .whl now

See https://github.com/chrisjbillington/inotify_simple/issues/41
2025-08-25 08:55:50 +02:00
Klaas van Schelven
cff82b4797 Document that api_catch_all disables APPEND_SLASH behavior for the api
See #188
2025-08-25 08:36:49 +02:00
Klaas van Schelven
f0d3667121 Remove 'kind' idea from send_json util
we only support one kind: files.
(in the past it was useful to send-to-self already uploaded items,
but this idea is never used in practice, and the whole idea of having to supply a
'kind' on the cmdline is confusing)
2025-08-24 21:03:35 +02:00
Klaas van Schelven
c38ca8c58a send_json command: --dsn param required (or from env) 2025-08-24 20:59:38 +02:00
Klaas van Schelven
1938f0a179 send_json/stress-test util: remove space from envelope
closer to the recommended format; and matches the comment ('smallest')
2025-08-02 22:36:40 +02:00
Klaas van Schelven
7594227b2b Add some tests for header validation
See #179
2025-08-02 22:25:43 +02:00
Klaas van Schelven
c62b0a47e4 Remove input value from exception
Using patterns here to play well with our excellent dogfood error
tracker:

When the non-validating value is displayed in the exception value, this makes
grouping not work (every event is its own issue); the approach has no upside,
because in a dogfooded setup the local vars are known anyway.
2025-08-02 22:14:13 +02:00
Klaas van Schelven
42ba5a71fa Docker: bugsink-show-version on-start 2025-08-02 21:25:33 +02:00
某亚瑟
2b5fb1bf67 Basically completed i18n support, and Chinese translation
Implement most Chinese text translations, adding default recognition browser language and user settings language
2025-08-02 10:25:19 +08:00
Klaas van Schelven
1ef1119fd9 Bandit: nosec & explain 1.7.6 2025-08-01 10:08:16 +02:00
Klaas van Schelven
d13290e982 1.7.6 CHANGELOG 2025-08-01 10:03:20 +02:00
Klaas van Schelven
5fb48e1e90 sent_at validation: support 00+00
Fix #179
2025-08-01 10:01:41 +02:00
Klaas van Schelven
abb84172bb header and envelope parsers: filter, don't fail on validation failures
See #179
2025-08-01 09:48:40 +02:00
Klaas van Schelven
f8a32353b4 1.7.5 CHANGELOG 1.7.5 2025-07-31 12:29:56 +02:00
Klaas van Schelven
05fcfbe359 Document thought on bandit on .template files
See #175
2025-07-30 22:38:48 +02:00
Klaas van Schelven
48cf7e8e90 Docker.fromwheel: more completely _from wheel_
Before this commit, the COPY command was still used to copy-over 2 files from
the working dir. Alhtough this was probably fine in practice (docker build
typically happens from a checked out state that matches the wheel you're
docker-building) it's not what's on the tin ("from wheel") and it opens up
the possiblity of subtle bugs (file mismatches when building from a different
state). Better prevent those.
2025-07-30 22:33:10 +02:00
Klaas van Schelven
b4c9e735b9 Docker image building: only tag as 'latest' when it's actually the latest
tag '1' is not likewise corrected (yet); assumed to be basically unused
2025-07-30 15:39:00 +02:00
Klaas van Schelven
17a96a22a6 Switch to safe_join from os.path.join (snappea)
rather than think-carefully-and-explain-with-nosec, just switch to
safe_join: this saves future readers the pain of validating whether
all assumptions are (still) correct at a (small) performance cost.

See #175
2025-07-30 14:07:56 +02:00
Klaas van Schelven
89db6d2899 Configure bandit for 'spoils' usage
i.e. B380: No os.path.join misuse.

See https://github.com/bugsink/spoils

rather than think-carefully-and-explain-with-nosec, just switch to
safe_join: this saves future readers the pain of validating whether
all assumptions are (still) correct at a (small) performance cost.

See #175
2025-07-30 14:07:24 +02:00
Klaas van Schelven
462a3169cd Add one more test that proves safe use of mark_safe
See #175
2025-07-30 12:37:57 +02:00
Klaas van Schelven
9d110bb0d3 fix a comment
See #175
2025-07-30 12:22:28 +02:00
Klaas van Schelven
354af7ea0a Fix issues as reported by bandit or mark as nosec
Nothing worrying, but good to have checked this regardless
and important to have a green pipeline.

Fix #175
2025-07-30 12:16:40 +02:00
Klaas van Schelven
6266f15aa1 Configure Bandit in the CI
See #175
2025-07-30 12:14:24 +02:00
Klaas van Schelven
0d59f96b41 GitHub CI: document hardcoded list of branches 2025-07-30 11:42:40 +02:00
Klaas van Schelven
2fede39985 Envelope parsing: validate headers as per the docs
headers means: envelope headers and item headers.

Provides more robustness and a layer of defense-in-depth
Only those headers that we might rely on in a near future (event-based)
are included.

See #173
2025-07-29 23:46:48 +02:00
Klaas van Schelven
354edc81f9 Use django.utils._os.safe_join to construct paths
Even though '_os' suggests a private interface, this is likely to be stable
(for our purposes, i.e. may get more secure); if it ever isn't our tests
will expose it.

See #173
2025-07-29 22:23:37 +02:00
Klaas van Schelven
aab9b38352 Update CHANGELOG for 1.7.4, 1.6.4, 1.5.5, 1.4.3 2025-07-29 17:03:35 +02:00
Klaas van Schelven
2488d81595 Enable manual invocation via "Run workflow" button in the Actions UI 2025-07-29 16:11:41 +02:00
Klaas van Schelven
87f5a5887e CI workflow: run for 1.*.x branches too
working in the assumptions that:

* 1.*.x is not valid, explicitly listing is needed
* In GitHub Actions, workflow evaluation happens from the main (or default) branch of the repo, not from the branch being pushed to or pulled from.
2025-07-29 16:09:21 +02:00
Klaas van Schelven
4bf2c1c522 envelope event_id check: on-parse 2025-07-29 15:22:34 +02:00
Klaas van Schelven
fe5527308c (extra) check on storage event_id uuid-ness before using in filenames 2025-07-29 15:08:02 +02:00
Klaas van Schelven
b8b179ff94 Ingestion: ensure event_id is a dashless uuid before using as a filename 2025-07-29 14:50:16 +02:00
Klaas van Schelven
5d8d73097c copilot instructions: fixes on createsuperuser
For some reason the env-vars were missed; pulling them closer hopefully fixes
this (and makes more sense generally)

the `|| true` pattern was removed: it just hides problems.

also: different username (email) to stick closer to what we do elsewhere.
2025-07-29 14:15:17 +02:00
Klaas van Schelven
735f5ceaa0 Copilot instructions; another attempt
after having seen copilot in action on #171
2025-07-29 14:05:18 +02:00
Klaas van Schelven
d4b4c2fb52 Copilot env: check out event-samples outside the workspace
* avoids annoying accidental checkins
* actually matches the SAMPLES_DIR env var
2025-07-29 14:02:53 +02:00
Klaas van Schelven
9b8409d8b2 Global trailing whitespace cleanup 2025-07-29 12:53:10 +02:00
Klaas van Schelven
9fa2fde3e5 pre-commit: fail on trailing whitespace 2025-07-29 12:53:10 +02:00
Klaas van Schelven
547e423df0 Remove '. bin/activate' from pre-commit hook
that assumes my particular setup (top-level venv) which is unusual.
better have 'active env' as a requirement for the script instead
2025-07-29 12:53:10 +02:00
Klaas van Schelven
00a686d103 Tell contributors (and copilot) about the pre-commit hooks 2025-07-29 12:52:59 +02:00