mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Cluster: Report Config.About() instead of Config.Name() as app name #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
695b33f097
commit
e6959e7e96
5 changed files with 11 additions and 4 deletions
|
|
@ -137,12 +137,14 @@ func clusterNodesRotateAction(ctx *cli.Context) error {
|
|||
NodeName: name,
|
||||
RotateDatabase: rotateDatabase,
|
||||
RotateSecret: rotateSecret,
|
||||
AppName: clean.TypeUnicode(conf.Name()),
|
||||
AppName: clean.TypeUnicode(conf.About()),
|
||||
AppVersion: clean.TypeUnicode(conf.Version()),
|
||||
}
|
||||
|
||||
if themeVersion, err := theme.DetectVersion(conf.ThemePath()); err == nil && themeVersion != "" {
|
||||
payload.Theme = themeVersion
|
||||
}
|
||||
|
||||
b, _ := json.Marshal(payload)
|
||||
|
||||
endpointUrl := stringsTrimRightSlash(portalURL) + "/api/v1/cluster/nodes/register"
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ func clusterRegisterAction(ctx *cli.Context) error {
|
|||
overrideAppName := clean.TypeUnicode(ctx.String("app-name"))
|
||||
overrideAppVersion := clean.TypeUnicode(ctx.String("app-version"))
|
||||
|
||||
defaultAppName := clean.TypeUnicode(conf.Name())
|
||||
defaultAppName := clean.TypeUnicode(conf.About())
|
||||
defaultAppVersion := clean.TypeUnicode(conf.Version())
|
||||
|
||||
if overrideAppName == "" {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ func registerWithPortal(c *config.Config, portal *url.URL, token string) error {
|
|||
NodeUUID: c.NodeUUID(),
|
||||
NodeRole: c.NodeRole(),
|
||||
AdvertiseUrl: c.AdvertiseUrl(),
|
||||
AppName: clean.TypeUnicode(c.Name()),
|
||||
AppName: clean.TypeUnicode(c.About()),
|
||||
AppVersion: clean.TypeUnicode(c.Version()),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func TestRegister_PersistSecretAndDB(t *testing.T) {
|
|||
c.Options().JoinToken = cluster.ExampleJoinToken
|
||||
c.Options().SiteUrl = expectedSite
|
||||
c.Options().AdvertiseUrl = expectedSite
|
||||
expectedAppName = c.Name()
|
||||
expectedAppName = c.About()
|
||||
expectedAppVersion = c.Version()
|
||||
// Gate rotate=true: driver mysql and no DSN/fields.
|
||||
c.Options().DatabaseDriver = config.MySQL
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ func TestTypeUnicode(t *testing.T) {
|
|||
input: "äöü",
|
||||
want: "äöü",
|
||||
},
|
||||
{
|
||||
name: "About",
|
||||
input: "PhotoPrism® Pro",
|
||||
want: "PhotoPrism® Pro",
|
||||
},
|
||||
{
|
||||
name: "Empty",
|
||||
input: "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue