Commit Graph

1612 Commits

Author SHA1 Message Date
Klaas van Schelven
a4ecd386b6 Support hosting at subpath
"In principle" setting `SCRIPT_NAME` is enough. The way we do this is [1] using
`FORCE_SCRIPT_NAME` (which does not depend on messing with reverse proxy
settings and [2] by deducing the correct value from `BASE_URL` (which must be
set anyway) automatically.

By works I mean: `reverse` and `{% url` pick it up from there.

However, there are subtleties / extra work:

* `STATIC_URL` is needed too b/c https://code.djangoproject.com/ticket/34028

* in many pre-existing code I just created a path manually in the html. Such
  hrefs are obviously not magically fixed for script_name. Rather than doing
  the "full rewrite" (into `{% url`) this commit just prepends the
  `script_name` in those cases. That's the way forward that will least likely
  break and it gives us something to grep for if we ever want to 'do it
  right'.

* `LOGIN_REDIRECT_URL` and `LOGIN_URL` needed to use a view-name for this to
  work (using a view-name gets revolved using the thing that introduces
  `script_name`)

Checked, no work needed:

* views (`redirect` and `HttpResponseRedirect`)
* html uses of action="..."

Fix #93
2025-09-05 22:47:22 +02:00
Klaas van Schelven
5307860b4d Merge pull request #89 from bugsink/django-5-2
Upgrade to Django 5.2
2025-09-05 10:01:02 +02:00
Klaas van Schelven
31559c5b6c Django 5.2: update changelog 2025-09-05 09:54:32 +02:00
Klaas van Schelven
1bbb383cfb Merge branch 'main' into django-5-2 2025-09-05 09:49:15 +02:00
Klaas van Schelven
b88fc4f442 CHANGELOG; update in advance 2025-09-05 09:48:25 +02:00
Klaas van Schelven
144e570db6 MySQL: do not save 2 queries in store_tags
it doesn't support the relevant machinery
2025-09-04 15:20:23 +02:00
Klaas van Schelven
e0cb4b6369 Save another query in store_tags
(analogous to the parent commit)

made possible by Django 5.2
2025-09-04 14:10:52 +02:00
Klaas van Schelven
9a13bdb83d Save a query in store_tags
made possible by Django 5.2
2025-09-04 13:52:08 +02:00
Klaas van Schelven
170d76647e Tailwind 3=>4: final changes 2025-09-04 13:30:09 +02:00
Klaas van Schelven
ad8a2a5e4f Tailwind 3 => 4: bg-opacity "folded into bg"
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities
2025-09-04 13:20:22 +02:00
Klaas van Schelven
610e7b1c17 Tailwind 3 => 4: rounded => rounded-sm
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities
2025-09-04 13:20:22 +02:00
Klaas van Schelven
ac8e2e8cd6 Tailwind 3 => 4: ring => ring-3
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities
2025-09-04 13:20:22 +02:00
Klaas van Schelven
f51bdb487e Tailwind 3 => 4 (and django-tailwind => 4.2)
Applied a version of the instructions here:
https://github.com/timonweb/django-tailwind/issues/229

and ran most of the "original build" instructions
2025-09-04 13:17:35 +02:00
Klaas van Schelven
12af5302ef Drop Python 3.9 support
In principle, Python 3.9 has ~1 month of life in it (its own EOL).
I'm OK with that in practice for main (we haven't released Bugsink yet),
as well as considering the following overview of popular Linux distros
and their Python versions (which will have a much stronger influence
on practical Python deployment in the wild than whatever the PSF says):

Not affected:

* Ubuntu 22.04 LTS (EOL Apr 2027) has Python 3.10
* Ubuntu 24.04 LTS (EOL Apr 2029) has Python 3.12
* Debian 12 Bookworm (EOL Jun 2028) has Python 3.11
* RHEL 9 (EOL May 2032) default 3.9 but also offers 3.11 and 3.12
* The Docker image we use has Python version configurable (we use 3.12)

Affected:

* Debian 11 Bullseye (EOL Aug 2026) has Python 3.9

Given Bugsink's own age my guess is "no one's on Bullseye".
2025-09-04 11:48:12 +02:00
Klaas van Schelven
0764024389 Replace python-sourcemap with ecma426
an up-to-date, w/ section support. Moreover: the other is 'NIH'.
2025-09-04 10:10:23 +02:00
Klaas van Schelven
8b8b61ea3c Use safe_join in vacuum utility
given the listdir right before it: not strictly necessary
but easier to reason about than yet another 'nosec'
2025-09-02 13:30:09 +02:00
Klaas van Schelven
10658d70a5 vacuum_ingest_dir Minor stylistic post-copilot cleanup
Fix #163
2025-09-02 13:24:21 +02:00
copilot-swe-agent[bot]
257b5f1777 Implement vacuum_ingest_dir management command
(Klaas removed copilot's testcases)

See #163

Co-authored-by: vanschelven <223833+vanschelven@users.noreply.github.com>
2025-09-02 13:17:48 +02:00
Klaas van Schelven
25b7f7c0bc Merge pull request #178 from bugsink/non-root-docker
non-root Docker
2025-09-02 13:01:21 +02:00
Klaas van Schelven
b911acebdc single-server template, warn about containing-dir
for snappea PID_FILE

See #195
2025-09-01 20:39:42 +02:00
Klaas van Schelven
3a050e7533 Typo in comment 2025-09-01 20:33:55 +02:00
Klaas van Schelven
41944a8cf0 Update snappea PID_FILE default location to be in bugsink-specific directory
See #195
2025-09-01 20:30:03 +02:00
Klaas van Schelven
4ad3c5efcf Hardening of Temporary-Directory Usage
Defends against certain forms of local privilege escalation, i.e.
understood to be defense in depth rather than a security issue given
the recommended ways of deploying (docker container or in a single-use
single-server)

Fix #174

See https://github.com/python/cpython/pull/23901
2025-08-30 15:10:50 +02:00
Klaas van Schelven
16578cbe6c Remove dead code
See #194
2025-08-29 14:50:39 +02:00
Klaas van Schelven
d62d016be3 When selecting text in the stacktrace frameHeader, don't toggle the frame
The frameheader is a typical target for copy/paste actions (filenames/paths)
and having stuff jump around right after selecting is annoying
2025-08-29 14:47:46 +02:00
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 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 2025-07-31 12:29:56 +02:00