summaryrefslogtreecommitdiff
path: root/internal/router/handlers
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/router/handlers')
-rw-r--r--internal/router/handlers/api-v1-blog-search.go4
-rw-r--r--internal/router/handlers/api-v1-email-send-verification-code.go4
-rw-r--r--internal/router/handlers/api-v1-email-verify.go4
-rw-r--r--internal/router/handlers/api-v1-like-put.go4
-rw-r--r--internal/router/handlers/api-v1-subs-put.go4
-rw-r--r--internal/router/handlers/lang-blog-title.go2
-rw-r--r--internal/router/handlers/lang.go10
-rw-r--r--internal/router/handlers/root.go3
8 files changed, 3 insertions, 32 deletions
diff --git a/internal/router/handlers/api-v1-blog-search.go b/internal/router/handlers/api-v1-blog-search.go
index 38004a1..c9a91ad 100644
--- a/internal/router/handlers/api-v1-blog-search.go
+++ b/internal/router/handlers/api-v1-blog-search.go
@@ -44,10 +44,6 @@ func (r *BlogSearchHandler) ToValidateLang() router.LangSetting {
return router.InForm
}
-func (r *BlogSearchHandler) RateLimiter() *fiber.Handler {
- return &router.RateLimiterLoose
-}
-
func (r *BlogSearchHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
sort := c.Query("sort")
tz := c.Query("tz")
diff --git a/internal/router/handlers/api-v1-email-send-verification-code.go b/internal/router/handlers/api-v1-email-send-verification-code.go
index 0b53efa..20c5fb6 100644
--- a/internal/router/handlers/api-v1-email-send-verification-code.go
+++ b/internal/router/handlers/api-v1-email-send-verification-code.go
@@ -38,10 +38,6 @@ func (r *SendVerificationCodeHandler) ToValidateLang() router.LangSetting {
return router.InReferer
}
-func (r *SendVerificationCodeHandler) RateLimiter() *fiber.Handler {
- return &router.RateLimiterStrict
-}
-
func (r *SendVerificationCodeHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
id := c.IP()
templateMap["StatusId"] = "email-message"
diff --git a/internal/router/handlers/api-v1-email-verify.go b/internal/router/handlers/api-v1-email-verify.go
index ace1870..c9ec969 100644
--- a/internal/router/handlers/api-v1-email-verify.go
+++ b/internal/router/handlers/api-v1-email-verify.go
@@ -36,10 +36,6 @@ func (r *VerifyCodeHandler) ToValidateLang() router.LangSetting {
return router.InReferer
}
-func (r *VerifyCodeHandler) RateLimiter() *fiber.Handler {
- return &router.RateLimiterStrict
-}
-
func (r *VerifyCodeHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
verificationCode := c.FormValue("email_code")
templateMap["StatusId"] = "verification-message"
diff --git a/internal/router/handlers/api-v1-like-put.go b/internal/router/handlers/api-v1-like-put.go
index 8305d2b..434f15a 100644
--- a/internal/router/handlers/api-v1-like-put.go
+++ b/internal/router/handlers/api-v1-like-put.go
@@ -37,10 +37,6 @@ func (r *PutLikeHandler) ToValidateLang() router.LangSetting {
return router.InReferer
}
-func (r *PutLikeHandler) RateLimiter() *fiber.Handler {
- return &router.RateLimiterMedium
-}
-
func (r *PutLikeHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
path, pathParts, _, err := router.GetPathFromReferer(c)
if err != nil {
diff --git a/internal/router/handlers/api-v1-subs-put.go b/internal/router/handlers/api-v1-subs-put.go
index 32fba7e..144abe5 100644
--- a/internal/router/handlers/api-v1-subs-put.go
+++ b/internal/router/handlers/api-v1-subs-put.go
@@ -34,10 +34,6 @@ func (r *PutSubsHandler) ToValidateLang() router.LangSetting {
return router.InReferer
}
-func (r *PutSubsHandler) RateLimiter() *fiber.Handler {
- return &router.RateLimiterMedium
-}
-
func (r *PutSubsHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
templateMap["StatusId"] = "subs-message"
diff --git a/internal/router/handlers/lang-blog-title.go b/internal/router/handlers/lang-blog-title.go
index 49744c1..f1be0a5 100644
--- a/internal/router/handlers/lang-blog-title.go
+++ b/internal/router/handlers/lang-blog-title.go
@@ -74,7 +74,7 @@ func (r *BlogPageHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements,
return []router.MetaField{
{Property: "og:title", Content: metadata.Title},
{Property: "og:description", Content: fmt.Sprintf("%s [%s]", metadata.ShortDescription, metadata.ActionDate)},
- {Property: "og:image", Content: fmt.Sprintf(supplements.PhotoStorage.Thumbnail320p.BaseUrl, metadata.Thumbnail)},
+ {Property: "og:image", Content: fmt.Sprintf("https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp", metadata.Thumbnail)},
{Property: "og:url", Content: fmt.Sprintf("%s/%s/blog/%s", templateMap["CanonicalEndpoint"], lang, c.Params("title"))},
{Property: "og:type", Content: "website"},
{Name: "twitter:card", Content: "summary_large_image"},
diff --git a/internal/router/handlers/lang.go b/internal/router/handlers/lang.go
index 25b5036..c618353 100644
--- a/internal/router/handlers/lang.go
+++ b/internal/router/handlers/lang.go
@@ -53,10 +53,7 @@ func (r *HomeHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lan
return []router.MetaField{
{Property: "og:title", Content: supplements.Localization[lang].HomePage.Header},
{Property: "og:description", Content: supplements.Localization[lang].HomePage.HomePageDescription},
- {Property: "og:image", Content: fmt.Sprintf(
- supplements.PhotoStorage.HomePageGifs.BaseUrl,
- supplements.PhotoStorage.HomePageGifs.Indexes[rand.Int()%len(supplements.PhotoStorage.HomePageGifs.Indexes)],
- )},
+ {Property: "og:image", Content: fmt.Sprintf("https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/otter-%d.gif", rand.Int()%3+1)},
{Property: "og:url", Content: fmt.Sprintf("%s/%s", templateMap["CanonicalEndpoint"], lang)},
{Property: "og:type", Content: "website"},
}, nil
@@ -66,10 +63,7 @@ func (r *HomeHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements,
templateMap["Title"] = supplements.Localization[lang].HomePage.Header
templateMap["FilledHeartCount"] = uint(40)
templateMap["OutlineHeartCount"] = uint(40)
- templateMap["GifUrl"] = fmt.Sprintf(
- supplements.PhotoStorage.HomePageGifs.BaseUrl,
- supplements.PhotoStorage.HomePageGifs.Indexes[rand.Int()%len(supplements.PhotoStorage.HomePageGifs.Indexes)],
- )
+ templateMap["GifName"] = fmt.Sprintf("otter-%d.gif", rand.Int()%3+1)
templateMap["FunFacts"] = supplements.FactGiver.Give(lang)
return fiber.StatusOK, nil
}
diff --git a/internal/router/handlers/root.go b/internal/router/handlers/root.go
index 6a011e4..a8890fa 100644
--- a/internal/router/handlers/root.go
+++ b/internal/router/handlers/root.go
@@ -50,9 +50,6 @@ func (r *RootHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lan
if supplements.Meta.GoogleSiteVerification != "" {
meta = append(meta, router.MetaField{Name: "google-site-verification", Content: supplements.Meta.GoogleSiteVerification})
}
- if supplements.Meta.YandexVerification != "" {
- meta = append(meta, router.MetaField{Name: "yandex-verification", Content: supplements.Meta.YandexVerification})
- }
return meta, nil
}