mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-18 01:24:35 +03:00
fix: update GitHub relay max file size to 15 MB and adjust TTL in setup script
This commit is contained in:
+3
-3
@@ -357,7 +357,7 @@ make upx # فشردهسازی باینریها با UPX
|
||||
دو رله الان موجود هست:
|
||||
|
||||
- **رله DNS** (کند، پیشفرض روشن). بایتها به بلاکهای DNS تقسیم میشوند. در شبکههای فیلترشده کار میکند. سقف پیشفرض: ۱۰۰ کیلوبایت.
|
||||
- **رله گیتهاب** (سریع، پیشفرض خاموش). فایلها در یک ریپازیتوری آپلود میشوند و کلاینتها از طریق `api.github.com` (که در خیلی از کشورها برخلاف `raw.githubusercontent.com` در دسترس است) با HTTPS میگیرند. به یک Personal Access Token با اسکوپ `contents:write` نیاز دارد. مسیر فایلها `<repo>/<sanitised-domain>/<size>_<crc32>` است تا چند سرور بتوانند یک ریپازیتوری مشترک داشته باشند. سقف پیشفرض: ۲۵ مگابایت.
|
||||
- **رله گیتهاب** (سریع، پیشفرض خاموش). فایلها در یک ریپازیتوری آپلود میشوند و کلاینتها از طریق `api.github.com` (که در خیلی از کشورها برخلاف `raw.githubusercontent.com` در دسترس است) با HTTPS میگیرند. به یک Personal Access Token با اسکوپ `contents:write` نیاز دارد. مسیر فایلها `<repo>/<sanitised-domain>/<size>_<crc32>` است تا چند سرور بتوانند یک ریپازیتوری مشترک داشته باشند. سقف پیشفرض: ۱۵ مگابایت.
|
||||
|
||||
پرچمها / متغیرهای محیطی:
|
||||
|
||||
@@ -373,7 +373,7 @@ make upx # فشردهسازی باینریها با UPX
|
||||
| `--github-relay-token` | `THEFEED_GITHUB_RELAY_TOKEN` | — | PAT با دسترسی `contents:write` |
|
||||
| `--github-relay-repo` | `THEFEED_GITHUB_RELAY_REPO` | — | `owner/repo` |
|
||||
| `--github-relay-branch` | `THEFEED_GITHUB_RELAY_BRANCH` | `main` | برنچ کامیت |
|
||||
| `--github-relay-max-size` | `THEFEED_GITHUB_RELAY_MAX_SIZE_KB` | `25600` (KB) | سقف هر فایل |
|
||||
| `--github-relay-max-size` | `THEFEED_GITHUB_RELAY_MAX_SIZE_KB` | `15360` (KB) | سقف هر فایل |
|
||||
| `--github-relay-ttl` | `THEFEED_GITHUB_RELAY_TTL_MIN` | `600` (min) | فایلهای یتیم در سیکل بعدی پاک میشوند |
|
||||
|
||||
</div>
|
||||
@@ -407,7 +407,7 @@ make upx # فشردهسازی باینریها با UPX
|
||||
| `--github-relay-token` | | توکن گیتهاب (`contents:write`) |
|
||||
| `--github-relay-repo` | | `owner/repo` ریپازیتوری رله |
|
||||
| `--github-relay-branch` | `main` | برنچی که رله روش کامیت میکند |
|
||||
| `--github-relay-max-size` | `25600` | سقف هر فایل برای رله گیتهاب بر حسب KB |
|
||||
| `--github-relay-max-size` | `15360` | سقف هر فایل برای رله گیتهاب بر حسب KB |
|
||||
| `--github-relay-ttl` | `600` | TTL رله گیتهاب بر حسب دقیقه |
|
||||
|
||||
## 📋 پرچمهای کلاینت
|
||||
|
||||
@@ -83,7 +83,7 @@ Each relay is independent — the same file can be served via DNS *and* GitHub *
|
||||
Two relays ship today:
|
||||
|
||||
- **DNS relay** (slow, default on). Bytes are split into DNS blocks. Survives in censored networks. Default cap: 100 KB.
|
||||
- **GitHub relay** (fast, default off). Bytes are uploaded to a repo and pulled by clients over plain HTTPS. Needs a personal access token with `contents:write`. Files land at `<repo>/<sanitised-domain>/<size>_<crc32>` so multiple deployments can share one repo. Default cap: 25 MB.
|
||||
- **GitHub relay** (fast, default off). Bytes are uploaded to a repo and pulled by clients over plain HTTPS. Needs a personal access token with `contents:write`. Files land at `<repo>/<sanitised-domain>/<size>_<crc32>` so multiple deployments can share one repo. Default cap: 15 MB.
|
||||
|
||||
Block 0 of every DNS-cached file begins with a 16-byte protocol header — 4 bytes CRC32 of the (decompressed) content, 1 byte version, 1 byte compression, 10 bytes reserved. The remaining bytes are decompressed per the compression byte. Downloads are cached on the client (IndexedDB, 7 days) and on the local thefeed-client server (`<dataDir>/media-cache/`, 7 days). Concurrent downloads are limited and extra clicks are queued.
|
||||
|
||||
@@ -99,7 +99,7 @@ Server flags / env vars:
|
||||
| `--github-relay-token` | `THEFEED_GITHUB_RELAY_TOKEN` | — | PAT, `contents:write` |
|
||||
| `--github-relay-repo` | `THEFEED_GITHUB_RELAY_REPO` | — | `owner/repo` |
|
||||
| `--github-relay-branch` | `THEFEED_GITHUB_RELAY_BRANCH` | `main` | branch to commit relay objects to |
|
||||
| `--github-relay-max-size` | `THEFEED_GITHUB_RELAY_MAX_SIZE_KB` | `25600` (KB)| per-file cap |
|
||||
| `--github-relay-max-size` | `THEFEED_GITHUB_RELAY_MAX_SIZE_KB` | `15360` (KB)| per-file cap |
|
||||
| `--github-relay-ttl` | `THEFEED_GITHUB_RELAY_TTL_MIN` | `600` (min) | orphans pruned next refresh cycle |
|
||||
|
||||
The hourly DNS report includes `totalMediaQueries` and a `mediaCache` block (entries, bytes, hits, misses, evictions).
|
||||
@@ -388,7 +388,7 @@ Environment variables: `THEFEED_DOMAIN`, `THEFEED_KEY`, `THEFEED_MSG_LIMIT`, `TH
|
||||
| `--github-relay-token` | | PAT with `contents:write` (or `THEFEED_GITHUB_RELAY_TOKEN`) |
|
||||
| `--github-relay-repo` | | `owner/repo` for the relay |
|
||||
| `--github-relay-branch` | `main` | Branch to commit relay objects to |
|
||||
| `--github-relay-max-size` | `25600` | Per-file cap for the GitHub relay in KB |
|
||||
| `--github-relay-max-size` | `15360` | Per-file cap for the GitHub relay in KB |
|
||||
| `--github-relay-ttl` | `600` | GitHub-relay TTL in minutes (orphans pruned next cycle) |
|
||||
| `--version` | | Show version and exit |
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ func main() {
|
||||
ghToken := flag.String("github-relay-token", "", "GitHub PAT with contents:write on the relay repo")
|
||||
ghRepo := flag.String("github-relay-repo", "", "GitHub repo for the fast relay, e.g. owner/repo")
|
||||
ghBranch := flag.String("github-relay-branch", "main", "Default branch to commit to (e.g. main, master)")
|
||||
ghMaxSizeKB := flag.Int("github-relay-max-size", 25*1024, "Per-file cap for the GitHub relay in KB (0 = no cap)")
|
||||
ghMaxSizeKB := flag.Int("github-relay-max-size", 15*1024, "Per-file cap for the GitHub relay in KB (0 = no cap)")
|
||||
ghCacheTTLMin := flag.Int("github-relay-ttl", 600, "TTL for GitHub-relay objects in minutes")
|
||||
showVersion := flag.Bool("version", false, "Show version and exit")
|
||||
flag.Usage = func() {
|
||||
|
||||
+1
-1
@@ -365,7 +365,7 @@ setup_config() {
|
||||
|
||||
local gh_token="" gh_repo="" gh_branch="${cur_gh_branch:-main}"
|
||||
local gh_max_size="${cur_gh_size:-15360}"
|
||||
local gh_ttl="${cur_gh_ttl:-10080}"
|
||||
local gh_ttl="${cur_gh_ttl:-600}"
|
||||
if [[ "$gh_enabled" == "1" ]]; then
|
||||
if [[ -n "$cur_gh_token" ]]; then
|
||||
read -rp "GitHub token (PAT, contents:write) [keep current]: " gh_token
|
||||
|
||||
Reference in New Issue
Block a user