feat: app-to-app integration framework + OnlyOffice handlers
Generic integration system for connecting deployed apps via toggle UI. First handlers: OnlyOffice→FileBrowser (config.yaml patch) and OnlyOffice→Nextcloud (occ CLI). Lifecycle hooks auto-suspend on stop and re-apply on start. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
cf "gitea.dooplex.hu/admin/felhom-controller/internal/cloudflare"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/crypto"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/config"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/integrations"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/metrics"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/monitor"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/notify"
|
||||
@@ -647,9 +648,15 @@ func main() {
|
||||
logger.Printf("[INFO] Geo-restriction support enabled (CF API token configured)")
|
||||
}
|
||||
|
||||
// --- Initialize integration manager ---
|
||||
integrationStacks := &integrationStackAdapter{mgr: stackMgr}
|
||||
integrationMgr := integrations.NewManager(sett, integrationStacks, cfg.Customer.Domain, cfg.Paths.StacksDir, encKey, logger)
|
||||
apiRouter.SetIntegrationManager(integrationMgr)
|
||||
|
||||
// --- Initialize web server ---
|
||||
webServer := web.NewServer(cfg, stackMgr, cpuCollector, backupMgr, crossDriveRunner, sched, sett, alertMgr, notifier, updater, logger, Version)
|
||||
webServer.SetEncryptionKey(encKey)
|
||||
webServer.SetIntegrationManager(integrationMgr)
|
||||
webServer.SetStorageWatchdog(storageWatchdog)
|
||||
if assetsSyncer != nil {
|
||||
webServer.SetAssetsSyncer(assetsSyncer)
|
||||
@@ -917,6 +924,23 @@ func (a *stackAdapter) GetStackHDDPath(name string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// integrationStackAdapter implements integrations.StackProvider using stacks.Manager.
|
||||
type integrationStackAdapter struct {
|
||||
mgr *stacks.Manager
|
||||
}
|
||||
|
||||
func (a *integrationStackAdapter) GetStack(name string) (*stacks.Stack, bool) {
|
||||
return a.mgr.GetStack(name)
|
||||
}
|
||||
|
||||
func (a *integrationStackAdapter) GetStacks() []stacks.Stack {
|
||||
return a.mgr.GetStacks()
|
||||
}
|
||||
|
||||
func (a *integrationStackAdapter) RestartStack(name string) error {
|
||||
return a.mgr.RestartStack(name)
|
||||
}
|
||||
|
||||
// geoStackAdapter implements cloudflare.StackLister for geo-restriction sync.
|
||||
type geoStackAdapter struct {
|
||||
mgr *stacks.Manager
|
||||
|
||||
Reference in New Issue
Block a user