diff --git a/public/.well-known/security.txt b/public/.well-known/security.txt index 5fd37ac..ee3e910 100644 --- a/public/.well-known/security.txt +++ b/public/.well-known/security.txt @@ -1,6 +1,5 @@ Contact: mailto:security@poli0981.dev -Contact: https://github.com/poli0981/softharbor/security/advisories/new Preferred-Languages: en, vi Expires: 2027-07-28T00:00:00.000Z Canonical: https://softharbor.net/.well-known/security.txt -Policy: https://github.com/poli0981/softharbor/blob/main/SECURITY.md +Policy: https://git.poli0981.dev/poli0981/softharbor/src/branch/main/SECURITY.md diff --git a/src/components/ShFooter.astro b/src/components/ShFooter.astro index d4def0e..b4c1907 100644 --- a/src/components/ShFooter.astro +++ b/src/components/ShFooter.astro @@ -6,12 +6,12 @@ import ShIcon from './ShIcon.astro'; import ShBugReport from './islands/ShBugReport.svelte'; import { localePath, t, type Locale } from '../i18n'; +import { RELEASES_URL, SOURCE_URL, sourceFile } from '../lib/forge'; interface Props { locale: Locale; } const { locale } = Astro.props; -const REPO = 'https://github.com/poli0981/softharbor'; const legal = [ ['/legal/disclaimer', 'footer.legal.disclaimer'], @@ -66,7 +66,7 @@ const built = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', { {t(locale, 'footer.rss')} - + CC BY-SA 4.0 @@ -85,11 +85,11 @@ const built = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', { {t(locale, 'footer.project')} {t(locale, 'footer.contact')} - - {t(locale, 'footer.github')} + + {t(locale, 'footer.source')} - + {t(locale, 'footer.releases')} diff --git a/src/components/islands/ShBugReport.svelte b/src/components/islands/ShBugReport.svelte index 6616c4f..577ad3e 100644 --- a/src/components/islands/ShBugReport.svelte +++ b/src/components/islands/ShBugReport.svelte @@ -37,7 +37,7 @@ + issue on the GitLab mirror themselves (docs/09 §8, docs/14 §3b). --> { it('points at the bare bug form until the visitor reaches for it', () => { // Works before (and without) hydration; the prefilled URL comes later. expect(link.getAttribute('href')).toBe( - 'https://github.com/poli0981/softharbor/issues/new?template=bug_report.yml&labels=bug', + 'https://gitlab.com/poli0981/softharbor/-/issues/new?issuable_template=Bug', ); expect(link.getAttribute('rel')).toBe('noopener'); expect(link.getAttribute('target')).toBe('_blank'); @@ -44,17 +44,17 @@ describe('ShBugReport', () => { expect(link.textContent?.trim()).toBe('Báo lỗi (mở trong thẻ mới)'); }); - it('prefills the issue form with the page as it is on focus', () => { + it('prefills the issue with the page as it is on focus', () => { link.dispatchEvent(new FocusEvent('focus')); flushSync(); const url = new URL(link.href); expect(`${url.origin}${url.pathname}`).toBe( - 'https://github.com/poli0981/softharbor/issues/new', + 'https://gitlab.com/poli0981/softharbor/-/issues/new', ); - expect(url.searchParams.get('template')).toBe('bug_report.yml'); - expect(url.searchParams.get('page-url')).toBe(location.href); - expect(url.searchParams.get('environment')).toContain('lang=vi'); - expect(url.searchParams.get('console-output')).toBe('(buffer empty)'); + const description = url.searchParams.get('issue[description]') ?? ''; + expect(description).toContain(`### Page URL\n\n${location.href}\n`); + expect(description).toContain('lang=vi'); + expect(description).toContain('```shell\n(buffer empty)\n```'); }); it('shows how many errors the buffer caught, and sends them along', () => { @@ -62,6 +62,8 @@ describe('ShBugReport', () => { link.dispatchEvent(new MouseEvent('mouseenter')); flushSync(); expect(link.textContent).toContain('(2 lỗi)'); - expect(new URL(link.href).searchParams.get('console-output')).toBe('[error] a\n[error] b'); + expect(new URL(link.href).searchParams.get('issue[description]')).toContain( + '```shell\n[error] a\n[error] b\n```', + ); }); }); diff --git a/src/components/legal/Accessibility.astro b/src/components/legal/Accessibility.astro index 225e780..b025c19 100644 --- a/src/components/legal/Accessibility.astro +++ b/src/components/legal/Accessibility.astro @@ -7,14 +7,15 @@ // link targets (#report from the footer of ACCESSIBILITY.md and the issue // form). import { CONTACTS } from '../../lib/contacts'; +import { newIssue, sourceFile } from '../../lib/forge'; import type { Locale } from '../../i18n'; interface Props { locale: Locale; } const { locale } = Astro.props; const MAIL = CONTACTS.accessibility; -const FORM = 'https://github.com/poli0981/softharbor/issues/new?template=accessibility.yml'; -const GUIDE = 'https://github.com/poli0981/softharbor/blob/main/ACCESSIBILITY.md'; +const FORM = newIssue('Accessibility'); +const GUIDE = sourceFile('ACCESSIBILITY.md'); const WCAG = 'https://www.w3.org/TR/WCAG22/'; --- @@ -101,10 +102,10 @@ const WCAG = 'https://www.w3.org/TR/WCAG22/';

