From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2A0138CBB4 for ; Fri, 4 Nov 2022 14:46:18 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 120F03F56 for ; Fri, 4 Nov 2022 14:46:18 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 4 Nov 2022 14:46:17 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CB5F144A08; Fri, 4 Nov 2022 14:46:16 +0100 (CET) Message-ID: Date: Fri, 4 Nov 2022 14:46:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Thunderbird/107.0 Content-Language: en-GB To: Proxmox VE development discussion , Roland Kammerer References: From: Thomas Lamprecht Cc: Ilya Krel In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.034 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, acme.sh] Subject: Re: [pve-devel] pve-manager/www: API for external plugins? X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2022 13:46:18 -0000 Hi, Am 03/11/2022 um 11:28 schrieb Roland Kammerer: > I'm the maintainer of the linstor-proxmox plugin and thanks to your > storage plugin API we have a strong FLOSS and customer user base. What > would be nice for our users is better integration in the web GUI, > especially in "Datacenter -> Storage -> Add". > > I'm not a web dev at all, I just patched in a new entry into > pvemanagerlib.js. From what I see in the Makefile that itself is just > the concatenated version of several .js files. Would it be possible to > have an extra "plugin.js" that then just includes all .js from some > /i/dont/know/plugins/ directory? I also saw that there is at least one > dict that glues things together (storageSchema in Utils.js), so there > probably would be some need to "register" external plugins into these > data structures. And that is where I stop showing my entire lack of web > development knowledge :). We won't add any-JS includes, that's just really messy in the dynamically prototype "mess" JS is and we cannot guarantee a safe execution at all, which for the Storage plugin backend is at least only the admin-owned server, that the admin setups themselves anyway, not all users through all browsers. Iff, there needs a more schematic approach provided by the backend via an schema-checked API call, more on that below. > > Could you provide some kind of API that allows external plugins to > integrate into the GUI? Or maybe it even exists and I did not see it? > No, there's no functionality at the moment. We got such a request also from the quite active BlockBridge devs, and my reply[0] contains some hints in how one could achieve that, in short, similar to how we handle the more popular ones from the huge amount of different acme.sh plugins, via a schema[1][2] that gets dynamically translated to a form in the web interface[3]. If done somewhat nicely and safely we'd accept such a thing, the plugins would get an new method (e.g., api_schema) that returns a perl hash ref containing the properties including type, description and flags like if the setting is editable (after storage addition), and a new API endpoint returning the schema's of all (external) plugins similar so that they can be shown in the add Drop down and used for creating the basic form. Do you want to work on something like that? We can try to help on questions, review and with some polishing, but the major effort may need to come from parties interested in this, but maybe the BlockBridge devs (I CCd Ilya, hope that was OK) are still interested in that too, and can help, if only by verifying that the solution is generic enough to be useful to more than one specific external Plugin. regards, Thomas [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=3420#c1 [1]: https://git.proxmox.com/?p=proxmox-acme.git;a=blob;f=src/dns-challenge-schema.README;h=1de1cd115a765e1d1917733db84c21a6c952a441;hb=HEAD [2]: https://git.proxmox.com/?p=proxmox-acme.git;a=blob;f=src/dns-challenge-schema.json;h=39ac2babdd5eef71d5a31216375bc970098bad76;hb=HEAD [3]: https://git.proxmox.com/?p=pve-manager.git;a=blob;f=www/manager6/dc/ACMEPluginEdit.js;h=570b4dd20038c49ddd2b68153e672b8deae0cf4d;hb=HEAD#l19