I have never had a need to compile Guacamole myself to just add an extension to the docker container. I just add my extensions in a build file used via docker compose.
What I always felt missing is advice on how to map the extension and configuration paths of the guacamole container to host directories in order to eliminate the build file. Regards, Joachim Von: David Lomas <d...@pale-eds.co.uk.INVALID> Gesendet: Dienstag, 2. Juli 2024 12:07 An: user@guacamole.apache.org Betreff: Re: Documentation for custom authentication provider Hi Nick, One more followup—based on your original email: * Adjust extensions/guacamole-auth-header/src/main/java/org/apache/guacamole/auth/header/user/AuthenticatedUser.java to override getUserGroups() to return the groups you're looking for. I wasn't able to get that to work, as the compiler said "method does not override or implement a method from a supertype". But I was able to override getEffectiveUserGroups() and return a simple Set of Strings of group names, and that seems to be working in the way we want, so thanks for the pointers :). Kind regards, David On Fri, 28 Jun 2024 at 09:40, David Lomas <d...@pale-eds.co.uk <mailto:d...@pale-eds.co.uk> > wrote: Thanks Nick—the errors when building the stock header extension were: [ERROR] The project org.apache.guacamole:guacamole-auth-header:1.5.4 (/home/test/guacamole-auth-header/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for com.google.inject:guice:jar is missing. @ line 44, column 21 and: [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Source option 5 is no longer supported. Use 6 or later. [ERROR] Target option 1.5 is no longer supported. Use 1.6 or later. I had assumed that I needed to target the version of Java installed: $ mvn --version Apache Maven 3.6.3 Maven home: /usr/share/maven Java version: 11.0.23, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en_GB, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-112-generic", arch: "amd64", family: "unix" But having changed it to 8 / 1.8 from what you said, the extension now compiles and loads. The pom for this extension doesn't include a version line for Guice, and I've 'successfully' built and loaded with version 7 using source 8 / target 1.8, which you seemed to suggest shouldn't work? I haven't actually tested that the extension is working properly, only that it loads when guac starts. But what version of Guice should I be using? Perhaps it's specified somewhere else in the main project, not in this extension? Many thanks, David On Fri, 28 Jun 2024 at 02:37, Nick Couchman <vn...@apache.org <mailto:vn...@apache.org> > wrote: On Fri, Jun 21, 2024 at 6:03 AM David Lomas <d...@pale-eds.co.uk.invalid <mailto:d...@pale-eds.co.uk.invalid> > wrote: Thanks Nick—to test my basic setup, I tried copying that extension from the 1.5.4 branch (to match the current version of gauc I'm running in docker), and built it. I had to make 2 changes—not sure if this is expected, but it required a <version>7.0.0</version> entry in the Guice dependency (not sure if the latest version is correct), and I also had to add these lines to the pom: <properties> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> </properties> I was then able to compile and install the extension in guacamole-home/extensions/ before rebuilding and restarting the container. But during startup, I see this in the logs: guacamole_compose | 09:54:10.264 [localhost-startStop-1] ERROR o.a.g.extension.ExtensionModule - Extension "guacamole-auth-header-1.5.4.jar" could not be loaded: Authentication provider class cannot be loaded (wrong version of API?). I'm guessing this (and the earlier changes I had to make (including removing the <parent></parent> entry from the pom) is because I'm trying to build this in isolation outside the main source tree; is that right? If so, do I need to just install the whole client to build this extension, or is it something else? It isn't so much that you're trying to build outside of the main code tree, it's more likely that the pom.xml changes you've made - in particular to the Guice version - are likely going to cause you to end up with very different code, and you'll probably need to load, not just the module you've compiled, but the entirety of the WAR file and other extensions, from code compiled with the same dependencies, particularly Guice and the Java target. I'm not sure what issues you were running into that caused you to bump the Guice version up, but the versions we've got in there, now, are very much designed to maintain Java 1.8 (Jara 8) compatibility. Once you go to Guice 7 you then are required to bump Java up to version 11, as you've found out, and both of those changes are going to cause widespread compatibility issues between the "stock" versions that we provide as downloads and anything you compile. -Nick