- État Fermée
- Pourcentage achevé
- Type Évolution
- Catégorie Services locaux → VM
- Assignée à Personne
- Système d'exploitation Freebox Server V7 (Delta)
- Sévérité Basse
- Priorité Très Basse
- Basée sur la version 4.7.3
- Due pour la version Non décidée
-
Échéance
Non décidée
-
Votes
1
- _fvt (31/12/2022)
- Privée
Ouverte par _fvt - 31/12/2022
Dernière modification par mmakassikis - 09/02/2023
FS#37547 - Freebox OS WebUI - Allow more than 4096 characters for cloud-init field
Bonjour,
Tout d’abord, merci pour cette Freebox delta et ses multiples fonctionnalités, notamment la partie VM très pratique pour du perso. (pihole, homebridge, …).
Contexte:
J’utilise le cloud-init sur les VM freebox pour préparer toute la VM, installation de docker, etc.
J’utilise aussi une write_files activity (bin+gz) pour écrire directement mon compose file a la création de la vm et enfin des runcmd pour démarrer le stack.
Le tout utilisant des docker-volumes cifs vers le CIFS de la freebox pour la persistence des données des conteneurs.
Tout ceci me permet de supprimer / recréer les VM sans me soucier de quoi que ce soit:
- Suppression de la VM et son disque
- Re-creation de la VM avec le cloud-init
⇒ Tout le stack docker compose est alors reparti en quelques secondes, sans avoir nécessité aucune autre manipulation.
Problème:
Le champ cloud-init dans les options des VM freebox est limité a 4096 caractères, ce qui est vraiment limite… Alors que cette limitation n’est pas présente côté API.
Question: Serait-il possible d’augmenter ce champ cloud-init, au moins jusqu’à 8192 ?
Merci d’avance et bonne journée,
Cordialement,
FV
09.02.2023 09:30
Raison de la fermeture : Résolu
Commentaires de fermeture :
firmware 4.7.4
Chargement...
Activer les raccourcis clavier
- Alt + ⇧ Shift + l Se connecter/Se déconnecter
- Alt + ⇧ Shift + a Ouvrir une tâche
- Alt + ⇧ Shift + m Mes recherches
- Alt + ⇧ Shift + t Rechercher par ID de tâche
Liste des tâches
- o Ouvrir la tâche sélectionnée
- j Déplacer le curseur vers le bas
- k Déplacer le curseur vers le haut
Détails de la tâche
- n Tâche suivante
- p Tâche précédente
- Alt + ⇧ Shift + e ↵ Enter Modifier cette tâche
- Alt + ⇧ Shift + w Surveiller
- Alt + ⇧ Shift + y Fermer cette tâche
Édition de la tâche
- Alt + ⇧ Shift + s Enregistrer la tâche
Bonjour
Pour moi, le champ était limité à 32768 characteres tel que spécifié dans la doc de l'API, je cite :
Mais suite à votre post, j'ai refais des tests avec l'API et j'arrive à envoyé un fichier bien plus gros comme cloudinit (plus de 60000 characteres, même plus de 65536 characteres ) :
Je l'injecte depuis une ligne de commande bash en utilisant le programme fbxvm-ctrl :
L'injection dans la conf de la VM est bien OK, quand je récupère le json_vm_object après modification de la VM avec la commande précédente, je trouve bien dans le champ cloud-init-userdata de l'objet VM retourné par l'API les 168 clé ssh-rsa que j'ai mise dans le fichier cloudinit-userdata2.yml avant modification de la VM
Le fichier cloudinit-userdata2.yml fait 68 KB et voici son contenu (pour l'exemple ):
Comment injectez vous le userdata dans la VM ?
Visiblement je ne rencontre pas la limitation à 4096 caractères que vous rencontrez
Cordialement
nbanba
Bonjour,
Je n'utilise pas l'API, je colles le contenu simplement via l'interface web de la Freebox, dans les propriétés de la VM il y a un champ cloud-init, et ce dernier est limité à 4096, je pense qu'il s'agit d'une limitation côté frontend donc…
En tout cas je ne connaissait pas le script bash fbxvm-ctrl il m'as l'air bien pratique, merci ;)
Bonjour
Oui, ça à l'air une limitation côté frontend…
Le script fbxvm-ctrl est un script que je maintien.
Il est disponible sur mon dépot github sous licence GPLv3
vous pourrez le trouver ici :
https://github.com/nbanb/fbxvm-ctrl
Il utilise une librairy bash qui est disponnible ici :
https://github.com/nbanb/fbx-delta-nba_bash_api.sh
PS:
Je vais release d'ici 48h une nouvelle version de la library (+3000 lignes) qui inclue des fonctions frontend complètes permettant de :
- gérer les réservations DHCP (list, add, update, delete)
- gérer les redirections NAT (list, add update, delete)
- gérer les "prebuild vm distros" (distros fournies par Free mais que je n'utilise pas) et leur téléchargement dans le contexte des VM Freebox
- gérer les téléchargements HTTP(S) et FTP (add, update, monitor, get_log)
- créer des liens de téléchargement direct non authentifiés (list, add, del)
- gérer les taches (download tasks, filesystem tasks)
- gérer les fichiers depuis l'API (command supportée comme mkdir, ls, cp, mv, rename…)
Les fonctions frontend de la nouvelle library utilisent le même formalisme que le programme fbxvm-ctrl et ne demande pas plus d'external tools qu'aujourd'hui pour fonctionner (uniquement besoin de curl, openssl et websocat pour l'accès à la console des VM).
En gros cette nouvelle version de la librairy permettra de réécrire le programme fbxvm-ctrl en y ajoutant le support du NAT/DHCP, la gestion des download et la gestion des fichiers sur le stockage de la box.
Le but est de pouvoir utiliser les VM de la box comme des instances consommables (fully automated sandbox), créées automatiquement et à la demande pour un besoin donné puis détruite dès que le besoin n'existe plus.
Cordialement
nbanba
Ah super, donc si je comprends bien du coup fbx-delta-nba_bash_api.sh contiendra aussi les fonctions de fbxvm-ctrl en plus des nouvelles que vous avez listées ? ça m'arrange d'avoir une seule lib / un seul outil a charger en effet.
Bonjour
D ici peu, oui c est le but (1 seule lib, 1 seul programme pour VM exploitant la lib) mais je ne les aient pas encore toutes portées dans la lib
work is still in progress…
Après les dépôts github.com sont publics, toute aide reste bienvenue
Cordialement
nbanba
Bonjour
Si vous êtes OSS118 sur github, d ici 24h j aurais release la nouvelle version de la librairie fbx-delta_bash_api.sh… Je viens de poster 1 tout petit script à sourcer (en mettant dedans les credentials de votre application pouvant se connecter à l api de la box, obtenus par l exécution de la fonction authorize_application de la lib) permettant d utiliser les fonctions frontend de la lib directement depuis le cmdline bash de votre pc
La nouvelle version de la lib (+3000lignes de code) sera publiée sous 24h.
Cordialement
nbanba
Bonjour
Commit done !
Vous pouvez download la dernière version de la lib
Désolé, il n'y a pas encore de README avec les nouvelles fonctions mais voici 2 choses :
- description du commit
- liste de toutes les fonctions (sans descriptif pour le moment, désolé)
1) description du commit:
This is a huge commit, adding about 3000 lines of code to the previous version of this lib In this commit, I'm adding several support and particulary fontend function wich have an output directly usable by an end user. The mindset of these new function is the same as "fbxvm-ctrl" program you can find on my public github repository (https://github.com/nbanb/fbxvm-ctrl) New frontend functions are "autonomous" as they have their own "check param" function and their own "param error" functions. All "param error" functions can be configured to display the name of the program and arguments switchs of the program which is calling them. All new categories of frontend functions are also including a listing function, when necessary one monitor function with a nice auto scalable progress bar, a function which can print 1 task (not the list) and another function which give a "brut" result which can be parsed by a computer or another script. All new frontend function included error management and print error and detailed help when an error occurs in syntax or param and if error occurs at the API side (the API reply an error message), this message will be printed to the frontend standard output (stdout) In this commit, I'm also : --> Adding support of FREEBOX_DEFAULT_URL and FREEBOX_LAN_URL and FREEBOX_WAN_URL - FREEBOX_WAN_URL preferred - FREEBOX_LAN_URL will be use if FREEBOX_WAN_URL is not defined - FREEBOX_DEFAULT_URL will be use if FREEBOX_WAN_URL and FREEBOX_LAN_URL are not defined --> Adding support of FREEBOX_DEFAULT_CACERT, FREEBOX_LAN_CACERT, FREEBOX_WAN_CACERT and FREEBOX_CA_BUNDLE which concatenate in a single CA certificate bundle all certificates of: - FREEBOX_DEFAULT_CACERT - FREEBOX_LAN_CACERT - FREEBOX_WAN_CACERT --> Adding support for ILIADBOX, the ITALIAN FREEBOX which had the same API --> Adding ITALY parameter support which will use ILIADBOX_*_URL and ILIADBOX_*_CACERT --> Adding support of ILIADBOX_DEFAULT_URL and ILIADBOX_LAN_URL and ILIADBOX_WAN_URL - ILIADBOX_WAN_URL preferred - ILIADBOX_LAN_URL will be use if ILIADBOX_WAN_URL is not defined - ILIADBOX_DEFAULT_URL will be use if ILIADBOX_WAN_URL and ILIADBOX_LAN_URL are not defined --> Adding support of ILIADBOX_DEFAULT_CACERT, ILIADBOX_LAN_CACERT, ILIADBOX_WAN_CACERT and ILIADBOX_CA_BUNDLE which concatenate in a single CA certificate bundle all certificates of: - ILIADBOX_DEFAULT_CACERT - ILIADBOX_LAN_CACERT - ILIADBOX_WAN_CACERT Some tasks (filesystem tasks, big download) can take hours and hours, really more than the login session timeout (~1800 seconds). So some of the frontend autonomous functions require a persistent login session. This part of the job is normally done by a frontend program which use functions from the library and ensure that the application still has a valid session opened. As librairy now contains frontend functions which can be used directly like an autonomous program by an end user, --> Adding support of auto re-login from librairy by library OTHER IN THIS COMMIT : --> Bug corrections of *BOX_CA_BUNDLE with websocat --> fbx-delta-nba_bash_api.sh started to be BIG => structurating the librairy --> Adding comments to guide user configuration of library --> Adding comments for each groups of functions and for some functions --> Moving changelog at the end of the library for an easier configuration ####################### NEW FUNCTIONS ############################################ NEW CORE FUNCTIONS : --> Adding core / call functions : - function for forcing a GET request with data-www-urlencode of parameters --> Adding underlying functions for frontend functions : - function which colorize output depending on result - function which colorize json output depending on result and print json in "pretty-json" format to have a json human readable format --> Adding underlying functions for testing network parameters validity - function to check mac address syntaxe - function to check ethernet port - function to check ip address syntaxe - function to check if ip is an rfc1918 ip address --> Adding underlying functions for CA Certificate management - function which create a bundle CA Certificate file in shared memory - function which delete the bundle CA Certificate file in shared memory --> Adding functions for managing autologin and auto-relogin in librairy : - function which publish _APP_ID and _APP_ENCRYPTED_TOKEN to subshell env at first login - function which logout the API - function which check the session status - function which get encrypted credential from environment and login with those credentials - function which re-login if the session is disconnected NEW VM FUNCTIONS - FRONTEND : --> Adding functions for managing Freebox VM prebuild distros: - function which list VM prebuild distro and export result to subshell - function which add and monitor download of VM prebuild distro - function which manage help / error and validate VM distro parameters NEW NETWORK FUNCTIONS - FRONTEND : --> Adding functions for managing DHCP static leases: - function which list DHCP static leases and usage status - function which add a DHCP static leases - function which modify a DHCP static leases - function which delete a DHCP static leases - function which manage help / error and validate DHCP parameters --> Adding functions for managing incoming NAT redirection (WAN --> LAN): - function which list incoming NAT redirections - function which add an incoming NAT redirection - function which modify an incoming NAT redirection - function which delete an incoming NAT redirection - function which enable an incoming NAT redirection - function which disable an incoming NAT redirection - function which manage help / error and validate NAT redirection parameters NEW FILESYSTEM FUNCTIONS - FRONTEND : --> Adding functions for managing filesystem tasks: - function which list all filesystem tasks - function which modify a filesystem tasks - function which delete a filesystem tasks - function which show a particular filesystem tasks (pretty human readable output) - function which get a particular filesystem tasks (json output) - function which get a hash result on 'hash' filesystem action tasks - function which monitor a filesystem tasks (including progress bar) - function which manage help / error and validate filesystem task parameters --> Adding functions for managing filesystem actions: - function list_fs_file: list content of a path / directory of freebox storage - function ls_fs: CACHE & list content of a path on freebox storage ('ls' style) - function which copy a file/dir on freebox storage - function which move a file/dir on freebox storage - function which delete / remove a file/dir on freebox storage - f unction which rename a file/dir on freebox storage - function which create directory on freebox storage - function which hash a file of freebox storage (md5 sha1 sha256 sha512) - function which archive files or dir (.tar .zip .7z .tar.gz .tar.bz2 .tar.xz .iso .cpio) - function which extract archive on freebox storage (.tar .zip .7z .tar.gz .tar.bz2 .tar.xz .iso .cpio) - function which manage help / error and validate filesystem action parameters DOWNLOAD FUNCTIONS - FRONTEND : --> Adding functions for managing unauthentified share link (download links): - function which list all share link - function which add a share link - function which delete a share link - function which show a particular share link (pretty human readable output) - function which get a particular share link (json output) - function which manage help / error and validate share link task parameters --> Adding functions for managing HTTP(S) / FTP download tasks: - function which list all download tasks - function which show a particular download task (pretty human readable output) - function which add a download task but do not urlencode params - function which add a download task and urlencode params - function which update a download task (io_priority, start, pause) - 2 functions which monitor a download task (scripting function & frontend advanced function) - function which print a download task log - function which delete a download task - function which manage help / error and validate download task parameters --> Adding other download function : - function for making a direct download from Freebox storage (API authentified call, direction : server executing the direct downloadl function <------- freebox) Enjoy and don't hesitate to ask for help ! nbanba2) liste des 102 fonctions de la lib (sans descriptif pour le moment, désolé mais le code inclus le descriptif des fonctions + changelog + des readme quand nécessaires)
Maintenant il faut que j'écrive le README et que je mette l'output des frontend functions et les exemples dedans puis que je porte les fonctions de fbxvm-ctrl dans la lib (et que j'ajoute les nouvelles fonctionnalités des nouvelles fonctions au programme fbxvm-ctrl … Oui, il y a du boulot, mais je m'y met !)
Cordialement
nbanba
Hello,
Super, je vais jeter un oeil quand je peux je vois qu'il y aeu beaucoup de boulot ! (mais je ne suis pas OSS118 haha).
J'aimerais par contre laisser ce case à l'équipe freebox pour le but côté interface Web qui n'autorise que 4096 chars :).
Bonjour
Oui la lib à beaucoup évoluée, je publierai le nouveau README quand il sera prêt.
Je ne sais pas si vous avez la possibilité d'éditer le titre et de rajouter un truc comme:
Allow more than 4096 characters for cloud-init field in freeboxOS webui
Cordialement
nbanba
C'est fait :)
impec ;)