Skip to content

Commit b38d91c

Browse files
authored
Merge pull request #2000 from umputun/fix/quick-fixes-1946-1991-1996
Fix email encoding, image cleanup CPU spin, and demo template paths
2 parents d6d53ff + 3c2679a commit b38d91c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

backend/app/notify/email.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (e *Email) buildAndSendMessage(ctx context.Context, req Request, email stri
168168
ctx,
169169
fmt.Sprintf("mailto:%s?from=%s&unsubscribeLink=%s&subject=%s",
170170
email,
171-
e.From,
171+
url.QueryEscape(e.From),
172172
url.QueryEscape(msg.unsubscribeLink),
173173
url.QueryEscape(msg.subject),
174174
),
@@ -203,7 +203,7 @@ func (e *Email) SendVerification(ctx context.Context, req VerificationRequest) e
203203
ctx,
204204
fmt.Sprintf("mailto:%s?from=%s&subject=%s",
205205
req.Email,
206-
e.From,
206+
url.QueryEscape(e.From),
207207
url.QueryEscape(e.VerificationSubject),
208208
),
209209
msg,

backend/app/store/image/image.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ func (s *Service) ExtractNonProxiedPictures(commentHTML string) (ids []string) {
154154

155155
// Cleanup runs periodic cleanup with 1.5*ServiceParams.EditDuration. Blocking loop, should be called inside of goroutine by consumer
156156
func (s *Service) Cleanup(ctx context.Context) {
157+
if s.EditDuration <= 0 {
158+
log.Printf("[INFO] pictures cleanup disabled, edit duration is %v", s.EditDuration)
159+
<-ctx.Done()
160+
return
161+
}
162+
157163
cleanupTTL := s.EditDuration * 15 / 10 // cleanup images older than 1.5 * EditDuration
158164
log.Printf("[INFO] start pictures cleanup, staging ttl=%v", cleanupTTL)
159165

frontend/apps/remark42/templates/demo.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
</p>
7373
<div class="widgets">
7474
<div class="widget widgets__widget widgets__comments-widget">
75-
<a class="widget__link" href="/web/last-comments.html">Last comments widget page</a><br />
76-
<iframe class="widget__frame widget__comments-frame" src="/web/last-comments.html" frameborder="0"></iframe>
75+
<a class="widget__link" href="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/last-comments.html">Last comments widget page</a><br />
76+
<iframe class="widget__frame widget__comments-frame" src="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/last-comments.html" frameborder="0"></iframe>
7777
</div>
7878
<div class="widget widgets__widget widgets__counter-widget">
79-
<a class="widget__link" href="/web/counter.html">Counter widget page</a><br />
79+
<a class="widget__link" href="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/counter.html">Counter widget page</a><br />
8080
<div class="widget__frame widget__counter-frame">Comments count: <span class="remark42__counter"></span></div>
8181
</div>
8282
</div>

0 commit comments

Comments
 (0)