public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Roland Kammerer <roland.kammerer@linbit.com>
Cc: Ilya Krel <ikrel@blockbridge.com>
Subject: Re: [pve-devel] pve-manager/www: API for external plugins?
Date: Fri, 4 Nov 2022 14:46:15 +0100	[thread overview]
Message-ID: <c168209b-1a60-ca6a-d3e3-5d3476015d3a@proxmox.com> (raw)
In-Reply-To: <Y2OXuexwf1tv8roV@rck.sh>

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




  reply	other threads:[~2022-11-04 13:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 10:28 Roland Kammerer
2022-11-04 13:46 ` Thomas Lamprecht [this message]
2022-11-21  8:26   ` Roland Kammerer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c168209b-1a60-ca6a-d3e3-5d3476015d3a@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=ikrel@blockbridge.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=roland.kammerer@linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal