diff --git a/cmd/relay/flag/server.go b/cmd/relay/flag/server.go index 65130cb..cb3ba87 100644 --- a/cmd/relay/flag/server.go +++ b/cmd/relay/flag/server.go @@ -26,8 +26,8 @@ func Server(cmd *cobra.Command, values config.Values) { cmd.PersistentFlags().String(config.Keys.WebappChartJSIntegrity, values.WebappChartJSIntegrity, usage.WebappChartJSIntegrity) cmd.PersistentFlags().String(config.Keys.WebappFontAwesomeCSSURI, values.WebappFontAwesomeCSSURI, usage.WebappFontAwesomeCSSURI) cmd.PersistentFlags().String(config.Keys.WebappFontAwesomeCSSIntegrity, values.WebappFontAwesomeCSSIntegrity, usage.WebappFontAwesomeCSSIntegrity) - cmd.PersistentFlags().String(config.Keys.WebappLogoSrcDark, values.WebappLogoSrcDark, usage.WebappLogoSrcDark) - cmd.PersistentFlags().String(config.Keys.WebappLogoSrcLight, values.WebappLogoSrcLight, usage.WebappLogoSrcLight) + cmd.PersistentFlags().String(config.Keys.WebappLogoMascot, values.WebappLogoMascot, usage.WebappLogoMascot) + cmd.PersistentFlags().String(config.Keys.WebappLogoHorizontal, values.WebappLogoHorizontal, usage.WebappLogoHorizontal) // metrics cmd.PersistentFlags().String(config.Keys.MetricsHTTPBind, values.MetricsHTTPBind, usage.MetricsHTTPBind) diff --git a/internal/config/keys.go b/internal/config/keys.go index 27aa720..a8aa5fa 100644 --- a/internal/config/keys.go +++ b/internal/config/keys.go @@ -56,8 +56,8 @@ type KeyNames struct { WebappChartJSIntegrity string WebappFontAwesomeCSSURI string WebappFontAwesomeCSSIntegrity string - WebappLogoSrcDark string - WebappLogoSrcLight string + WebappLogoMascot string + WebappLogoHorizontal string // account Account string @@ -123,8 +123,8 @@ var Keys = KeyNames{ WebappChartJSIntegrity: "webapp-chart-js-integrity", WebappFontAwesomeCSSURI: "webapp-fontawesome-css-uri", WebappFontAwesomeCSSIntegrity: "webapp-fontawesome-css-integrity", - WebappLogoSrcDark: "webapp-logo-src-dark", - WebappLogoSrcLight: "webapp-logo-src-light", + WebappLogoMascot: "webapp-logo-mascot", + WebappLogoHorizontal: "webapp-logo-horizontal", // account Account: "account", diff --git a/internal/config/values.go b/internal/config/values.go index 5d35fdf..e113e32 100644 --- a/internal/config/values.go +++ b/internal/config/values.go @@ -56,8 +56,8 @@ type Values struct { WebappChartJSIntegrity string WebappFontAwesomeCSSURI string WebappFontAwesomeCSSIntegrity string - WebappLogoSrcDark string - WebappLogoSrcLight string + WebappLogoMascot string + WebappLogoHorizontal string // account Account string @@ -120,8 +120,8 @@ var Defaults = Values{ WebappChartJSIntegrity: "sha384-9MhbyIRcBVQiiC7FSd7T38oJNj2Zh+EfxS7/vjhBi4OOT78NlHSnzM31EZRWR1LZ", WebappFontAwesomeCSSURI: "https://assets.fedi.tools/vendor/fontawesome-free-6.1.1/css/all.min.css", WebappFontAwesomeCSSIntegrity: "sha384-/frq1SRXYH/bSyou/HUp/hib7RVN1TawQYja658FEOodR/FQBKVqT9Ol+Oz3Olq5", - WebappLogoSrcDark: "https://assets.fedi.tools/img/feditools-logo-dark.svg", - WebappLogoSrcLight: "https://assets.fedi.tools/img/feditools-logo-light.svg", + WebappLogoMascot: "https://assets.fedi.tools/img/feditools-logo-dark.svg", + WebappLogoHorizontal: "https://assets.fedi.tools/img/feditools-logo-dark.svg", // metrics MetricsHTTPBind: ":9218", diff --git a/internal/http/template/template.go b/internal/http/template/template.go index 6d86872..ec82e04 100644 --- a/internal/http/template/template.go +++ b/internal/http/template/template.go @@ -42,8 +42,8 @@ func New(tokz *token.Tokenizer) (*template.Template, error) { "formatDateTimeUTC": formatDateTimeUTC, "olderThan24Hours": genOlderThan(hours24), "olderThan7Days": genOlderThan(days7), - "logoSrcDark": genString(viper.GetString(config.Keys.WebappLogoSrcDark)), - "logoSrcLight": genString(viper.GetString(config.Keys.WebappLogoSrcLight)), + "logoMascot": genString(viper.GetString(config.Keys.WebappLogoMascot)), + "logoHorizontal": genString(viper.GetString(config.Keys.WebappLogoHorizontal)), "pathAppAdminBlockExport": path.GenAppAdminBlockExport, "pathAppAdminBlockExportCSV": path.GenAppAdminBlockExportCSV, "pathAppAdminBlockExportJSON": path.GenAppAdminBlockExportJSON, diff --git a/internal/http/webapp/error.go b/internal/http/webapp/error.go index d52d96d..1ce29fb 100644 --- a/internal/http/webapp/error.go +++ b/internal/http/webapp/error.go @@ -2,8 +2,10 @@ package webapp import ( "fmt" + "git.ptzo.gdn/feditools/relay/internal/config" "git.ptzo.gdn/feditools/relay/internal/http/template" "git.ptzo.gdn/feditools/relay/internal/path" + "github.com/spf13/viper" "net/http" ) @@ -14,7 +16,7 @@ func (m *Module) returnErrorPage(w http.ResponseWriter, r *http.Request, code in tmplVars := &template.Error{} // set image - tmplVars.Image = m.logoSrcDark + tmplVars.Image = viper.GetString(config.Keys.WebappLogoMascot) // set text tmplVars.Header = fmt.Sprintf("%d", code) diff --git a/internal/http/webapp/login.go b/internal/http/webapp/login.go index d118e9f..464f925 100644 --- a/internal/http/webapp/login.go +++ b/internal/http/webapp/login.go @@ -3,9 +3,11 @@ package webapp import ( "errors" libtemplate "git.ptzo.gdn/feditools/go-lib/template" + "git.ptzo.gdn/feditools/relay/internal/config" "git.ptzo.gdn/feditools/relay/internal/db" "git.ptzo.gdn/feditools/relay/internal/http/template" "git.ptzo.gdn/feditools/relay/internal/language" + "github.com/spf13/viper" "net/http" ) @@ -87,7 +89,7 @@ func (m *Module) displayLoginPage(w http.ResponseWriter, r *http.Request, instan Value: instance, Required: true, }, - LogoHRef: m.logoSrcDark, + LogoHRef: viper.GetString(config.Keys.WebappLogoMascot), }, } diff --git a/internal/http/webapp/webapp.go b/internal/http/webapp/webapp.go index 841935f..3c435db 100644 --- a/internal/http/webapp/webapp.go +++ b/internal/http/webapp/webapp.go @@ -44,8 +44,6 @@ type Module struct { tracerAttrs []trace.SpanStartOption domain string - logoSrcDark string - logoSrcLight string headLinks []libtemplate.HeadLink footerScripts []libtemplate.Script footerScriptChartJS libtemplate.Script @@ -146,8 +144,6 @@ func New( }, domain: viper.GetString(config.Keys.ServerExternalHostname), - logoSrcDark: viper.GetString(config.Keys.WebappLogoSrcDark), - logoSrcLight: viper.GetString(config.Keys.WebappLogoSrcLight), headLinks: hl, footerScripts: fs, footerScriptChartJS: fsCanvasJS, diff --git a/web/template/footer.gohtml b/web/template/footer.gohtml index afb5c18..a08838d 100644 --- a/web/template/footer.gohtml +++ b/web/template/footer.gohtml @@ -6,7 +6,7 @@