On la, 21 touko 2022, Leo O via FreeIPA-users wrote:
Oh thought cockpit UI for samba ad dc is already far more advanced.
thanks for clarifying that.
Back to FreeIPA, I was about the create some plugin dirs to put the
actual .js files in there. But as I'm using FreeIPA docker, I get a
```
mkdir: cannot create directory ‘/usr/share/ipa/ui/js/plugins/mailalias’: Read-only file
system
...
```
So my volume mount is: "-v /srv/freeipa/ipa-data:/data"
therefore I got some of the files inside the container in the "/data".
For example wenn looking into: "ls -la /usr/share/ipa/html/"
it shows:
```
lrwxrwxrwx. 1 root root 31 May 4 04:50 ca.crt -> /data/usr/share/ipa/html/ca.crt
...
```
so seems a bunch of symbolic links were created, but how would I now
incorporate my plugins into that docker environment, as it should also
be preserved when deleting the container and starting up a new one.
Therefore I have to stay in my "/data" dir but I doubt I can simply
use: "/data/usr/share/ipa/" as there is for sure no automagic mechanism
which checks that for plugin files, right?
I think you felt victim of several issues here. First, you are using
a wrong approach in development. I wouldn't start with a containerized
FreeIPA at all if you want to develop something on top of FreeIPA, let
alone with read-only containers. These are simply wrong tools for
iteractive and interactive development on top of a running FreeIPA
environment.
Second, if you'd want to use containerized deployment, you need to
prepare own image on top of a basic container because what you are
adding is effectively a new package. FreeIPA plugins typically include
both client-side and server-side bits, may be LDAP schema and upgrade
scripts. These all are best to package using native packaging technology
for your operating system. In case of Fedora or RHEL-based systems --
RPMs. IPA plugins in my github repositories also have samples of how to
package those.
My suggestion would be to start with a VM, do your plugin development
there, then package resulting code as an RPM, for example, and if you
want to deploy it in containers, build an image on top of existing one,
by adding installation of the required packages in a layer of your
container image. Only then you'd deploy your own image.
For FreeIPA Web UI development, Petr Vobornik made some time ago a page
https://pvoborni.fedorapeople.org/doc/ that also has a debugging
section:
https://pvoborni.fedorapeople.org/doc/#!/guide/Debugging. It is
a bit outdated in terms of versions it mentions but the approach is stil
valid. I have used it recently to add my UI fixes and develop Web UI
extension for the IdP support, so I know most of those notes are working
well, in a VM, of course.
--
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland