add plugin hosts to seperate plugins from gloomi

This adds a plugin host that seperates plugins from the gloomi process,
allowing for plugins to be unloaded and loaded. This commit also has a
fair amount of other changes, nice to haves and bug fixes, some notable
changes are:
- Highly available reverse proxy from my Flux project
- Improved gloomi functionality
This commit is contained in:
Zoe
2025-05-14 19:31:58 -05:00
parent ad0e949070
commit b8f5bce66c
18 changed files with 852 additions and 239 deletions

View File

@@ -21,11 +21,9 @@ func (p *GLoomI) Init() (*fiber.Config, error) {
return nil, fmt.Errorf("failed to connect to Gloom RPC server: %w", err)
}
p.client = client
return nil, nil
}
func (p *GLoomI) Name() string {
return "GLoomI"
return &fiber.Config{
BodyLimit: 1024 * 1024 * 1024 * 5, // 5GB
}, nil
}
type PluginData struct {
@@ -95,12 +93,13 @@ func (p *GLoomI) RegisterRoutes(router fiber.Router) {
return c.Status(fiber.StatusInternalServerError).SendString("Failed to read plugin file: " + err.Error())
}
err = p.client.Call("GloomRPC.UploadPlugin", pluginUploadStruct, nil)
reply := new(string)
err = p.client.Call("GloomRPC.UploadPlugin", pluginUploadStruct, reply)
if err != nil {
return c.Status(fiber.StatusInternalServerError).SendString("Failed to upload plugin: " + err.Error())
}
return c.Status(fiber.StatusOK).SendString("Plugin uploaded successfully")
return c.Status(fiber.StatusOK).SendString(*reply)
})
apiRouter.Delete("/plugins/:pluginName", func(c fiber.Ctx) error {