Files
KomhandClaude Opus 4.8 6fb526b9e0 site: real 404 page, llms.txt, flatpakref SuggestRemoteName
Every unknown path returned 200 with the homepage (Cloudflare Pages
falls back to index.html when no 404.html exists), so removed pages
and typos live on as soft-404 duplicates in Google's index. A
404.astro page flips Pages into real-404 mode.

llms.txt is generated from catalog data as a static endpoint: one
markdown index of every app with its install command, for AI
assistants answering "how do I install <app> on Linux".

The generated .flatpakref files gain SuggestRemoteName so one-click
installs register the remote as "flatpark" instead of a derived name
(the documented `flatpak install flatpark <id>` missed for those
users), plus Title for a readable install prompt.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-11 16:49:12 +08:00

41 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
. "$ROOT/scripts/lib/common.sh"
load_config "$ROOT"
load_app "${1:?usage: gen-discovery.sh <app-id>}"
need gpg; need base64
export GNUPGHOME="$GNUPGHOME_DIR"
mkdir -p "$OUT_DIR" "$REPO_DIR"
gpgkey_b64="$(gpg --export "$KEY_EMAIL" | base64 -w0)"
[ -n "$gpgkey_b64" ] || die "no exportable key (run gen-signing-key.sh first)"
repo_file="$REPO_DIR/flatpark.flatpakrepo"
ref_file="$REPO_DIR/$APP_ID.flatpakref"
cat > "$repo_file" <<EOF
[Flatpak Repo]
Title=$REPO_TITLE
Url=$REPO_URL
Homepage=$REPO_HOMEPAGE
Comment=$REPO_COMMENT
GPGKey=$gpgkey_b64
EOF
# SuggestRemoteName pins the auto-added remote to our canonical name; without
# it flatpak derives one from the ref (e.g. "tabby-origin") and every
# documented `flatpak install flatpark <id>` command misses for that user.
cat > "$ref_file" <<EOF
[Flatpak Ref]
Name=$APP_ID
Branch=$APP_BRANCH
Title=$APP_NAME
Url=$REPO_URL
SuggestRemoteName=$REMOTE_NAME
RuntimeRepo=$RUNTIME_REPO_URL
GPGKey=$gpgkey_b64
IsRuntime=false
EOF
cp "$repo_file" "$OUT_DIR/flatpark.flatpakrepo"
cp "$ref_file" "$OUT_DIR/$APP_ID.flatpakref"
log "wrote flatpark.flatpakrepo and $APP_ID.flatpakref"