Report a barrier

Email {MAIL}, or open an accessibility issue{' '} - on GitHub (that needs a GitHub account; email does not). If you can, say which page you were - on, what you were trying to do, what happened, and which device, browser and assistive - technology you use. Screenshots or recordings are welcome but never required, and you never - need to tell us about a disability. Write in English or Vietnamese. + on our GitLab mirror (that needs a GitLab account; email does not). If you can, say which page + you were on, what you were trying to do, what happened, and which device, browser and + assistive technology you use. Screenshots or recordings are welcome but never required, and + you never need to tell us about a disability. Write in English or Vietnamese.

What happens next

@@ -226,11 +227,11 @@ const WCAG = 'https://www.w3.org/TR/WCAG22/';

Báo một trở ngại

Gửi email đến {MAIL}, hoặc{' '} - mở một issue về trợ năng trên GitHub (cần tài khoản GitHub; email thì không - cần). Nếu được, hãy cho biết bạn đang ở trang nào, định làm gì, chuyện gì đã xảy ra, và bạn - dùng thiết bị, trình duyệt, công nghệ hỗ trợ nào. Ảnh chụp hay video màn hình luôn được hoan - nghênh nhưng không bắt buộc, và bạn không bao giờ cần cho chúng tôi biết về tình trạng khuyết - tật. Bạn có thể viết bằng tiếng Việt hoặc tiếng Anh. + mở một issue về trợ năng trên bản sao GitLab của dự án (cần tài khoản + GitLab; email thì không cần). Nếu được, hãy cho biết bạn đang ở trang nào, định làm gì, chuyện + gì đã xảy ra, và bạn dùng thiết bị, trình duyệt, công nghệ hỗ trợ nào. Ảnh chụp hay video màn + hình luôn được hoan nghênh nhưng không bắt buộc, và bạn không bao giờ cần cho chúng tôi biết + về tình trạng khuyết tật. Bạn có thể viết bằng tiếng Việt hoặc tiếng Anh.

Sau khi bạn báo

diff --git a/src/components/legal/Disclaimer.astro b/src/components/legal/Disclaimer.astro index 41db855..31d8989 100644 --- a/src/components/legal/Disclaimer.astro +++ b/src/components/legal/Disclaimer.astro @@ -6,13 +6,14 @@ // The reporting routes match SECURITY.md: a dangerous listing is a security // report (private), wrong information is an ordinary issue. import { CONTACTS } from '../../lib/contacts'; +import { newIssue } from '../../lib/forge'; import type { Locale } from '../../i18n'; interface Props { locale: Locale; } const { locale } = Astro.props; const { security: SECURITY, takedown: TAKEDOWN } = CONTACTS; -const ISSUES = 'https://github.com/poli0981/softharbor/issues'; +const ISSUES = newIssue('Listing change'); const base = locale === 'vi' ? '/vi/legal' : '/legal'; --- @@ -50,8 +51,8 @@ const base = locale === 'vi' ? '/vi/legal' : '/legal'; Reporting a listing: a dangerous one — a hijacked, look-alike or malicious download link — goes privately to {SECURITY}, not to a public issue, so the bad link is not spread further. Outdated or wrong information goes to a{' '} - GitHub issue; a developer who wants their entry changed or removed can - write to {TAKEDOWN}. + issue on our GitLab mirror; a developer who wants their entry changed + or removed can write to {TAKEDOWN}. @@ -89,8 +90,8 @@ const base = locale === 'vi' ? '/vi/legal' : '/legal'; Báo cáo một mục: mục nguy hiểm — liên kết tải về bị chiếm quyền, giả mạo hoặc độc hại — hãy báo riêng tới {SECURITY}, đừng mở issue công khai, để liên kết xấu không bị lan rộng thêm. Thông tin lỗi thời hoặc sai hãy báo - qua GitHub issue; nhà phát triển muốn sửa hoặc gỡ mục của mình có thể - viết tới {TAKEDOWN}. + qua issue trên bản sao GitLab của dự án; nhà phát triển muốn sửa hoặc + gỡ mục của mình có thể viết tới {TAKEDOWN}. diff --git a/src/components/legal/Privacy.astro b/src/components/legal/Privacy.astro index 646dd25..fe30fb1 100644 --- a/src/components/legal/Privacy.astro +++ b/src/components/legal/Privacy.astro @@ -120,11 +120,11 @@ const PRIVACY = CONTACTS.privacy;

Bug reports

- "Report a bug" is a link to a prefilled GitHub issue form. Its address contains the page's - URL, your browser's user-agent string and recent error lines from this site, so{' '} - GitHub receives them as soon as you open the link. Nothing is filed until you - review and submit the form, under GitHub's terms and privacy policy — remove anything you - would rather not share first. + "Report a bug" is a link to a new, prefilled issue on our GitLab mirror (gitlab.com). Its + address contains the page's URL, your browser's user-agent string and recent error lines from + this site, so GitLab receives them as soon as you open the link. Nothing is + filed until you review and submit the issue, under GitLab's terms and privacy policy — remove + anything you would rather not share first.

@@ -254,11 +254,12 @@ const PRIVACY = CONTACTS.privacy;

Báo lỗi

- "Báo lỗi" là liên kết tới một biểu mẫu issue GitHub được điền sẵn. Địa chỉ của liên kết chứa - URL của trang, chuỗi user-agent của trình duyệt và các dòng lỗi gần đây của trang này, nên{' '} - GitHub nhận được chúng ngay khi bạn mở liên kết. Không có gì được đăng cho - tới khi bạn xem lại và tự gửi biểu mẫu, theo điều khoản và chính sách quyền riêng tư của - GitHub — hãy xoá những gì bạn không muốn chia sẻ trước khi gửi. + "Báo lỗi" là liên kết tới một issue mới được điền sẵn trên bản sao GitLab của dự án + (gitlab.com). Địa chỉ của liên kết chứa URL của trang, chuỗi user-agent của trình duyệt và các + dòng lỗi gần đây của trang này, nên{' '} + GitLab nhận được chúng ngay khi bạn mở liên kết. Không có gì được đăng cho + tới khi bạn xem lại và tự gửi issue, theo điều khoản và chính sách quyền riêng tư của GitLab — + hãy xoá những gì bạn không muốn chia sẻ trước khi gửi.

diff --git a/src/components/legal/Terms.astro b/src/components/legal/Terms.astro index 8c8361e..be4a2fc 100644 --- a/src/components/legal/Terms.astro +++ b/src/components/legal/Terms.astro @@ -4,13 +4,14 @@ // docs/14 §3c. Governing law (Vietnam) is a Kokone sign-off item — docs/14 Part 4. // `#copyright` is the notice-and-takedown procedure the Contact page links to. import { CONTACTS } from '../../lib/contacts'; +import { sourceFile } from '../../lib/forge'; import type { Locale } from '../../i18n'; interface Props { locale: Locale; } const { locale } = Astro.props; const SITE = 'https://softharbor.net'; -const LICENSE_DATA = 'https://github.com/poli0981/softharbor/blob/main/LICENSE-DATA.md'; +const LICENSE_DATA = sourceFile('LICENSE-DATA.md'); const { legal: LEGAL, dmca: DMCA, takedown: TAKEDOWN } = CONTACTS; const base = locale === 'vi' ? '/vi/legal' : '/legal'; --- diff --git a/src/components/legal/ThirdParty.astro b/src/components/legal/ThirdParty.astro index ab84e26..b03c8a2 100644 --- a/src/components/legal/ThirdParty.astro +++ b/src/components/legal/ThirdParty.astro @@ -52,13 +52,12 @@ const services = [ policy: 'https://www.cloudflare.com/privacypolicy/', }, { - name: 'GitHub', + name: 'GitLab', what: { - en: 'The source repository, issues, and the prefilled "Report a bug" form.', - vi: 'Kho mã nguồn, issue và biểu mẫu "Báo lỗi" được điền sẵn.', + en: 'The public mirror of the source repository: issues, and the prefilled "Report a bug" issue. The source itself is on our own Gitea (git.poli0981.dev).', + vi: 'Bản sao công khai của kho mã nguồn: issue và issue "Báo lỗi" được điền sẵn. Bản gốc của mã nguồn nằm trên máy chủ Gitea của chúng tôi (git.poli0981.dev).', }, - policy: - 'https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement', + policy: 'https://about.gitlab.com/privacy/', }, ]; diff --git a/src/components/legal/Trademarks.astro b/src/components/legal/Trademarks.astro index b0890ae..5251d1c 100644 --- a/src/components/legal/Trademarks.astro +++ b/src/components/legal/Trademarks.astro @@ -4,13 +4,14 @@ // docs/14 §3d. The logo-handling rules here are the ones src/lib/icon.ts and // the Simple Icons caveat in §3e depend on. import { CONTACTS } from '../../lib/contacts'; +import { newIssue } from '../../lib/forge'; import type { Locale } from '../../i18n'; interface Props { locale: Locale; } const { locale } = Astro.props; const TAKEDOWN = CONTACTS.takedown; -const ISSUES = 'https://github.com/poli0981/softharbor/issues'; +const ISSUES = newIssue('Listing change'); --- {locale === 'en' ? ( @@ -31,8 +32,9 @@ const ISSUES = 'https://github.com/poli0981/softharbor/issues';

Takedown

If you own a mark and want its use changed or removed, email{' '} - {TAKEDOWN} or open a GitHub issue — we - comply promptly and remove the entry's logo (or the entry) while we discuss it. + {TAKEDOWN} or open an{' '} + issue on our GitLab mirror — we comply promptly and remove the entry's + logo (or the entry) while we discuss it.

) : ( @@ -51,8 +53,9 @@ const ISSUES = 'https://github.com/poli0981/softharbor/issues';

Yêu cầu gỡ bỏ

Nếu bạn là chủ sở hữu nhãn hiệu và muốn thay đổi hoặc gỡ việc sử dụng, hãy email tới{' '} - {TAKEDOWN} hoặc mở GitHub issue — - chúng tôi đáp ứng kịp thời và gỡ logo của mục (hoặc cả mục) trong khi trao đổi. + {TAKEDOWN} hoặc mở{' '} + issue trên bản sao GitLab của dự án — chúng tôi đáp ứng kịp thời và gỡ + logo của mục (hoặc cả mục) trong khi trao đổi.

)} diff --git a/src/components/pages/ContactPage.astro b/src/components/pages/ContactPage.astro index 72bd882..d0c0685 100644 --- a/src/components/pages/ContactPage.astro +++ b/src/components/pages/ContactPage.astro @@ -8,13 +8,13 @@ import Base from '../../layouts/Base.astro'; import ShIcon from '../ShIcon.astro'; import { CONTACTS } from '../../lib/contacts'; +import { NEW_ISSUE_URL } from '../../lib/forge'; import { localePath, t, type Locale } from '../../i18n'; interface Props { locale: Locale; } const { locale } = Astro.props; -const ISSUES = 'https://github.com/poli0981/softharbor/issues/new/choose'; /** Order is urgency: what can hurt someone first, press and collaboration last. */ const rows = [ @@ -87,7 +87,7 @@ const rows = [

{t(locale, 'contact.issues')}

- + {t(locale, 'contact.issuesLink')} diff --git a/src/i18n/en.json b/src/i18n/en.json index 427933e..735452c 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -20,7 +20,7 @@ "contact.copyright": "Licensing of the code or the dataset", "contact.dmca": "A copyright complaint", "contact.intro": "SoftHarbor is run by one person. Each address below reaches the same maintainer, sorted by purpose, so your message is read in the right context.", - "contact.issues": "Wrong information, a broken link, or an app to suggest? Open a GitHub issue — it is public, and usually faster.", + "contact.issues": "Wrong information, a broken link, or an app to suggest? Open an issue on our GitLab mirror — it is public, needs a GitLab account, and is usually faster.", "contact.issuesLink": "Open an issue", "contact.languages": "We read and reply in English and Vietnamese. Email is handled as the Privacy Policy describes.", "contact.legal": "Terms, the disclaimer and other legal questions", @@ -73,7 +73,6 @@ "footer.builtAt": "Built {date}", "footer.contact": "Contact", "footer.data": "Open data", - "footer.github": "Source on GitHub", "footer.legal.accessibility": "Accessibility", "footer.legal.aiDisclosure": "AI disclosure", "footer.legal.disclaimer": "Disclaimer", @@ -86,6 +85,7 @@ "footer.project": "Project", "footer.releases": "Releases", "footer.rss": "RSS feed", + "footer.source": "Source code", "gate.accept": "I understand and accept", "gate.and": "and", "gate.body": "SoftHarbor is a link directory. We don't host downloads, and we can't guarantee third-party software. Statuses like \"no known warnings\" reflect checks on the date shown — verify anything you install. By continuing you accept the", diff --git a/src/i18n/vi.json b/src/i18n/vi.json index 791d828..2c90b44 100644 --- a/src/i18n/vi.json +++ b/src/i18n/vi.json @@ -20,7 +20,7 @@ "contact.copyright": "Giấy phép của mã nguồn hoặc bộ dữ liệu", "contact.dmca": "Khiếu nại bản quyền", "contact.intro": "SoftHarbor do một người vận hành. Mỗi địa chỉ dưới đây đều tới cùng người bảo trì, được chia theo mục đích để thư của bạn được đọc đúng ngữ cảnh.", - "contact.issues": "Thông tin sai, liên kết hỏng, hay muốn đề xuất một ứng dụng? Hãy mở GitHub issue — công khai và thường nhanh hơn.", + "contact.issues": "Thông tin sai, liên kết hỏng, hay muốn đề xuất một ứng dụng? Hãy mở issue trên bản sao GitLab của dự án — công khai, cần tài khoản GitLab và thường nhanh hơn.", "contact.issuesLink": "Mở issue", "contact.languages": "Chúng tôi đọc và trả lời bằng tiếng Anh và tiếng Việt. Email được xử lý như Chính sách quyền riêng tư mô tả.", "contact.legal": "Điều khoản, tuyên bố miễn trừ và các câu hỏi pháp lý khác", @@ -73,7 +73,6 @@ "footer.builtAt": "Dựng ngày {date}", "footer.contact": "Liên hệ", "footer.data": "Dữ liệu mở", - "footer.github": "Mã nguồn trên GitHub", "footer.legal.accessibility": "Trợ năng", "footer.legal.aiDisclosure": "Công bố AI", "footer.legal.disclaimer": "Tuyên bố miễn trừ", @@ -86,6 +85,7 @@ "footer.project": "Dự án", "footer.releases": "Các bản phát hành", "footer.rss": "Nguồn RSS", + "footer.source": "Mã nguồn", "gate.accept": "Tôi hiểu và chấp nhận", "gate.and": "và", "gate.body": "SoftHarbor là trang tổng hợp liên kết. Chúng tôi không lưu trữ tệp cài đặt và không thể bảo đảm cho phần mềm bên thứ ba. Trạng thái như \"không có cảnh báo đã biết\" chỉ phản ánh việc kiểm tra tại ngày ghi kèm — hãy tự xác minh trước khi cài đặt. Khi tiếp tục, bạn chấp nhận", diff --git a/src/lib/feed.test.ts b/src/lib/feed.test.ts index e272fe4..578307c 100644 --- a/src/lib/feed.test.ts +++ b/src/lib/feed.test.ts @@ -80,7 +80,7 @@ describe('buildExport — docs/03 §6', () => { // Attribution must name the project and point at the repo — it is the // string re-users are asked to reproduce (docs/14 Part 1). expect(out.attribution).toContain('SoftHarbor contributors'); - expect(out.attribution).toContain('github.com/poli0981/softharbor'); + expect(out.attribution).toContain('git.poli0981.dev/poli0981/softharbor'); expect(out.generatedAt).toBe('2026-07-28T00:00:00Z'); }); diff --git a/src/lib/feed.ts b/src/lib/feed.ts index ac30164..5aa812f 100644 --- a/src/lib/feed.ts +++ b/src/lib/feed.ts @@ -6,6 +6,8 @@ // Pure functions over plain objects so the contracts that matter (feed // determinism, export shape) are unit-testable without running a build. +import { SOURCE_URL } from './forge'; + export interface FeedApp { slug: string; name: string; @@ -25,8 +27,8 @@ export const FEED_LIMIT = 50; /** * Name tie-break with a PINNED locale. A bare `localeCompare()` collates by - * the build machine's ICU default — and builds now run on Cloudflare Workers - * Builds as well as GitHub CI and laptops. If two machines disagreed, the + * the build machine's ICU default — and builds run on the CI runner's + * container as well as on laptops. If two machines disagreed, the * 50-item window could change membership between builds and notify.py would * announce apps that are not new. `en` matches the order production has * served since launch (verified byte-for-byte against the live /rss.xml). @@ -75,7 +77,9 @@ export function buildExport(apps: readonly ExportApp[], generatedAt: string) { generatedAt, count: apps.length, license: 'CC-BY-SA-4.0', - attribution: 'SoftHarbor contributors — https://github.com/poli0981/softharbor', + // The repository moved to Gitea in November 2026 (D38); the field and its + // shape are unchanged, only the address it names. + attribution: `SoftHarbor contributors — ${SOURCE_URL}`, // Code-unit order: slugs are ASCII kebab-case, where it matches `en` // collation exactly — without depending on the build machine's ICU // default the way a bare localeCompare() did. diff --git a/src/lib/forge.test.ts b/src/lib/forge.test.ts new file mode 100644 index 0000000..df36943 --- /dev/null +++ b/src/lib/forge.test.ts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-3.0-only +// Copyright (C) 2026 poli0981 (SkullMute) +// D38 — the forge links every page and the feed carry. + +import { describe, expect, it } from 'vitest'; +import { MIRROR_URL, RELEASES_URL, SOURCE_URL, newIssue, sourceFile } from './forge'; + +describe('forge', () => { + it('points at Gitea for the source and GitLab for issues — never at GitHub', () => { + expect(SOURCE_URL).toBe('https://git.poli0981.dev/poli0981/softharbor'); + expect(RELEASES_URL).toBe('https://git.poli0981.dev/poli0981/softharbor/releases'); + expect(MIRROR_URL).toBe('https://gitlab.com/poli0981/softharbor'); + for (const url of [SOURCE_URL, RELEASES_URL, MIRROR_URL]) expect(url).not.toMatch(/github/); + }); + + it('links a file on main the way Gitea renders it', () => { + expect(sourceFile('LICENSE-DATA.md')).toBe( + 'https://git.poli0981.dev/poli0981/softharbor/src/branch/main/LICENSE-DATA.md', + ); + }); + + it('opens a new issue on a GitLab template, names encoded', () => { + expect(newIssue('Accessibility')).toBe( + 'https://gitlab.com/poli0981/softharbor/-/issues/new?issuable_template=Accessibility', + ); + expect(newIssue('App request')).toBe( + 'https://gitlab.com/poli0981/softharbor/-/issues/new?issuable_template=App%20request', + ); + }); +}); diff --git a/src/lib/forge.ts b/src/lib/forge.ts new file mode 100644 index 0000000..eb1401b --- /dev/null +++ b/src/lib/forge.ts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-only +// Copyright (C) 2026 poli0981 (SkullMute) +// +// D38 — where the project lives, in one place. +// +// The source is on the owner's Gitea, which nobody else can sign up to; the +// public files issues and merge requests on its GitLab push mirror. GitHub +// (github.com/poli0981/softharbor) went with the suspended account in +// November 2026 — nothing may link there any more. + +export const SOURCE_URL = 'https://git.poli0981.dev/poli0981/softharbor'; +export const RELEASES_URL = `${SOURCE_URL}/releases`; +export const MIRROR_URL = 'https://gitlab.com/poli0981/softharbor'; +export const NEW_ISSUE_URL = `${MIRROR_URL}/-/issues/new`; + +/** A file on `main` as Gitea renders it, e.g. `LICENSE-DATA.md`. */ +export function sourceFile(path: string): string { + return `${SOURCE_URL}/src/branch/main/${path}`; +} + +/** A new issue on the mirror, opened on one of `.gitlab/issue_templates/`. */ +export function newIssue(template: string): string { + return `${NEW_ISSUE_URL}?issuable_template=${encodeURIComponent(template)}`; +} diff --git a/src/lib/issueUrl.test.ts b/src/lib/issueUrl.test.ts index a832a8f..84a749a 100644 --- a/src/lib/issueUrl.test.ts +++ b/src/lib/issueUrl.test.ts @@ -1,26 +1,57 @@ // SPDX-License-Identifier: GPL-3.0-only // Copyright (C) 2026 poli0981 (SkullMute) -// docs/11 §2 — issueUrl. Spike S3 sets BUDGET; these pin the behaviour. +// docs/11 §2 — issueUrl. Spike S3 (and the 2026-11-24 GitLab probe) set +// BUDGET; these pin the behaviour. import { describe, expect, it } from 'vitest'; -import { BUDGET, buildBugUrl } from './issueUrl'; +import { BUDGET, BUG_FORM_URL, bugDescription, buildBugUrl } from './issueUrl'; const CTX = { href: 'https://softharbor.net/apps/7-zip', userAgent: 'UA/1.0', lang: 'en' }; const line = (n: number) => `[2026-07-27T00:00:00.000Z] error ${n} ${'x'.repeat(80)}`; +const description = (url: string) => new URL(url).searchParams.get('issue[description]') ?? ''; describe('buildBugUrl', () => { - it('targets the form and maps params to field ids (docs/12 §7)', () => { + it("targets the GitLab mirror's new-issue page (D38)", () => { const u = new URL(buildBugUrl('boom', CTX)); - expect(u.pathname).toBe('/poli0981/softharbor/issues/new'); - expect(u.searchParams.get('template')).toBe('bug_report.yml'); - expect(u.searchParams.get('labels')).toBe('bug'); - expect(u.searchParams.get('page-url')).toBe(CTX.href); - expect(u.searchParams.get('environment')).toBe('UA/1.0 · lang=en'); - expect(u.searchParams.get('console-output')).toBe('boom'); + expect(`${u.origin}${u.pathname}`).toBe('https://gitlab.com/poli0981/softharbor/-/issues/new'); + expect(u.searchParams.get('issue[title]')).toBe('Bug: '); + expect(BUG_FORM_URL).toBe( + 'https://gitlab.com/poli0981/softharbor/-/issues/new?issuable_template=Bug', + ); }); - it('marks an empty buffer explicitly rather than sending a blank field', () => { - expect(new URL(buildBugUrl('', CTX)).searchParams.get('console-output')).toBe('(buffer empty)'); + it('lays the report out like the Bug template', () => { + const d = description(buildBugUrl('boom', CTX)); + expect(d).toBe( + [ + '### Page URL', + '', + CTX.href, + '', + '### What happened / expected', + '', + '', + '', + '### Browser & OS', + '', + 'UA/1.0 · lang=en', + '', + '### Console output', + '', + '```shell', + 'boom', + '```', + ].join('\n'), + ); + }); + + it('marks an empty buffer explicitly rather than sending a blank block', () => { + expect(description(buildBugUrl('', CTX))).toContain('```shell\n(buffer empty)\n```'); + }); + + it('fences the console output with more backticks than it contains', () => { + const d = bugDescription('a ``` b ```` c', CTX); + expect(d).toContain('`````shell\na ``` b ```` c\n`````'); }); it('respects the budget', () => { @@ -30,19 +61,20 @@ describe('buildBugUrl', () => { it('drops OLDEST lines first — the newest error is the useful one', () => { const huge = Array.from({ length: 400 }, (_, i) => line(i)).join('\n'); - const out = new URL(buildBugUrl(huge, CTX)).searchParams.get('console-output') ?? ''; + const out = description(buildBugUrl(huge, CTX)); expect(out).toContain('error 399'); expect(out).not.toContain('error 0 '); }); it('survives characters that would break a naive query string', () => { const nasty = 'a#b&c=d\ne\tf "g" 100% ünïcödé 日本語 đường'; - const out = new URL(buildBugUrl(nasty, CTX)).searchParams.get('console-output'); - expect(out).toBe(nasty); // round-trips exactly through URLSearchParams + expect(description(buildBugUrl(nasty, CTX))).toContain(`\n${nasty}\n`); }); it('never emits a URL over budget even when a single line exceeds it', () => { // One unsplittable 20k line: the loop must terminate, not spin. - expect(buildBugUrl('y'.repeat(20000), CTX).length).toBeLessThanOrEqual(BUDGET); + const url = buildBugUrl('y'.repeat(20000), CTX); + expect(url.length).toBeLessThanOrEqual(BUDGET); + expect(description(url)).toContain('(buffer empty)'); }); }); diff --git a/src/lib/issueUrl.ts b/src/lib/issueUrl.ts index a972136..b740679 100644 --- a/src/lib/issueUrl.ts +++ b/src/lib/issueUrl.ts @@ -1,35 +1,31 @@ // SPDX-License-Identifier: GPL-3.0-only // Copyright (C) 2026 poli0981 (SkullMute) -// docs/05 §A6 — prefilled GitHub issue URL. +// docs/05 §A6 — prefilled bug report on the GitLab mirror. // -// Query params must match the field `id`s in -// .github/ISSUE_TEMPLATE/bug_report.yml. Renaming an id is a breaking change -// to already-shipped clients (docs/12 §7). +// The repository lives on a self-hosted Gitea where outsiders cannot sign up; +// issues from the public go to the GitLab mirror (D38). GitLab has no issue +// FORMS to prefill field by field, so the report is one Markdown description +// laid out like .gitlab/issue_templates/Bug.md — keep the two in step. -const REPO = 'https://github.com/poli0981/softharbor'; +import { NEW_ISSUE_URL, newIssue } from './forge'; /** - * The bare bug form — the link's target until the island has built the + * The bare bug template — the link's target until the island has built the * prefilled URL, so the footer link works before hydration (and without JS). */ -export const BUG_FORM_URL = `${REPO}/issues/new?template=bug_report.yml&labels=bug`; +export const BUG_FORM_URL = newIssue('Bug'); /** * Total-URL budget in characters. * - * Measured against github.com in spike S3 (2026-07-27), two probes per length: + * GitHub (spike S3, 2026-07-27) answered ≤ 6660 cleanly, then 500 between + * 7160 and 7960, reset the connection near 8160 and sent 414 from 8360 — a + * band where it failed at the worst moment, the click meant to report a bug. + * The budget sat ~25 % below the first failure. * - * ≤ 6660 → 302, clean - * 7160-7960 → 500 Internal Server Error - * ~8160 → connection reset - * ≥ 8360 → 414 URI Too Long - * - * Note the shape: GitHub does not degrade gracefully into 414. There is a - * ~1.3 KB band where it simply 500s, and a user only ever meets it at the - * worst moment — the click that was meant to report a bug. So the budget sits - * ~25 % below the first observed failure rather than at the 80 % of the hard - * limit docs/05 §A6 originally assumed; 80 % of the 414 boundary would land - * inside the 500 band. + * gitlab.com, measured 2026-11-24 on this project's new-issue URL (a signed-out + * probe, which is redirected to sign-in): 4000, 5000, 6500 and 8000 → 302, + * 12000 → 400. The same budget is therefore well inside what GitLab takes. */ export const BUDGET = 5000; @@ -48,26 +44,52 @@ function currentContext(): BugContext { }; } +/** A Markdown code fence longer than any backtick run in `text`. */ +function fenceFor(text: string): string { + let fence = '```'; + while (text.includes(fence)) fence += '`'; + return fence; +} + +/** The report, in the order of .gitlab/issue_templates/Bug.md. */ +export function bugDescription(consoleText: string, ctx: BugContext): string { + const logs = consoleText || '(buffer empty)'; + const fence = fenceFor(logs); + return [ + '### Page URL', + '', + ctx.href, + '', + '### What happened / expected', + '', + '', + '', + '### Browser & OS', + '', + `${ctx.userAgent} · lang=${ctx.lang}`, + '', + '### Console output', + '', + `${fence}shell`, + logs, + fence, + ].join('\n'); +} + export function buildBugUrl(consoleText: string, context?: BugContext): string { const ctx = context ?? currentContext(); - const u = new URL(`${REPO}/issues/new`); - u.searchParams.set('template', 'bug_report.yml'); - u.searchParams.set('labels', 'bug'); - u.searchParams.set('page-url', ctx.href); - u.searchParams.set('environment', `${ctx.userAgent} · lang=${ctx.lang}`); + const url = (logs: string) => { + const u = new URL(NEW_ISSUE_URL); + u.searchParams.set('issue[title]', 'Bug: '); + u.searchParams.set('issue[description]', bugDescription(logs, ctx)); + return u.toString(); + }; // Newest lines matter most, so truncate from the head. let logs = consoleText; - const withLogs = (s: string) => { - const probe = new URL(u.toString()); - probe.searchParams.set('console-output', s || '(buffer empty)'); - return probe.toString(); - }; - while (logs.length > 0 && withLogs(logs).length > BUDGET) { + while (logs.length > 0 && url(logs).length > BUDGET) { const nl = logs.indexOf('\n'); logs = nl === -1 ? '' : logs.slice(nl + 1); } - - u.searchParams.set('console-output', logs || '(buffer empty)'); - return u.toString(); + return url(logs); } diff --git a/src/lib/legal.ts b/src/lib/legal.ts index b05d1e4..caed0de 100644 --- a/src/lib/legal.ts +++ b/src/lib/legal.ts @@ -21,9 +21,11 @@ * Web Analytics and the Turnstile check, and Terms gained the operator and a * copyright-complaint procedure); 2026-10-26 (v1.3: the Privacy Policy * covers the site-wide rate limit, D32); 2026-11-09 (v1.4: the Privacy - * Policy lists `sh:keys`, the display menu's "/" shortcut switch, D33). + * Policy lists `sh:keys`, the display menu's "/" shortcut switch, D33); + * 2026-11-24 (v1.5: bug reports and listing issues go to the GitLab mirror, + * which now receives the prefilled report instead of GitHub, D38). */ -export const LEGAL_VERSION = '2026-11-09'; +export const LEGAL_VERSION = '2026-11-24'; export type LegalDoc = | 'accessibility' @@ -48,13 +50,13 @@ export const ACCEPTED_DOCS = [ * a change to it never re-opens the gate. */ export const LEGAL_UPDATED: Readonly> = { - accessibility: '2026-11-09', + accessibility: '2026-11-24', aiDisclosure: '2026-11-09', - disclaimer: '2026-10-21', - privacy: '2026-11-09', + disclaimer: '2026-11-24', + privacy: '2026-11-24', terms: '2026-10-21', - thirdParty: '2026-10-21', - trademarks: '2026-10-21', + thirdParty: '2026-11-24', + trademarks: '2026-11-24', }; const KEY = 'sh:legal'; diff --git a/src/lib/paths.ts b/src/lib/paths.ts index 1d4274d..7c32f82 100644 --- a/src/lib/paths.ts +++ b/src/lib/paths.ts @@ -18,8 +18,8 @@ interface Dated { * Category pages: newest first, name as the tie-break — the /apps grid's * "Newest" order exactly (compareNames is the grid's pinned `en` collator). * It used to tie-break with a bare localeCompare(), i.e. in whatever locale - * the BUILD machine's ICU defaults to, so a laptop, GitHub CI and Workers - * Builds could each ship a different order. + * the BUILD machine's ICU defaults to, so a laptop and each CI or deploy + * machine could ship a different order. */ export function byAddedDesc(a: Dated, b: Dated): number { const byDate = b.data.addedAt < a.data.addedAt ? -1 : b.data.addedAt > a.data.addedAt ? 1 : 0; diff --git a/src/scripts/errors.js b/src/scripts/errors.js index c797e1c..8653ae3 100644 --- a/src/scripts/errors.js +++ b/src/scripts/errors.js @@ -26,7 +26,7 @@ Privacy (docs/09 §8): in-memory only, for the life of the page. It never wraps console.*, never reads input values, and never leaves the page until - the visitor opens a bug report and submits it on GitHub themselves. */ + the visitor opens a bug report and submits it on GitLab themselves. */ (() => { var CAP = 20; var MAX_LINE = 500;