Objective:
To enable RESTHeart to load plugins recursively from subdirectories of the plugins-directory.
Current Limitation:
At present, RESTHeart is configured to search for plugins in the directory specified by the plugins-directory configuration option. By default, this is set to ./plugins. It just searches jar files in the directory and won't look into subdirectories. This limitation poses challenges, especially when deploying custom plugins in a Docker environment.
Proposed Solution:
RESTHeart will search for plugins in the plugins-directory and recursively in its subdirectories (up to two levels deep).
Use Case Scenario:
In a Docker deployment scenario, users often need to deploy custom plugins. The current system requires the use of Docker volume mappings for each custom plugin or its dependencies, like this:
$ docker run -rm -p 8080:8080 -v custom-plugins.jar:/opt/restheart/plugins/custom-plugins.jar softinstigate/restheart
However, remapping the /opt/restheart/plugins directory to include custom plugins risks overwriting the standard plugin JARs (e.g., restheart-graphql.jar) that come with RESTHeart. The challenge is amplified when a plugin has several dependencies, necessitating multiple Docker volume mappings.
Benefits of the Proposed Change:
Flexibility: Allows separation of custom and standard plugins into different directories.
Simplified Deployment: Reduces the complexity in Docker environments by minimizing the need for multiple volume mappings.
Maintainability: Eases the process of updating and managing custom and standard plugins independently.
Implementation Considerations:
Ensure backward compatibility, where the system can still function with a single directory specified.
The plugin loader should gracefully handle any conflicts or issues arising from plugins in different directories (e.g., duplicate plugins, version conflicts).
Update relevant documentation to reflect these changes and provide examples for new and existing users.
Detailed Documentation:
To be developed, detailing the technical implementation, configuration changes, and examples of usage in different deployment scenarios.
Objective: To enable RESTHeart to load plugins recursively from subdirectories of the
plugins-directory
.Current Limitation: At present, RESTHeart is configured to search for plugins in the directory specified by the
plugins-directory
configuration option. By default, this is set to./plugins
. It just searches jar files in the directory and won't look into subdirectories. This limitation poses challenges, especially when deploying custom plugins in a Docker environment.Proposed Solution: RESTHeart will search for plugins in the
plugins-directory
and recursively in its subdirectories (up to two levels deep).Use Case Scenario: In a Docker deployment scenario, users often need to deploy custom plugins. The current system requires the use of Docker volume mappings for each custom plugin or its dependencies, like this:
However, remapping the
/opt/restheart/plugins
directory to include custom plugins risks overwriting the standard plugin JARs (e.g.,restheart-graphql.jar
) that come with RESTHeart. The challenge is amplified when a plugin has several dependencies, necessitating multiple Docker volume mappings.Benefits of the Proposed Change:
Implementation Considerations:
Detailed Documentation: To be developed, detailing the technical implementation, configuration changes, and examples of usage in different deployment scenarios.