More setup about the deployment

This commit is contained in:
stilobique committed 2026-11-08 12:17:13 +01:00
1 parent 821332508f
commit 20b8fcc1c1
5 files changed
+22 -7

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ There is no build system or test suite.
- **Reproduce the box's loading mode**: the Player loads the app over HTTP, which behaves differently from local files (see constraints below). Check with `python3 -m http.server 8765 --directory .` then `QT_QPA_PLATFORM=offscreen qmlscene -I ../libfbxqml http://127.0.0.1:8765/Jellyfin.qml` — it must print no warnings. - **Reproduce the box's loading mode**: the Player loads the app over HTTP, which behaves differently from local files (see constraints below). Check with `python3 -m http.server 8765 --directory .` then `QT_QPA_PLATFORM=offscreen qmlscene -I ../libfbxqml http://127.0.0.1:8765/Jellyfin.qml` — it must print no warnings.
- The desktop has Qt 5.15 while the box targets QtQuick 2.5: code that runs locally can still use APIs too new for the box. - The desktop has Qt 5.15 while the box targets QtQuick 2.5: code that runs locally can still use APIs too new for the box.
**FreeStore package**: `tools/package.py` → `dist/<identifier>.tar.gz` (gitignored). Replicates the QtCreator plugin's "Make FreeStore Package": same file selection as `Jellyfin.fbxproject` (QML/JS/images/fonts/`qmldir`/`manifest.json`, excluding `tools/` and hidden dirs), manifest checks (identifier `\w+(\.\w+)+`, entry-point files present), `qmllint` on all sources, ustar tar with directory entries, gzipped. Upload is manual on the FreeFactory console (http://factory.free.fr), followed by Free's review. **FreeStore package**: `tools/package.py` → `dist/<identifier>.tar.gz` (gitignored). Replicates the QtCreator plugin's "Make FreeStore Package": same file selection as `Jellyfin.fbxproject` (QML/JS/images/fonts/`qmldir`/`manifest.json`, excluding `tools/` and hidden dirs), manifest checks (identifier `\w+(\.\w+)+`, `version` x.y.z equal to `Session.clientVersion`, entry-point files present), `qmllint` on all sources, ustar tar with directory entries, gzipped. Upload is manual on the FreeFactory console (http://factory.free.fr), followed by Free's review.
**Deploying a test build to the Freebox**: `tools/deploy.py` (Python stdlib only; Player must be in developer mode). It discovers the Player via SSDP (`fbx:devel`) or takes `--box <IP>`, serves the repo over HTTP, calls JSON-RPC `debug_qml_app` on `http://<box>/pub/devel`, and streams the app's stdout/stderr until it exits. `--server <host>` and `--user name[:password]` (both repeatable) serve a virtual `dev-config.json` next to the app; at startup `Session.loadDevConfig()` adds each listed server and stores users in `Session.devUsers`, which `UserSelectView` merges with public users (one-click sign-in when a password is given; never log passwords) (only when the app is loaded over HTTP; 404 otherwise, ignored) — the workaround for the lack of persistence in dev mode. Output is also written to `deploy.log` (repo root, gitignored, overwritten each run) — read it to diagnose on-box failures. The Player fetches files lazily from that HTTP server, so the script must keep running while the app is in use. This replicates the "Run" of the official QtCreator plugin, whose own setup is: **Deploying a test build to the Freebox**: `tools/deploy.py` (Python stdlib only; Player must be in developer mode). It discovers the Player via SSDP (`fbx:devel`) or takes `--box <IP>`, serves the repo over HTTP, calls JSON-RPC `debug_qml_app` on `http://<box>/pub/devel`, and streams the app's stdout/stderr until it exits. `--server <host>` and `--user name[:password]` (both repeatable) serve a virtual `dev-config.json` next to the app; at startup `Session.loadDevConfig()` adds each listed server and stores users in `Session.devUsers`, which `UserSelectView` merges with public users (one-click sign-in when a password is given; never log passwords) (only when the app is loaded over HTTP; 404 otherwise, ignored) — the workaround for the lack of persistence in dev mode. Output is also written to `deploy.log` (repo root, gitignored, overwritten each run) — read it to diagnose on-box failures. The Player fetches files lazily from that HTTP server, so the script must keep running while the app is in use. This replicates the "Run" of the official QtCreator plugin, whose own setup is:
+1
View File
@@ -10,6 +10,7 @@ QtObject {
id: session id: session
readonly property string clientName: "Jellyfin Freebox" readonly property string clientName: "Jellyfin Freebox"
// Doit rester égale à « version » dans manifest.json (vérifié par tools/package.py).
readonly property string clientVersion: "0.1.0" readonly property string clientVersion: "0.1.0"
readonly property string deviceName: "Freebox Player" readonly property string deviceName: "Freebox Player"
+1
View File
@@ -1,6 +1,7 @@
{ {
"name": "Jellyfin", "name": "Jellyfin",
"identifier": "com.stilobique.jellyfin", "identifier": "com.stilobique.jellyfin",
"version": "0.1.0",
"description": "Jellyfin for Freebox", "description": "Jellyfin for Freebox",
"icon": "icon.png", "icon": "icon.png",
"capabilities": { "capabilities": {
+3 -1
View File
@@ -39,7 +39,9 @@ Le script sert les fichiers du projet au Player et affiche les logs de l'applica
## Publier sur le FreeStore ## Publier sur le FreeStore
```bash ```bash
tools/package.py # crée dist/com.stilobique.jellyfin.tar.gz tools/package.py # crée dist/com.stilobique.jellyfin-<version>.tar.gz
``` ```
Pour une nouvelle version, modifier `version` dans `manifest.json` **et** `clientVersion` dans `Core/Session.qml` (le script refuse de créer le paquet si elles diffèrent).
Le script reproduit « Make FreeStore Package » du plugin QtCreator : il vérifie `manifest.json` et la syntaxe QML/JS (`qmllint`), puis crée l'archive à téléverser sur la console [FreeFactory](http://factory.free.fr) (compte développeur requis, validation par Free avant publication). Le script reproduit « Make FreeStore Package » du plugin QtCreator : il vérifie `manifest.json` et la syntaxe QML/JS (`qmllint`), puis crée l'archive à téléverser sur la console [FreeFactory](http://factory.free.fr) (compte développeur requis, validation par Free avant publication).
+16 -5
View File
@@ -5,7 +5,8 @@ Reproduit « Outils > Freebox SDK > Make FreeStore Package » du plugin QtCreato
(github.com/fbx/freebox-qtcreator-plugin, src/freestorepackager.cc) : (github.com/fbx/freebox-qtcreator-plugin, src/freestorepackager.cc) :
- fichiers inclus comme dans Jellyfin.fbxproject : QML, JS, images, polices, qmldir et - fichiers inclus comme dans Jellyfin.fbxproject : QML, JS, images, polices, qmldir et
manifest.json (tools/ est exclu : l'aperçu PC n'a rien à faire sur la box) ; manifest.json (tools/ est exclu : l'aperçu PC n'a rien à faire sur la box) ;
- vérifications : manifest.json (identifiant, points d'entrée existants), JSON valides, - vérifications : manifest.json (identifiant, version identique à Session.clientVersion,
points d'entrée existants), JSON valides,
syntaxe QML/JS (qmllint, s'il est installé) ; syntaxe QML/JS (qmllint, s'il est installé) ;
- archive tar (format ustar, avec les entrées de dossiers) compressée en gzip. - archive tar (format ustar, avec les entrées de dossiers) compressée en gzip.
@@ -70,6 +71,15 @@ def check_manifest(files):
defaults += 1 defaults += 1
if defaults > 1: if defaults > 1:
raise ValueError("manifest.json : un seul point d'entrée peut avoir « default »: true") raise ValueError("manifest.json : un seul point d'entrée peut avoir « default »: true")
version = manifest.get("version")
if not isinstance(version, str) or not re.fullmatch(r"\d+\.\d+\.\d+", version):
raise ValueError("manifest.json : « version » absente ou invalide (forme attendue : 1.2.3)")
# La version envoyée à Jellyfin (Session.clientVersion) doit rester la même.
session = open(os.path.join(PROJECT_DIR, "Core", "Session.qml"), encoding="utf-8").read()
client = re.search(r'clientVersion:\s*"([^"]*)"', session)
if not client or client.group(1) != version:
raise ValueError("version du manifest (%s) différente de Session.clientVersion (%s)"
% (version, client.group(1) if client else "introuvable"))
icon = manifest.get("icon") icon = manifest.get("icon")
if icon and icon not in files: if icon and icon not in files:
raise ValueError("manifest.json : icône « %s » absente du paquet" % icon) raise ValueError("manifest.json : icône « %s » absente du paquet" % icon)
@@ -118,7 +128,7 @@ def build_archive(files, output):
def main(): def main():
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--output", help="archive à créer (défaut : dist/<identifier>.tar.gz)") parser.add_argument("--output", help="archive à créer (défaut : dist/<identifier>-<version>.tar.gz)")
args = parser.parse_args() args = parser.parse_args()
files = collect_files() files = collect_files()
@@ -128,10 +138,11 @@ def main():
except (ValueError, json.JSONDecodeError) as error: except (ValueError, json.JSONDecodeError) as error:
sys.exit("Paquet non créé : %s" % error) sys.exit("Paquet non créé : %s" % error)
output = args.output or os.path.join(PROJECT_DIR, "dist", manifest["identifier"] + ".tar.gz") output = args.output or os.path.join(
PROJECT_DIR, "dist", "%s-%s.tar.gz" % (manifest["identifier"], manifest["version"]))
build_archive(files, output) build_archive(files, output)
print("Paquet créé : %s (%d fichiers, %.1f Ko)" % ( print("Paquet créé : %s — version %s (%d fichiers, %.1f Ko)" % (
os.path.relpath(output, os.getcwd()), len(files), os.path.getsize(output) / 1024)) os.path.relpath(output, os.getcwd()), manifest["version"], len(files), os.path.getsize(output) / 1024))
print("À téléverser sur la console FreeFactory (http://factory.free.fr).") print("À téléverser sur la console FreeFactory (http://factory.free.fr).")