diff --git a/.github/workflows/report-api-diff.yml b/.github/workflows/report-api-diff.yml
index df9cc279e866..9fd1e28f0154 100644
--- a/.github/workflows/report-api-diff.yml
+++ b/.github/workflows/report-api-diff.yml
@@ -70,18 +70,27 @@ jobs:
- id: out-diff
name: Build diff Comment
run: |
- cat <<- EOF > ./output.md
- このPRによるapi.jsonの差分
-
- 差分はこちら
-
- \`\`\`diff
- $(cat ./api.json.diff)
- \`\`\`
-
-
- [Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
- EOF
+ HEADER="このPRによるapi.jsonの差分"
+ FOOTER="[Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})"
+ DIFF_BYTES="$(stat ./api.json.diff -c '%s' | tr -d '\n')"
+
+ echo "$HEADER" > ./output.md
+
+ if (( "$DIFF_BYTES" <= 1 )); then
+ echo '差分はありません。' >> ./output.md
+ else
+ cat <<- EOF >> ./output.md
+
+ 差分はこちら
+
+ \`\`\`diff
+ $(cat ./api.json.diff)
+ \`\`\`
+
+ EOF
+ fi
+
+ echo "$FOOTER" >> ./output.md
- uses: thollander/actions-comment-pull-request@v2
with:
pr_number: ${{ steps.load-pr-num.outputs.pr-number }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 76c4e851df85..78b2b3fa4fcd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,8 @@
- Fix: ファイルがサイズの制限を超えてアップロードされた際にエラーを返さなかった問題を修正
- Fix: 外部ページを解析する際に、ページに紐づけられた関連リソースも読み込まれてしまう問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/26e0412fbb91447c37e8fb06ffb0487346063bb8)
+- Fix: `Retry-After`ヘッダーが送信されなかった問題を修正
+ (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/8a982c61c01909e7540ff1be9f019df07c3f0624)
## 2024.8.0
diff --git a/packages/backend/package.json b/packages/backend/package.json
index a06fd9156b7a..aee3854ef387 100644
--- a/packages/backend/package.json
+++ b/packages/backend/package.json
@@ -132,6 +132,7 @@
"json5": "2.2.3",
"jsonld": "8.3.2",
"jsrsasign": "11.1.0",
+ "juice": "11.0.0",
"meilisearch": "0.41.0",
"mfm-js": "0.24.0",
"microformats-parser": "2.0.2",
diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts
index 435dbbae28a9..37fa58bb651a 100644
--- a/packages/backend/src/core/EmailService.ts
+++ b/packages/backend/src/core/EmailService.ts
@@ -5,6 +5,7 @@
import { URLSearchParams } from 'node:url';
import * as nodemailer from 'nodemailer';
+import juice from 'juice';
import { Inject, Injectable } from '@nestjs/common';
import { validate as validateEmail } from 'deep-email-validator';
import { MetaService } from '@/core/MetaService.js';
@@ -61,14 +62,7 @@ export class EmailService {
} : undefined,
} as any);
- try {
- // TODO: htmlサニタイズ
- const info = await transporter.sendMail({
- from: meta.email!,
- to: to,
- subject: subject,
- text: text,
- html: `
+ const htmlContent = `
@@ -147,7 +141,18 @@ export class EmailService {
${ this.config.host }
-`,
+