Commit Graph

5609 Commits

Author SHA1 Message Date
syeopite
dc198546a0
Fix Ameba Lint/UselessAssign 2025-06-03 16:40:35 -07:00
syeopite
7226a72824
Isolate static assets handler spec from others
Running `crystal spec` without a file argument essentially produces one
big program that combines every single spec file, their imports, and
the files that those imports themselves depend on. Most of the types
within this combined program will get ignored by the compiler due to a
lack of any calls to them from the spec files.

But for some types, partially the HTTP module ones, using them within
the spec files will suddenly make the compiler enable a bunch of
previously ignored code. And those code will suddenly require the
presence of additional types, constants, etc. This not only make it
annoying for getting the specs working but also makes it difficult to
isolate behaviors for testing.

The `static_assets_handler_spec.cr` causes this issue and so will be
marked as an isolated spec for now. In the future all of the tests
should be organized into independent groupings similar to how the
Crystal compiler splits their tests into std, compiler, primitives and
interpreter.
2025-06-03 16:39:59 -07:00
syeopite
6c927c89a6
Add specs for the new StaticAssetsHandler 2025-06-03 16:35:40 -07:00
syeopite
60172a2e6a
Compare against 1.17.0-dev until full release 2025-06-03 09:23:28 -07:00
syeopite
628f45de01
Simplify StaticAssetsHandler implementation
Overriding `#call` or patching out `serve_file_compressed` provides
only minimal benefits over the ease of maintenance granted by only
overriding what we need to for the caching behavior.
2025-06-03 09:04:33 -07:00
syeopite
748ef23326
Replace Kemal::StaticFileHandler on Crystal < 1.17.0
Kemal's subclass of the stdlib `HTTP::StaticFileHandler` is not as
maintained as its parent, and so misses out on many enhancements and bug
fixes from upstream, which unfortunately also includes the patches for
security vulnerabilities...

Though this isn't necessarily Kemal's fault since the bulk of the stdlib
handler's logic was done in a single big method, making any changes hard
to maintain. This was fixed in Crystal 1.17.0 where the handler
was refactored into many private methods, making it easier for an
inheriting type to implement custom behaviors while still leveraging
much of the pre-existing code.

Since we don't actually use any of the Kemal specific features added by
`Kemal::StaticFileHandler`, there really isn't a reason to not just
create a new handler based upon the stdlib implementation instead which
will address the problems mentioned above.

This PR implements a new handler which inherits from the stdlib variant
and overrides the helper methods added in Crystal 1.17.0 to add the
caching behavior with minimal code changes. Since this new handler
depends on the code in Crystal 1.17.0, it will only be applied on
versions greater than or equal to 1.17.0. On older versions we'll
fallback to the current monkey patched `Kemal::StaticFileHandler`
2025-06-03 07:50:21 -07:00
syeopite
df8839d1f0
Make base-Invidious video info extraction more resilient (#5312)
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.16.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
Try next fallback client if one raises

Convert `dig` to `dig?`

Optimize companionless stream retrieval
2025-05-28 20:18:51 +00:00
syeopite
b859faebf0
Remove @iv-org/developers from codeowners (#5314)
Some checks are pending
Build and release container directly from master / release (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.2, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.3, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.16.3, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Waiting to run
Invidious CI / build-docker (push) Waiting to run
Invidious CI / build-docker-arm64 (push) Waiting to run
Invidious CI / lint (push) Waiting to run
2025-05-28 17:34:49 +02:00
Fijxu
4b37d47ebb
Add missing xml.text on "title" element for channels RSS (#5320)
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.16.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
2025-05-22 20:12:54 -04:00
syeopite
2c857b5ab6
Remove text captchas from Invidious (#5308)
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.16.3, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
textcaptcha.com seems to be down since April and it does not appear that
service will be restored.

Text captchas can be easily automated using free LLMs, so keeping the
text captcha is more like a gate to create accounts in mass on public
Invidious instances.

It also gives headaches like bots automating account creation to modify
the videos that appear popular page of each instance (since the popular
page is based on the subscriptions of the registered users).
2025-05-17 16:37:55 -07:00
Fijxu
00299ca4a0
Remove Image CAPTCHA and Text CAPTCHA from locale 2025-05-17 19:23:40 -04:00
syeopite
9d18c8699f
Release versioning maintenance (#5310) 2025-05-17 16:22:32 -07:00
syeopite
475bf7448a
Add Javascript licence information automatically (#5297) 2025-05-17 16:20:38 -07:00
syeopite
50e0a4361b
Add missing javascript licenses (#5292) 2025-05-17 16:19:21 -07:00
syeopite
6bfb61e9b4
fix: safely access "label" key (#5282) 2025-05-17 16:18:58 -07:00
syeopite
ef07c542dc
fix: pass user to query.process if present (#5277) 2025-05-17 16:18:37 -07:00
syeopite
a9180aa6c1
fix: do not strip '+' character from referer (#5276) 2025-05-17 16:18:15 -07:00
syeopite
4b2f9ffffc
fix: set CSP header after setting preferences of registered users (#5275) 2025-05-17 16:17:43 -07:00
syeopite
64ad97f308
fix(typo): 'Salect' -> 'Select' (#5242) 2025-05-17 16:17:08 -07:00
syeopite
d5cb653fd1
Handle parse errors gracefully on timeline items (#5196) 2025-05-17 16:16:20 -07:00
syeopite
0b23dd12e1
require base_job before the other jobs (#5194) 2025-05-17 16:15:32 -07:00
syeopite
23d66338cd
Translations update from Hosted Weblate (#5192) 2025-05-17 16:15:03 -07:00
syeopite
df41cb9588
Update Kemal to 1.6.0 and remove Kilt (#5120) 2025-05-17 16:14:40 -07:00
syeopite
49ada0aae9
Fix incorrect PR link for v2.20250504.0 2025-05-17 15:49:03 -07:00
syeopite
f6a41ce90d
Bump shard.yml version 2025-05-17 15:42:48 -07:00
Emilien
f7aefd5fb1
Release v2.20250517.0 2025-05-17 15:41:33 -07:00
Fijxu
6376fd55db
Remove text captcha due to textcaptcha.com being down
Fixes https://github.com/iv-org/invidious/issues/5295

textcaptcha.com seems to be down since April and it does not appear that service will be restored.

Text captchas can be easily automated using free LLMs, so keeping the text captcha is more like a gate to create accounts in mass on public Invidious instances.

It also gives headaches like bots automating account creation to modify the videos that appear popular page of each instance (since the popular page is based on the subscriptions of the registered users).
2025-05-17 13:17:26 -04:00
Hosted Weblate
9e172d8371
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
8d0834005f
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
9f192d4f74
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
ee7b8b6c61
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
b9097d0a3b
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
be469304de
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
b6b245586a
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
88195113bf
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
4d381aca60
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
a5904ecce2
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
42125dfadd
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
5953f7286f
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
31556d0f88
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:08 +02:00
Hosted Weblate
7bd1abecde
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
583195ccbd
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
f96e476ed9
Update Vietnamese translation
Update translation files

Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Abc's Noob <abcsspprt@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
9186020f94
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
546a799f0b
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
2d8326c63d
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
9c9a8592e0
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
435106b7de
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
6a9ed48d5d
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00
Hosted Weblate
a5b97a5850
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invidious/translations/
Translation: Invidious/Invidious Translations
2025-05-14 07:51:07 +02:00