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

[pull] dev from Rongronggg9:dev #41

Merged
merged 42 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d42e3d7
chore(i18n): update l10n for `id`
doctorreditshere Oct 20, 2024
505dc3f
chore(i18n): update l10n for `be`
zerynthia Oct 20, 2024
cd5c7f6
chore(i18n): update l10n for `lv`
Coool Oct 20, 2024
209ae89
chore(i18n): update l10n for `it`
Mannivu Oct 20, 2024
59eafc8
chore(i18n): update l10n for `ca`
rroset Oct 20, 2024
49b1bef
chore(i18n): add l10n for `be`, `lv`; update `id`, `it` ,`ca` (#563)
Rongronggg9 Oct 22, 2024
cbec276
chore(i18n): update l10n for `zh-Hant` (#562)
NeKoOuO Oct 22, 2024
9b8930b
build(deps): Bump rapidfuzz from 3.9.7 to 3.10.0 (#533)
dependabot[bot] Oct 22, 2024
ed2f9b2
build(deps): Bump telethon from 1.36.0 to 1.37.0 (#534)
dependabot[bot] Oct 22, 2024
1e80ebb
build(deps): Bump isal from 1.7.0 to 1.7.1 (#537)
dependabot[bot] Oct 22, 2024
9fd1959
build(deps): Bump python-socks[asyncio] from 2.5.1 to 2.5.3 (#546)
dependabot[bot] Oct 22, 2024
2660413
ci(pre-commit): bump pre-commit-hooks from 4.6.0 to 5.0.0
Rongronggg9 Oct 22, 2024
559d26f
build(deps): Bump tortoise-orm[accel] from 0.21.6 to 0.21.7 (#554)
dependabot[bot] Oct 22, 2024
dab9d1d
build(deps): Bump yarl from 1.11.1 to 1.16.0 (#561)
dependabot[bot] Oct 22, 2024
cef2e12
build(deps): Bump emoji from 2.12.1 to 2.14.0 (#544)
dependabot[bot] Oct 22, 2024
211129d
build(deps): Bump uvloop from 0.20.0 to 0.21.0 (#555)
dependabot[bot] Oct 22, 2024
c061c55
build(deps): Bump asyncpg from 0.29.0 to 0.30.0 (#560)
dependabot[bot] Oct 22, 2024
a132d90
build(deps): Bump dnspython[idna] from 2.6.1 to 2.7.0 (#547)
dependabot[bot] Oct 22, 2024
c283839
build(deps): Bump pillow from 10.4.0 to 11.0.0 (#557)
dependabot[bot] Oct 22, 2024
2f342bc
build(deps): Bump aiohttp[speedups] from 3.10.5 to 3.10.10 (#551)
dependabot[bot] Oct 22, 2024
cba693e
chore(i18n): sync l10n strings among identical keys
Rongronggg9 Oct 22, 2024
d468931
build(deps): Bump cryptg from 0.4.0 to 0.5.0.post0 (#564)
dependabot[bot] Oct 23, 2024
6bb9dc4
chore(env): include repo link in the default UA
Rongronggg9 Oct 27, 2024
f2ae412
build(deps): Bump asyncstdlib from 3.12.5 to 3.13.0 (#565)
dependabot[bot] Oct 27, 2024
9026de1
build(deps): Bump rapidfuzz from 3.10.0 to 3.10.1 (#567)
dependabot[bot] Oct 27, 2024
ab60c0f
perf(monitor): avoid calling datetime.now() multiple times
Rongronggg9 Nov 4, 2024
42ac7be
perf(web.utils): WebResponse: adopt propcache.cached_property
Rongronggg9 Nov 4, 2024
bdce575
feat(web.utils): WebResponse: improve expiration calculation
Rongronggg9 Nov 4, 2024
5734530
feat(monitor): use exponential delay for feed.next_check_time on error
Rongronggg9 Nov 4, 2024
137281a
refactor: move calc_next_check_as_per_server_side_cache into web.WebFeed
Rongronggg9 Nov 4, 2024
2313538
fix(`/sub`): monitoring not deferred as per server-side cache
Rongronggg9 Nov 4, 2024
d73815c
build(deps): Bump colorlog from 6.8.2 to 6.9.0 (#570)
dependabot[bot] Nov 4, 2024
e7120ff
build(deps): Bump yarl from 1.16.0 to 1.17.1 (#571)
dependabot[bot] Nov 4, 2024
3dfc340
fix(web.utils): WebFeed: TypeError
Rongronggg9 Nov 4, 2024
1f7af2b
perf: use itertools.chain.from_iterable() instead of unpacking
Rongronggg9 Nov 6, 2024
2121ffd
perf(parsing.utils): utilize ranged sets ([x-y]) in re patterns
Rongronggg9 Nov 6, 2024
067606b
fix(parsing.utils): hashtag-breaking '・' not escaped
Rongronggg9 Nov 6, 2024
37d8c96
feat(parsing.utils): support chat-specific hashtags by allowing '@'
Rongronggg9 Nov 6, 2024
7d7a36c
fix(command.utils): typo in log messages
Rongronggg9 Nov 6, 2024
29aec0a
chore(i18n): update l10n for `uk`
Nov 7, 2024
6b95ac0
chore(i18n): update l10n for `de`
floriegl Nov 7, 2024
32709d5
chore(i18n): update l10n for `de`, `uk`
Rongronggg9 Nov 7, 2024
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 .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TELEGRAPH_TOKEN="
#API_HASH=452b0359b988148995f22ff0f4229750 # get it from https://core.telegram.org/api/obtaining_api_id
#IMG_RELAY_SERVER=https://wsrv.nl/?url= # default: https://rsstt-img-relay.rongrong.workers.dev/
#IMAGES_WESERV_NL=https://t0.nl/ # default: https://wsrv.nl/
#USER_AGENT=Mozilla/5.0 (Android 12; Mobile; rv:68.0) Gecko/68.0 Firefox/96.0 # default: RSStT/2.x RSS Reader
#USER_AGENT=Mozilla/5.0 # default: RSStT/* RSS Reader (+https://git.io/RSStT)
#IPV6_PRIOR=1 # default: 0
#VERIFY_TLS=0 # default: 1
#T_PROXY=socks5://172.17.0.1:1080 # Proxy used to connect to the Telegram API
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [ "--enforce-all" ]
Expand All @@ -23,8 +23,7 @@ repos:
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
# unreleased, let's enable it later
#- id: check-illegal-windows-names
- id: check-illegal-windows-names
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
#- API_HASH=452b0359b988148995f22ff0f4229750 # get it from https://core.telegram.org/api/obtaining_api_id
#- IMG_RELAY_SERVER=https://wsrv.nl/?url= # default: https://rsstt-img-relay.rongrong.workers.dev/
#- IMAGES_WESERV_NL=https://t0.nl/ # default: https://wsrv.nl/
#- USER_AGENT=Mozilla/5.0 (Android 12; Mobile; rv:68.0) Gecko/68.0 Firefox/96.0 # default: RSStT/2.x RSS Reader
#- USER_AGENT=Mozilla/5.0 # default: RSStT/* RSS Reader (+https://git.io/RSStT)
#- IPV6_PRIOR=1 # default: 0
#- VERIFY_TLS=0 # default: 1
#- T_PROXY=socks5://172.17.0.1:1080 # Proxy used to connect to the Telegram API
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
### Enhancements

- **No longer proxies images from `*.wp.com` when generating Telegraph posts**: `*.wp.com` is in the blocklist of `wsrv.nl` (environment variable `IMAGES_WESERV_NL`). Thus, these images are no longer proxied when generating Telegraph posts. All images from `*.wp.com` can be accessed with any referer header, so they are now kept as is.
- **Minor refactor**: Some internal functions have been refactored to improve performance, readability and maintainability.

### Bug fixes

- **Canonical `DATABASE_URL` not recognized**: Since v2.9.0, `DATABASE_URL` is canonicalized before connecting to the corresponding database. However, a canonical URL pointing to a local path cannot be recognized when checking the validity of the scheme (database type). Both canonical (`scheme:/path/to/file.db`) and traditional (`scheme:///path/to/file.db`) forms of such URLs are recognized correctly now.
- **Monitoring not deferred as per server-side cache when subscribing**: Since v2.7.0, monitoring tasks will be deferred when aggressive server-side caches (e.g., Cloudflare and RSSHub, which make it futile to check for updates before cache expiration) are detected. However, the first monitoring task for a newly subscribed feed was not being deferred. This has been fixed and the first monitoring task now waits for the server-side cache to expire.
- **Minor bug fixes**

## v2.9.0: Telegraph-related revert, skip cert verification, and more

Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
### 增强

- **生成 Telegraph 文章时,不再代理来自 `*.wp.com` 的图像**: `*.wp.com` 位于 `wsrv.nl` (环境变量 `IMAGES_WESERV_NL`) 的阻断列表中。因此,在生成 Telegraph 文章时,这些图像不再被代理。来自 `*.wp.com` 的所有图片都可以用任何 refer 头访问,因此它们现在保持原样。
- **次要的重构**: 重构了一些内部函数以提高性能、可读性和可维护性。

### Bug 修复

- **无法识别规范的 `DATABASE_URL`**: 自 v2.9.0 起, 在连接到相应的数据库之前,`DATABASE_URL` 被规范化。然而,在检查 scheme (数据库类型) 的合法性时,无法识别指向本地路径的规范 URL。现在,此类 URL 的规范 (`scheme:/path/to/file.db`) 和传统 (`scheme:///path/to/file.db`) 形式都被正确识别。
- **订阅时不会根据服务端缓存延迟监控**:自 v2.7.0 起,当检测到激进的服务器端缓存时,监控任务将被延迟(例如 Cloudflare 和 RSSHub,它们使得在缓存过期之前检查更新变得徒劳无功)。但是,当新订阅 feed 时,第一个监视任务不会被推迟。该问题已修复,第一个监控任务会等待服务端缓存过期。
- **次要的 bug 修复**

## v2.9.0: 与 Telegraph 相关的 revert、跳过证书校验和更多

Expand Down
28 changes: 14 additions & 14 deletions docs/advanced-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@

### Network settings

| Key | Description | Example | Default |
|-----------------------------|-------------------------------------------------------|--------------------------------|-----------------------------|
| `T_PROXY` | Proxy used to connect to the Telegram API [^3] | `socks5://172.17.0.1:1080` | |
| `R_PROXY` | Proxy used to fetch feeds [^3] | `socks5://172.17.0.1:1080` | |
| `PROXY_BYPASS_PRIVATE` | Bypass proxy for private IPs or not? | `1` | `0` |
| `PROXY_BYPASS_DOMAINS` | Bypass proxy for listed domains | `example.com;example.net` [^1] | |
| `USER_AGENT` | User-Agent | `Mozilla/5.0` | `RSStT/$VERSION RSS Reader` |
| `IPV6_PRIOR` | Enforce fetching feeds over IPv6 firstly or not? [^4] | `1` | `0` |
| `VERIFY_TLS` | Verify TLS certificate or not? | `0` | `1` |
| `TRAFFIC_SAVING` | Enable network traffic saving mode or not? [^5] | `1` | `0` |
| `LAZY_MEDIA_VALIDATION` | Let Telegram DC to validate media or not? [^6] | `1` | `0` |
| `HTTP_TIMEOUT` | HTTP request timeout in seconds | `60` | `12` |
| `HTTP_CONCURRENCY` | HTTP request concurrency overall (0=unlimited) | `0` | `1024` |
| `HTTP_CONCURRENCY_PER_HOST` | HTTP request concurrency per host (0=unlimited) | `0` | `16` |
| Key | Description | Example | Default |
|-----------------------------|-------------------------------------------------------|--------------------------------|-----------------------------------------------------|
| `T_PROXY` | Proxy used to connect to the Telegram API [^3] | `socks5://172.17.0.1:1080` | |
| `R_PROXY` | Proxy used to fetch feeds [^3] | `socks5://172.17.0.1:1080` | |
| `PROXY_BYPASS_PRIVATE` | Bypass proxy for private IPs or not? | `1` | `0` |
| `PROXY_BYPASS_DOMAINS` | Bypass proxy for listed domains | `example.com;example.net` [^1] | |
| `USER_AGENT` | User-Agent | `Mozilla/5.0` | `RSStT/$VERSION RSS Reader (+https://git.io/RSStT)` |
| `IPV6_PRIOR` | Enforce fetching feeds over IPv6 firstly or not? [^4] | `1` | `0` |
| `VERIFY_TLS` | Verify TLS certificate or not? | `0` | `1` |
| `TRAFFIC_SAVING` | Enable network traffic saving mode or not? [^5] | `1` | `0` |
| `LAZY_MEDIA_VALIDATION` | Let Telegram DC to validate media or not? [^6] | `1` | `0` |
| `HTTP_TIMEOUT` | HTTP request timeout in seconds | `60` | `12` |
| `HTTP_CONCURRENCY` | HTTP request concurrency overall (0=unlimited) | `0` | `1024` |
| `HTTP_CONCURRENCY_PER_HOST` | HTTP request concurrency per host (0=unlimited) | `0` | `16` |

### Misc settings

Expand Down
31 changes: 16 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
# telegram and telegraph
cryptg==0.4.0
telethon==1.36.0
cryptg==0.5.0.post0
telethon==1.37.0
aiographfix==0.2.2

# feed parsing
feedparser==6.0.11 # feedparser@git+https://github.com/Rongronggg9/feedparser.git@develop
listparser[lxml]==0.20
pillow==10.4.0
pillow==11.0.0
beautifulsoup4==4.12.3
lxml==5.3.0
rapidfuzz==3.9.7
emoji==2.12.1
rapidfuzz==3.10.1
emoji==2.14.0
minify-html==0.15.0
minify-html-onepass==0.15.0
matplotlib==3.9.2

# db
asyncpg==0.29.0
tortoise-orm[accel]==0.21.6
asyncpg==0.30.0
tortoise-orm[accel]==0.21.7
aerich==0.7.2

# network
aiohttp[speedups]==3.10.5
aiohttp[speedups]==3.10.10
aiohttp-socks==0.9.0
aiohttp-retry==2.8.3
python-socks[asyncio]==2.5.1
dnspython[idna]==2.6.1
python-socks[asyncio]==2.5.3
dnspython[idna]==2.7.0

# utils
yarl==1.11.1
colorlog==6.8.2
yarl==1.17.1
propcache==0.2.0
colorlog==6.9.0
APScheduler==3.10.4
python-dotenv==1.0.1
multidict==6.1.0
asyncstdlib==3.12.5
asyncstdlib==3.13.0
cachetools==5.5.0
CJKwrap==2.2
typing-extensions==4.12.2
uvloop==0.20.0; sys_platform!='win32' and sys_platform!='cygwin' and sys_platform!='cli'
isal==1.7.0; platform_machine=='x86_64' or platform_machine=='AMD64' or platform_machine=='aarch64'
uvloop==0.21.0; sys_platform!='win32' and sys_platform!='cygwin' and sys_platform!='cli'
isal==1.7.1; platform_machine=='x86_64' or platform_machine=='AMD64' or platform_machine=='aarch64'
2 changes: 1 addition & 1 deletion src/command/inner/sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def sub(user_id: int,
if created_new_feed or feed.state == 0:
feed.state = 1
feed.error_count = 0
feed.next_check_time = None
feed.next_check_time = wf.calc_next_check_as_per_server_side_cache()
etag = wr.etag
if etag:
feed.etag = etag
Expand Down
4 changes: 2 additions & 2 deletions src/command/inner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from __future__ import annotations
from typing import Any, Union, Optional
from collections.abc import Iterable, Mapping, Sequence
from collections.abc import Iterable, Sequence

import asyncio
import re
Expand Down Expand Up @@ -141,7 +141,7 @@ def push(n_: int):
for n in sorted(lang_n_per_row.keys(), reverse=True)
for i in range(0, len(lang_n_per_row[n]), n)
)
langs = tuple(chain(*lang_n_per_row.values()))
langs = tuple(chain.from_iterable(lang_n_per_row.values()))
return buttons, langs


Expand Down
2 changes: 1 addition & 1 deletion src/command/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ async def execute():
cache_time=15,
)
logger.warning(
f'Refused Refused {describe_user()} to use {command} because they is not a participant'
f'Refused {describe_user()} to use {command} because they is not a participant'
)
raise events.StopPropagation
else: # an anonymous admin
Expand Down
2 changes: 1 addition & 1 deletion src/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def __get_version():

PROXY_BYPASS_PRIVATE: Final = __bool_parser(os.environ.get('PROXY_BYPASS_PRIVATE'))
PROXY_BYPASS_DOMAINS: Final = __list_parser(os.environ.get('PROXY_BYPASS_DOMAINS'))
USER_AGENT: Final = os.environ.get('USER_AGENT') or f'RSStT/{__version__} RSS Reader'
USER_AGENT: Final = os.environ.get('USER_AGENT') or f'RSStT/{__version__} RSS Reader (+https://git.io/RSStT)'
IPV6_PRIOR: Final = __bool_parser(os.environ.get('IPV6_PRIOR'))
VERIFY_TLS: Final = __bool_parser(os.environ.get('VERIFY_TLS'), default_value=True)

Expand Down
4 changes: 3 additions & 1 deletion src/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@
"length_limit_only_effective_if_send_mode_auto": "يكون حد الطول ساريًا فقط عندما يكون وضع الإرسال تلقائيًا.",
"display_media_only_effective_if_send_mode_auto_and_telegram": "لن يعرض وضع الإرسال الحالي أبدًا الوسائط في رسائل Telegram.",
"use_user_default_button": "استخدم الإفتراضي",
"read_formatting_settings_guidebook_html": "<a href=\"%s\">اقرأ دليل إعدادات التنسيق هنا.</a>"
"read_formatting_settings_guidebook_html": "<a href=\"%s\">اقرأ دليل إعدادات التنسيق هنا.</a>",
"display_entry_tags_-1": "تعطيل",
"display_entry_tags_1": "تمكين"
},
"l10n_cmd_set_default": {
"set_user_default_description": "قم بتعيين الإعدادات الافتراضية للاشتراكات.\n\nستعود إعدادات الاشتراك غير المضبوطة إلى الإعدادات الموجودة في هذه الصفحة. مفيد إذا كنت تريد تعيين نفس الإعدادات لمعظم اشتراكاتك.",
Expand Down
Loading
Loading