From 645fd1c6fea547c6ae02ac197259de04a0827eae Mon Sep 17 00:00:00 2001 From: Tamas Csikel Date: Sun, 25 Oct 2026 17:33:30 +0100 Subject: [PATCH] YouTube as a Fennec OS store app Split from the Fennec OS repository (apps/youtube). The id is now support.bluefox.youtube; casting from a phone asks for the new `dial` permission. A tag (v1.2.3) builds and publishes the store release. Co-Authored-By: Claude Opus 5.5 --- .gitattributes | 4 +++ .gitea/workflows/release.yml | 52 ++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ README.md | 16 +++++++++++ app.toml | 11 +++++--- icon.svg | 11 ++++++++ package.sh | 12 +++++++++ 7 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 icon.svg create mode 100755 package.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..add667a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto eol=lf +*.ttf binary +*.png binary +*.gpg binary diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..43d82f3 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,52 @@ +# On a tag (v1.2.3): build the two store assets and publish them as a release. +# +# Runner hygiene (shared host, little disk): runs in the runner image that is +# already on the host (no image pull), uses no `uses:` actions (no action +# cache), and deletes everything it made at the end. +name: release +on: + push: + tags: ["v*"] +jobs: + release: + runs-on: build + container: + image: docker.gitea.com/runner-images:ubuntu-latest + env: + W: /tmp/fennec-youtube + CARGO_HOME: /tmp/fennec-youtube/cargo + RUSTUP_HOME: /tmp/fennec-youtube/rustup + CARGO_TARGET_DIR: /tmp/fennec-youtube/target + SDK_GIT: https://gitea.bluefox.support/fennec/sdk + SDK_TAG: v0.1.0 + steps: + - name: Checkout + run: | + mkdir -p "$W" + git clone --depth 1 --branch "$GITHUB_REF_NAME" \ + "${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" "$W/src" + v=$(sed -n 's/^version *= *"\(.*\)".*/\1/p' "$W/src/app.toml" | head -1) + [ "v$v" = "$GITHUB_REF_NAME" ] || { echo "tag $GITHUB_REF_NAME, but app.toml says $v" >&2; exit 1; } + - name: sf-pack + run: | + curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path + "$CARGO_HOME/bin/cargo" install -q --locked --git "$SDK_GIT" --tag "$SDK_TAG" sf-pack + - name: Build + run: | + export PATH="$CARGO_HOME/bin:$PATH" + "$W/src/package.sh" + - name: Release + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases" + id=$(curl -fsS -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\"}" "$api" | grep -o "\"id\":[0-9]*" | head -1 | cut -d: -f2) + for f in "$W"/src/dist/*; do + curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null + done + - name: Clean up + if: always() + run: | + rm -rf "$W" + df -h / | tail -1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3cfe00f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/pkg +/dist diff --git a/README.md b/README.md new file mode 100644 index 0000000..f79d4ab --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# YouTube for Fennec OS + +A YouTube TV-s felülete (`youtube.com/tv`) Fennec OS store appként. Telefonról a YouTube app cast gombjával is indítható (DIAL). + +- **Típus:** web app. A csomagban csak az `app.toml` és az ikon van; a TV a beépített Chromiumban nyitja meg. +- **Engedélyek:** a web appok alapengedélyei (hálózat, grafika, hang), és `dial`: a telefon castolhat ide. +- **Telepítés a TV-n:** a Fennec katalógusból jön (`fennec/store`). Kézzel: Store → Források → `https://gitea.bluefox.support/fennec/youtube`. + +## Kiadás +1. Emeld a `version`-t az `app.toml`-ban, és commitold. +2. Tegyél rá egy `v` taget, és pushold. +3. A `.gitea/workflows/release.yml` megépíti a két release-fájlt (`sf-pack`, Fennec SDK), és release-t csinál belőlük. + +Helyben: `./package.sh` (kell hozzá az `sf-pack`, lásd a script fejlécét). Az eredmény a `dist/` mappába kerül. + +Az app leírása: [Fennec SDK, store-app-guide.md](https://gitea.bluefox.support/fennec/sdk/src/branch/main/docs/store-app-guide.md). diff --git a/app.toml b/app.toml index 48a501a..8c5787f 100644 --- a/app.toml +++ b/app.toml @@ -1,18 +1,23 @@ -id = "youtube" +# Fennec OS store app manifest (docs/store-app-guide.md in the Fennec SDK). +id = "support.bluefox.youtube" name = "YouTube" +# Release versions only (1.2.3). Bump it for every release. version = "1.0.0" kind = "web" category = "Videó · Castolható" description = "A YouTube TV-s felülete. Telefonról a YouTube appban a cast ikonnal küldhetsz ide videót." +author = "Bluefox" +license = "MIT" +homepage = "https://gitea.bluefox.support/fennec/youtube" url = "https://www.youtube.com/tv" -icon = "youtube" +icon = "icon.svg" accent = "#FF2D2D" palette = ["#ff6a5c", "#a3121c", "#16070a"] -order = 20 [web] # A Cobalt (TV) user agent makes YouTube serve its leanback UI. user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0 Safari/537.36 Cobalt/25.lts.30.1034943-gold (unlike Gecko), Unknown_TV_Unknown_0/Unknown (Fennec OS, SF1, Wired)" +# The YouTube app on a phone casts here (asks for the `dial` permission). [dial] name = "YouTube" diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..10ad0e1 --- /dev/null +++ b/icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..21c8a2e --- /dev/null +++ b/package.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Builds the two store release assets into dist/: app.toml and +# support.bluefox.youtube-.tar.zst. Needs sf-pack (Fennec SDK): +# cargo install --locked --git https://gitea.bluefox.support/fennec/sdk --tag v0.1.0 sf-pack +set -euo pipefail +cd "$(dirname "$0")" + +rm -rf pkg dist +mkdir -p pkg +cp app.toml icon.svg pkg/ +sf-pack build pkg dist +sf-pack verify dist