This commit is contained in:
1 parent
dc04ac4360
commit
6e70b7e8c1
2 files changed
+21
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
// Package coreconfig lets any service in this workspace receive AuthGuard's, CarrierNode's, and
|
||||
// Package coreconfig lets any service in this workspace receive AuthGuard's, CarrierNode's,
|
||||
// ComfyUI's, and
|
||||
// ProjectConfigurator's current base URL(s) pushed from ProjectConfigurator, instead of each service hardcoding them in
|
||||
// its own env vars. ProjectConfigurator's Projects workspace is the operator-facing source of
|
||||
// truth for both (its authguard_url/carriernode_url(_N) settings); it pushes a fresh copy to every
|
||||
@@ -20,6 +21,9 @@ import (
|
||||
// ProjectConfigurator.
|
||||
type Info struct {
|
||||
AuthGuardURL string `json:"authGuardUrl"`
|
||||
// ComfyUIURL is the configured ComfyUI endpoint for services that use the
|
||||
// generator. It is optional so services that do not use ComfyUI can ignore it.
|
||||
ComfyUIURL string `json:"comfyUiUrl,omitempty"`
|
||||
// ProjectConfiguratorURL is the ProjectConfigurator instance that owns the current workspace
|
||||
// configuration. Consumers with independent databases can use it to read settings such as the
|
||||
// configured mount mappings.
|
||||
@@ -63,6 +67,9 @@ func (s *Store) Get() Info {
|
||||
// authclient.Client's SetBaseURL, or (via OnUpdate) to keep one continuously up to date.
|
||||
func (s *Store) AuthGuardURL() string { return s.Get().AuthGuardURL }
|
||||
|
||||
// ComfyUIURL is a convenience accessor for Get().ComfyUIURL.
|
||||
func (s *Store) ComfyUIURL() string { return s.Get().ComfyUIURL }
|
||||
|
||||
// ProjectConfiguratorURL is a convenience accessor for Get().ProjectConfiguratorURL.
|
||||
func (s *Store) ProjectConfiguratorURL() string { return s.Get().ProjectConfiguratorURL }
|
||||
|
||||
@@ -95,6 +102,9 @@ func (s *Store) Set(next Info) {
|
||||
if url := strings.TrimSpace(next.AuthGuardURL); url != "" {
|
||||
s.info.AuthGuardURL = url
|
||||
}
|
||||
if url := strings.TrimRight(strings.TrimSpace(next.ComfyUIURL), "/"); url != "" {
|
||||
s.info.ComfyUIURL = url
|
||||
}
|
||||
if url := strings.TrimRight(strings.TrimSpace(next.ProjectConfiguratorURL), "/"); url != "" {
|
||||
s.info.ProjectConfiguratorURL = url
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user