Config: Add register fallback to cluster/node/bootstrap.go #98

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-27 17:50:50 +01:00
parent 0d1eedb9a5
commit ceab5e619d
2 changed files with 136 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ var ClusterThemePullCommand = &cli.Command{
func clusterThemePullAction(ctx *cli.Context) error {
return CallWithDependencies(ctx, func(conf *config.Config) error {
portalURL := ""
if ctx.IsSet("portal-url") {
if ctx.IsSet("portal-url") && ctx.String("portal-url") != "" {
portalURL = strings.TrimRight(ctx.String("portal-url"), "/")
}
if portalURL == "" {
@@ -55,6 +55,11 @@ func clusterThemePullAction(ctx *cli.Context) error {
if portalURL == "" {
portalURL = strings.TrimRight(os.Getenv(config.EnvVar("portal-url")), "/")
}
if portalURL == "" {
if domain := strings.TrimSpace(conf.ClusterDomain()); domain != "" {
portalURL = fmt.Sprintf("https://portal.%s", domain)
}
}
if portalURL == "" {
return fmt.Errorf("portal-url not configured; set --portal-url or PHOTOPRISM_PORTAL_URL")
}