Skip to content

Commit 0e415fe

Browse files
committed
Config: Make options available to all users
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent 6da54f9 commit 0e415fe

8 files changed

+30
-64
lines changed

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**By using the software and services we provide, you agree to our [Terms of Service](https://www.photoprism.app/terms), including our [Privacy Policy](https://www.photoprism.app/privacy) and the following Code of Conduct. It explains the "dos and don’ts" when interacting with our team and other community members.**
44

5-
*Last Updated: May 12, 2023*
5+
*Last Updated: May 13, 2023*
66

77
## Rules
88

@@ -18,7 +18,7 @@ Because we want our Code of Conduct to be easy to understand and implement, we h
1818

1919
Not everyone has experience with Open Source communities and intuitively knows what is acceptable. In that case, the following guidelines and examples are meant to provide a quick overview and help you avoid the most common pitfalls:
2020

21-
(a) Do not feel entitled to free software, support, or advice, especially if you are not a contributor, [member](https://link.photoprism.app/membership), or paying customer. Don't expect contributors to report to you and [meet deadlines](https://docs.photoprism.app/developer-guide/code-quality/#go-slow-before-you-go-fast) as if they work for you or owe you something, even if you donated a small amount. We also ask that you do not use GitHub Issues or other development tools to start general discussions, get technical support, or express personal opinions.
21+
(a) Do not [feel entitled](https://www.reddit.com/r/photoprism/comments/13emwf0/did_you_guys_really_nerf_hardware_transcoding/) to free software, support, or advice, especially if you are not a contributor, [member](https://link.photoprism.app/membership), or paying customer. Don't expect contributors to report to you and [meet deadlines](https://docs.photoprism.app/developer-guide/code-quality/#go-slow-before-you-go-fast) as if they work for you or owe you something, even if you donated a small amount. We also ask that you do not use GitHub Issues or other development tools to start general discussions, get technical support, or express personal opinions.
2222

2323
(b) Honor **Rule &#35;2**, [read the docs](https://docs.photoprism.app) and [determine the cause of your problem](https://docs.photoprism.app/getting-started/troubleshooting/) before opening invalid bug reports, starting a public "shitstorm", or insulting other community members in our chat rooms. Aside from being annoying for everyone, it also keeps our team from working on features and enhancements that users like you are waiting for.
2424

internal/config/config.go

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,12 @@ func (c *Config) ApiUri() string {
426426

427427
// CdnUrl returns the optional content delivery network URI without trailing slash.
428428
func (c *Config) CdnUrl(res string) string {
429-
if c.NoSponsor() {
430-
return res
431-
}
432-
433429
return strings.TrimRight(c.options.CdnUrl, "/") + res
434430
}
435431

436432
// CdnVideo checks if videos should be streamed using the configured CDN.
437433
func (c *Config) CdnVideo() bool {
438-
if c.NoSponsor() || c.options.CdnUrl == "" {
434+
if c.options.CdnUrl == "" {
439435
return false
440436
}
441437

@@ -500,7 +496,7 @@ func (c *Config) SiteAuthor() string {
500496

501497
// SiteTitle returns the main site title (default is application name).
502498
func (c *Config) SiteTitle() string {
503-
if c.options.SiteTitle == "" || c.NoSponsor() {
499+
if c.options.SiteTitle == "" {
504500
return c.Name()
505501
}
506502

@@ -519,7 +515,7 @@ func (c *Config) SiteDescription() string {
519515

520516
// SitePreview returns the site preview image URL for sharing.
521517
func (c *Config) SitePreview() string {
522-
if c.options.SitePreview == "" || c.NoSponsor() {
518+
if c.options.SitePreview == "" {
523519
return fmt.Sprintf("https://i.photoprism.app/prism?cover=64&style=centered%%20dark&caption=none&title=%s", url.QueryEscape(c.AppName()))
524520
}
525521

@@ -532,10 +528,6 @@ func (c *Config) SitePreview() string {
532528

533529
// LegalInfo returns the legal info text for the page footer.
534530
func (c *Config) LegalInfo() string {
535-
if c.NoSponsor() {
536-
return SignUpInfo
537-
}
538-
539531
if s := c.CliGlobalString("imprint"); s != "" {
540532
log.Warnf("config: option 'imprint' is deprecated, please use 'legal-info'")
541533
return s
@@ -546,10 +538,6 @@ func (c *Config) LegalInfo() string {
546538

547539
// LegalUrl returns the legal info url.
548540
func (c *Config) LegalUrl() string {
549-
if c.NoSponsor() {
550-
return SignUpURL
551-
}
552-
553541
if s := c.CliGlobalString("imprint-url"); s != "" {
554542
log.Warnf("config: option 'imprint-url' is deprecated, please use 'legal-url'")
555543
return s
@@ -604,11 +592,6 @@ func (c *Config) Sponsor() bool {
604592
return Sponsor
605593
}
606594

607-
// NoSponsor reports if you prefer not to support our mission.
608-
func (c *Config) NoSponsor() bool {
609-
return !c.Sponsor() && !c.Demo()
610-
}
611-
612595
// Experimental checks if experimental features should be enabled.
613596
func (c *Config) Experimental() bool {
614597
return c.options.Experimental

internal/config/config_app.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func (c *Config) AppName() string {
1515
name := strings.TrimSpace(c.options.AppName)
1616

17-
if c.NoSponsor() || name == "" {
17+
if name == "" {
1818
name = c.SiteTitle()
1919
}
2020

@@ -44,7 +44,7 @@ func (c *Config) AppMode() string {
4444
func (c *Config) AppIcon() string {
4545
defaultIcon := "logo"
4646

47-
if c.NoSponsor() || c.options.AppIcon == "" || c.options.AppIcon == defaultIcon {
47+
if c.options.AppIcon == "" || c.options.AppIcon == defaultIcon {
4848
// Default.
4949
} else if strings.Contains(c.options.AppIcon, "/") {
5050
return c.options.AppIcon

internal/config/config_customize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// DefaultTheme returns the default user interface theme name.
1414
func (c *Config) DefaultTheme() string {
15-
if c.options.DefaultTheme == "" || c.NoSponsor() {
15+
if c.options.DefaultTheme == "" {
1616
return "default"
1717
}
1818

internal/config/config_customize_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ func TestConfig_DefaultTheme(t *testing.T) {
1414
c.options.Sponsor = false
1515
c.options.Test = false
1616
c.options.DefaultTheme = "grayscale"
17-
assert.Equal(t, "default", c.DefaultTheme())
17+
assert.Equal(t, "grayscale", c.DefaultTheme())
1818
c.options.Sponsor = true
1919
assert.Equal(t, "grayscale", c.DefaultTheme())
2020
c.options.Sponsor = false
2121
c.options.Test = true
22-
assert.Equal(t, "default", c.DefaultTheme())
22+
assert.Equal(t, "grayscale", c.DefaultTheme())
2323
c.options.Sponsor = false
2424
c.options.Test = false
25-
assert.Equal(t, "default", c.DefaultTheme())
25+
assert.Equal(t, "grayscale", c.DefaultTheme())
2626
c.options.Sponsor = true
2727
c.options.DefaultTheme = ""
2828
assert.Equal(t, "default", c.DefaultTheme())

internal/config/config_faces.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (c *Config) FaceOverlap() int {
3131

3232
// FaceClusterSize returns the size threshold for faces forming a cluster in pixels.
3333
func (c *Config) FaceClusterSize() int {
34-
if c.NoSponsor() || c.options.FaceClusterSize < 20 || c.options.FaceClusterSize > 10000 {
34+
if c.options.FaceClusterSize < 20 || c.options.FaceClusterSize > 10000 {
3535
return face.ClusterSizeThreshold
3636
}
3737

@@ -40,7 +40,7 @@ func (c *Config) FaceClusterSize() int {
4040

4141
// FaceClusterScore returns the quality threshold for faces forming a cluster.
4242
func (c *Config) FaceClusterScore() int {
43-
if c.NoSponsor() || c.options.FaceClusterScore < 1 || c.options.FaceClusterScore > 100 {
43+
if c.options.FaceClusterScore < 1 || c.options.FaceClusterScore > 100 {
4444
return face.ClusterScoreThreshold
4545
}
4646

@@ -49,7 +49,7 @@ func (c *Config) FaceClusterScore() int {
4949

5050
// FaceClusterCore returns the number of faces forming a cluster core.
5151
func (c *Config) FaceClusterCore() int {
52-
if c.NoSponsor() || c.options.FaceClusterCore < 1 || c.options.FaceClusterCore > 100 {
52+
if c.options.FaceClusterCore < 1 || c.options.FaceClusterCore > 100 {
5353
return face.ClusterCore
5454
}
5555

@@ -58,7 +58,7 @@ func (c *Config) FaceClusterCore() int {
5858

5959
// FaceClusterDist returns the radius of faces forming a cluster core.
6060
func (c *Config) FaceClusterDist() float64 {
61-
if c.NoSponsor() || c.options.FaceClusterDist < 0.1 || c.options.FaceClusterDist > 1.5 {
61+
if c.options.FaceClusterDist < 0.1 || c.options.FaceClusterDist > 1.5 {
6262
return face.ClusterDist
6363
}
6464

@@ -67,7 +67,7 @@ func (c *Config) FaceClusterDist() float64 {
6767

6868
// FaceMatchDist returns the offset distance when matching faces with clusters.
6969
func (c *Config) FaceMatchDist() float64 {
70-
if c.NoSponsor() || c.options.FaceMatchDist < 0.1 || c.options.FaceMatchDist > 1.5 {
70+
if c.options.FaceMatchDist < 0.1 || c.options.FaceMatchDist > 1.5 {
7171
return face.MatchDist
7272
}
7373

internal/config/config_ffmpeg.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ func (c *Config) FFmpegEnabled() bool {
2020
func (c *Config) FFmpegEncoder() ffmpeg.AvcEncoder {
2121
if c.options.FFmpegEncoder == "" || c.options.FFmpegEncoder == ffmpeg.SoftwareEncoder.String() {
2222
return ffmpeg.SoftwareEncoder
23-
} else if c.NoSponsor() {
24-
log.Infof("ffmpeg: hardware transcoding is available to members only")
25-
return ffmpeg.SoftwareEncoder
2623
}
2724

2825
return ffmpeg.FindEncoder(c.options.FFmpegEncoder)

internal/config/flags.go

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,13 @@ var Flags = CliFlags{
327327
Name: "default-theme",
328328
Usage: "standard user interface theme `NAME`",
329329
EnvVar: EnvVar("DEFAULT_THEME"),
330-
},
331-
Tags: []string{Essentials}}, {
330+
}}, {
332331
Flag: cli.StringFlag{
333332
Name: "app-name",
334333
Usage: "progressive web app `NAME` when installed on a device",
335334
Value: "",
336335
EnvVar: EnvVar("APP_NAME"),
337-
},
338-
Tags: []string{Essentials}}, {
336+
}}, {
339337
Flag: cli.StringFlag{
340338
Name: "app-mode",
341339
Usage: "progressive web app `MODE` (fullscreen, standalone, minimal-ui, browser)",
@@ -346,8 +344,7 @@ var Flags = CliFlags{
346344
Name: "app-icon",
347345
Usage: "home screen `ICON` (logo, app, crisp, mint, bold, square)",
348346
EnvVar: EnvVar("APP_ICON"),
349-
},
350-
Tags: []string{Essentials}}, {
347+
}}, {
351348
Flag: cli.StringFlag{
352349
Name: "app-color",
353350
Usage: "splash screen `COLOR` code",
@@ -360,30 +357,26 @@ var Flags = CliFlags{
360357
Value: "",
361358
Hidden: true,
362359
EnvVar: EnvVar("IMPRINT"),
363-
},
364-
Tags: []string{Essentials}}, {
360+
}}, {
365361
Flag: cli.StringFlag{
366362
Name: "legal-info",
367363
Usage: "legal information `TEXT`, displayed in the page footer",
368364
Value: "",
369365
EnvVar: EnvVar("LEGAL_INFO"),
370-
},
371-
Tags: []string{Essentials}}, {
366+
}}, {
372367
Flag: cli.StringFlag{
373368
Name: "imprint-url",
374369
Usage: "legal information `URL`",
375370
Value: "",
376371
Hidden: true,
377372
EnvVar: EnvVar("IMPRINT_URL"),
378-
},
379-
Tags: []string{Essentials}}, {
373+
}}, {
380374
Flag: cli.StringFlag{
381375
Name: "legal-url",
382376
Usage: "legal information `URL`",
383377
Value: "",
384378
EnvVar: EnvVar("LEGAL_URL"),
385-
},
386-
Tags: []string{Essentials}}, {
379+
}}, {
387380
Flag: cli.StringFlag{
388381
Name: "wallpaper-uri",
389382
Usage: "login screen background image `URI`",
@@ -394,14 +387,12 @@ var Flags = CliFlags{
394387
Name: "cdn-url",
395388
Usage: "content delivery network `URL`",
396389
EnvVar: EnvVar("CDN_URL"),
397-
},
398-
Tags: []string{Essentials}}, {
390+
}}, {
399391
Flag: cli.BoolFlag{
400392
Name: "cdn-video",
401393
Usage: "stream videos over the specified CDN",
402394
EnvVar: EnvVar("CDN_VIDEO"),
403-
},
404-
Tags: []string{Essentials}}, {
395+
}}, {
405396
Flag: cli.StringFlag{
406397
Name: "site-url, url",
407398
Usage: "public site `URL`",
@@ -418,8 +409,7 @@ var Flags = CliFlags{
418409
Usage: "site `TITLE`",
419410
Value: "",
420411
EnvVar: EnvVar("SITE_TITLE"),
421-
},
422-
Tags: []string{Essentials}}, {
412+
}}, {
423413
Flag: cli.StringFlag{
424414
Name: "site-caption",
425415
Usage: "site `CAPTION`",
@@ -583,8 +573,7 @@ var Flags = CliFlags{
583573
Usage: "FFmpeg AVC encoder `NAME`",
584574
Value: "libx264",
585575
EnvVar: EnvVar("FFMPEG_ENCODER"),
586-
},
587-
Tags: []string{Essentials}}, {
576+
}}, {
588577
Flag: cli.IntFlag{
589578
Name: "ffmpeg-bitrate, vb",
590579
Usage: "maximum FFmpeg encoding `BITRATE` (Mbit/s)",
@@ -755,22 +744,19 @@ var Flags = CliFlags{
755744
Usage: "`NUMBER` of faces forming a cluster core (1-100)",
756745
Value: face.ClusterCore,
757746
EnvVar: EnvVar("FACE_CLUSTER_CORE"),
758-
},
759-
Tags: []string{Essentials}}, {
747+
}}, {
760748
Flag: cli.Float64Flag{
761749
Name: "face-cluster-dist",
762750
Usage: "similarity `DISTANCE` of faces forming a cluster core (0.1-1.5)",
763751
Value: face.ClusterDist,
764752
EnvVar: EnvVar("FACE_CLUSTER_DIST"),
765-
},
766-
Tags: []string{Essentials}}, {
753+
}}, {
767754
Flag: cli.Float64Flag{
768755
Name: "face-match-dist",
769756
Usage: "similarity `OFFSET` for matching faces with existing clusters (0.1-1.5)",
770757
Value: face.MatchDist,
771758
EnvVar: EnvVar("FACE_MATCH_DIST"),
772-
},
773-
Tags: []string{Essentials}}, {
759+
}}, {
774760
Flag: cli.StringFlag{
775761
Name: "pid-filename",
776762
Usage: "process id `FILE` *daemon-mode only*",

0 commit comments

Comments
 (0)