# 📤 PUBLISH — เอา LostHex ไปวางที่อื่นได้ / Where else to host

> GitHub ลบบัญชี/ระงับบัญชีได้ (pack สาย offensive + คำว่า hack/exploit/bypass โดน scanner อัตโนมัติ)
> ที่นี่คือ host ที่ **ToS เขียนไว้ชัดว่าเนื้อหา security research อยู่ได้** — เรียงตามความเสี่ยงต่ำสุด

## อันดับที่แนะนำ / Ranked

| อันดับ | ที่ / Host | ToS ว่าอะไร / Policy | ข้อควรระวัง | ค่าใช้จ่าย |
|---|---|---|---|---|
| 1 | **GitLab.com** | security research tools **อนุญาตเป็น exception** — ต้องมี description ชัด, README อธิบาย purpose, binary ใส่ zip มีรหัสผ่าน | binary ต้อง zip+รหัสผ่าน; ห้ามใช้เป็น attack infra | ฟรี |
| 2 | **GitGud.io** (Gitea) | แบนแค่ผิดกฎหมาย US, spam, CI abuse, ยิง infra ตัวเอง | เขียนไว้ชัดว่า "welcome security checks" | ฟรี |
| 3 | **Self-host Forgejo/Gitea** | กฎ = ของคุณเอง | ต้องมี VPS/เครื่องเอง (~$5/เดือน) | ตาม VPS |
| 4 | **Codeberg** | "harmful code อนุญาตเฉพาะ security research / education และ **ต้อง flag**" | ⚠️ กฎใหม่: โปรเจกต์ที่ LLM เขียนเยอะ + **mirror ของที่ host อื่น** อาจไม่ต้อนรับ | ฟรี (FOSS) |
| 5 | **SourceHut** | hacker forge, อีเมล-centric | ต้องจ่าย $4+/เดือน (CI จ่ายเพิ่ม) | $4–12/เดือน |
| 6 | **Radicle / git bundle** | ไม่มี host ให้แบน (P2P) | ต้องมี peer หรือแจกไฟล์เอง | ฟรี |

> NotABug.org — free-software only, MIT ผ่าน แต่ **web UI ล่ม** (AI scraper flood, กลาง 2026) เหลือ git+SSH


## 🐙 ทางที่ใช้จริงตอนนี้ / What is live now

| อะไร | URL |
|---|---|
| เว็ปอ่าน (GitHub-style, ทุกไฟล์ + search + zip) | https://losthex-skills.pages.dev |
| git clone / push (Cloudflare Workers + Durable Objects) | `https://losthex-git.lostsky777.workers.dev/losthex-skills.git` |
| Worker source (deploy ซ้ำได้) | `cfgit/` — `npx wrangler deploy` |

```bash
# clone — ไม่ต้องมี credential (anonymous read)
git clone https://losthex-git.lostsky777.workers.dev/losthex-skills.git
git ls-remote https://losthex-git.lostsky777.workers.dev/losthex-skills.git

# push กลับ (ต้องมี GIT_TOKEN ที่ตั้งไว้ตอน deploy)
git push https://x:$GIT_TOKEN@losthex-git.lostsky777.workers.dev/losthex-skills.git main
```

- Worker `losthex-git` = npm package `durable-git` (git smart HTTP + cgit UI) บน Durable Objects + SQLite; R2 ปิดอยู่บนบัญชีนี้จึงไม่ใช้ pack cache
- อัปเดตเว็ปหลังแก้ repo: `python scripts/build_site.py && npx wrangler pages deploy site --project-name=losthex-skills`
- อัปเดต git server: `git push` ตามด้านบน

## วิธี push ไป host ใหม่ / Push to a new host

repo มี bundle สำรองอยู่แล้ว (ทุก commit ครบ) — ใช้ได้เลยไม่ต้องมี GitHub:

```bash
# 1) clone จาก bundle (ถ้าเครื่องใหม่)
git clone LostHex-Skills-<sha>.bundle LostHex-Skills

# 2) ชี้ remote ใหม่ (ตัวอย่าง GitLab / GitGud)
git remote set-url origin https://gitlab.com/<user>/LostHex-Skills.git
# หรือเพิ่มเป็น mirror
git remote add gitgud https://gitgud.io/<user>/LostHex-Skills.git

# 3) push ทุก branch + tag
git push origin main --tags
git push gitgud main --tags
```


## 🌐 เว็ปแบบ GitHub บน Cloudflare (Pages) — ไม่ต้องมี GitHub เลย

repo นี้มี site builder ในตัว: render ทุกไฟล์เป็นหน้าเว็บ + tree + search + ปุ่มโหลด zip

```bash
python scripts/build_site.py                                  # -> site/  (607 หน้า + zip 8.4 MB)
npx wrangler pages project create losthex-skills --production-branch=main
npx wrangler pages deploy site --project-name=losthex-skills  # -> https://losthex-skills.pages.dev
```

- หน้าเว็บ: landing = README, ทุกไฟล์มีหน้า `.html` ของตัวเอง + `/raw/<path>` ให้ curl ตรงได้
- `wrangler login` ครั้งเดียว (OAuth ผ่าน browser) — ไม่ผูกกับ GitHub/GitLab
- deploy ซ้ำได้เรื่อยๆ (`build_site.py` แล้ว deploy ทับ) = เว็ปอัปเดตตาม repo

### อยากได้ `git clone` จริงบน Cloudflare?

Pages ให้แค่ static — ถ้าต้องการ git remote จริงมี 2 ทาง (ทั้งคู่รันบน Workers + Durable Objects + R2):

| ทาง | คืออะไร | คำสั่ง |
|---|---|---|
| `durable-git` (npm) | git server เป็น Durable Object — smart HTTP + cgit UI + R2 pack cache | `npm i durable-git` → `npx wrangler deploy` → `npx wrangler secret put GIT_TOKEN` → `git push https://host/repo.git main` |
| `git-on-cloudflare` (zllovesuki) | git smart HTTP v2 ทั้งชุดบน Workers + R2 + DO | clone repo → `npm i` → `npm run dev` → `wrangler deploy` |

> ข้อจำกัด Workers: 128 MB memory / 5 นาที CPU ต่อ request → repo ใหญ่ push เป็นชุดเล็กๆ; clone/fetch ปกติสบาย
> Cloudflare Artifacts (beta) ก็เป็น git บน DO+R2 เหมือนกัน แต่ยัง private beta

## ทำ repo ให้นิ่งกับ scanner / Lower the ban risk

- GitLab exception ต้องมี: **description ชัด + README อธิบาย purpose + author** (README ปัจจุบันมีแล้ว)
- ไม่มี binary ใน pack นี้เลย (markdown ล้วน) → ผ่านเงื่อนไข GitLab ได้ตรงๆ
- อย่าใช้ host เป็น attack infra (ห้ามให้ repo ยิง payload ไปเป้าใคร)
- ถ้าโดนลบเพราะชื่อ/คำ: ลดคำใน description ที่ scanner จับ (`hack`, `bypass av`, `exploit kit`) — เนื้อหายังอยู่ครบ เปลี่ยนแค่คำที่โชว์

## Backup แบบไม่พึ่ง host / Host-independent backup

```bash
git bundle create LostHex-<sha>.bundle --all   # ไฟล์เดียว มีทุก commit
git bundle verify LostHex-<sha>.bundle
```
แจก bundle ผ่าน file host / Tor / IPFS ได้ — ไม่มีใครลบ repo ได้
