added svg, file size limit

Added svg to logo choices, file size limits (5Mb for favicon, 10Mb for logo)
This commit is contained in:
Arminas 2023-02-21 13:14:42 +02:00 committed by GitHub
parent 12d0dc6288
commit 830d5a1c59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 8 deletions

View file

@ -52,7 +52,12 @@ func Favicon(db store.IStore) echo.HandlerFunc {
func BrandLogo(db store.IStore) echo.HandlerFunc {
return func(c echo.Context) error {
_, err := os.OpenFile(path.Join(db.GetPath(), "branding")+"/logo.png", os.O_RDONLY, 0777)
_, err := os.OpenFile(path.Join(db.GetPath(), "branding")+"/logo.svg", os.O_RDONLY, 0777)
if err == nil {
return c.File(path.Join(db.GetPath(), "branding") + "/logo.svg")
}
_, err = os.OpenFile(path.Join(db.GetPath(), "branding")+"/logo.png", os.O_RDONLY, 0777)
if err == nil {
return c.File(path.Join(db.GetPath(), "branding") + "/logo.png")
}