diff --git a/.dev.vars b/.dev.vars
new file mode 100644
index 0000000..a2a6158
--- /dev/null
+++ b/.dev.vars
@@ -0,0 +1 @@
+NEXTJS_ENV=development
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..14a8bf0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,90 @@
+name: 🐛 Bug 报告 / Bug Report
+description: 报告一个 Bug / Report a bug
+title: "[Bug] "
+labels: [bug]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ## 感谢你报告问题!/ Thanks for reporting an issue!
+ 请填写以下信息,帮助我们快速定位问题。/ Please fill in the following information to help us locate the issue quickly.
+
+ - type: dropdown
+ id: branch
+ attributes:
+ label: 你使用的是哪个分支?/ Which branch are you using?
+ description: 请选择你所使用的分支。/ Please select the branch you are using.
+ options:
+ - Lite(原生单文件版 / Original single-file version)
+ - next(Next.js 16 版 / Next.js 16 version)
+ validations:
+ required: true
+
+ - type: input
+ id: version
+ attributes:
+ label: 后台版本号 / Backend version (管理员填写 / admins only)
+ description: |
+ 如果你使用的是 next 分支且是管理员,请粘贴后台显示的版本号。其他情况请留空。
+ / If you are using the next branch and are an administrator, please paste the version shown in the admin panel. Leave blank otherwise.
+ placeholder: "例如 / e.g. 2.0.0"
+ validations:
+ required: false
+
+ - type: textarea
+ id: description
+ attributes:
+ label: 问题描述 / Description
+ description: 请清晰描述你遇到的问题。/ Please clearly describe the issue you encountered.
+ validations:
+ required: true
+
+ - type: textarea
+ id: steps
+ attributes:
+ label: 复现步骤 / Steps to reproduce
+ description: 如何复现这个问题?/ How can this issue be reproduced?
+ placeholder: |
+ 1. 打开... / Open ...
+ 2. 点击... / Click ...
+ 3. 看到错误... / See the error...
+ validations:
+ required: true
+
+ - type: textarea
+ id: expected
+ attributes:
+ label: 期望行为 / Expected behavior
+ description: 你期望发生什么?/ What did you expect to happen?
+ validations:
+ required: true
+
+ - type: textarea
+ id: actual
+ attributes:
+ label: 实际行为 / Actual behavior
+ description: 实际发生了什么?/ What actually happened?
+ validations:
+ required: true
+
+ - type: textarea
+ id: environment
+ attributes:
+ label: 环境信息 / Environment
+ description: 你的运行环境。/ Your running environment.
+ placeholder: |
+ - 操作系统 / OS:
+ - 浏览器 / Browser:
+ - Node.js 版本 / Node.js version:
+ - 部署方式 / Deployment method (Docker / 源码 / Source):
+ validations:
+ required: false
+
+ - type: textarea
+ id: logs
+ attributes:
+ label: 日志 / Logs
+ description: 如有报错日志,请粘贴于此。/ Paste any error logs here if available.
+ render: shell
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..3ba13e0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..168b4ed
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,65 @@
+name: ✨ 功能建议 / Feature Request
+description: 提出一个新功能或改进建议 / Suggest an idea for this project
+title: "[Feature] "
+labels: [enhancement]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ## 感谢你的建议!/ Thanks for your suggestion!
+ 请填写以下信息,让我们了解你的想法。/ Please fill in the information below to help us understand your idea.
+
+ - type: dropdown
+ id: branch
+ attributes:
+ label: 这个功能针对哪个分支?/ Which branch is this feature for?
+ description: 请选择你所使用的分支。/ Please select the branch you are using.
+ options:
+ - Lite(原生单文件版 / Original single-file version)
+ - next(Next.js 16 版 / Next.js 16 version)
+ validations:
+ required: true
+
+ - type: input
+ id: version
+ attributes:
+ label: 后台版本号 / Backend version (管理员填写 / admins only)
+ description: |
+ 如果你使用的是 next 分支且是管理员,请粘贴后台显示的版本号。其他情况请留空。
+ / If you are using the next branch and are an administrator, please paste the version shown in the admin panel. Leave blank otherwise.
+ placeholder: "例如 / e.g. 2.0.0"
+ validations:
+ required: false
+
+ - type: textarea
+ id: problem
+ attributes:
+ label: 要解决的问题 / Problem to solve
+ description: 这个功能解决什么问题?/ What problem does this feature solve?
+ placeholder: "当我...时,我希望... / When I ..., I wish ..."
+ validations:
+ required: true
+
+ - type: textarea
+ id: solution
+ attributes:
+ label: 期望的解决方案 / Proposed solution
+ description: 你希望如何实现?/ How would you like it to work?
+ validations:
+ required: true
+
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: 替代方案 / Alternatives considered
+ description: 你考虑过其他方案吗?/ Have you considered any alternative approaches?
+ validations:
+ required: false
+
+ - type: textarea
+ id: additional
+ attributes:
+ label: 补充说明 / Additional context
+ description: 其他任何信息、截图或示例。/ Any other information, screenshots, or examples.
+ validations:
+ required: false
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..8a4afb6
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,52 @@
+# 感谢你为 Forumlify 提交贡献!/ Thank you for contributing to Forumlify!
+
+
+
+## 目标分支 / Target branch
+
+**你提交的代码是基于哪个分支?/ Which branch is your code based on?**
+
+- [ ] **Lite**(原生单文件版 / Original single-file version)
+- [ ] **next**(Next.js 16 版 / Next.js 16 version)
+
+> ⚠️ 请确保 PR 的 base 分支与你的代码来源分支一致。/ Please make sure the PR's base branch matches the branch your code comes from.
+
+## 版本信息 / Version info
+
+
+**后台版本号 / Backend version (admin only):**
+
+```
+(在此粘贴后台显示的版本号 / Paste the version shown in the admin panel here)
+```
+
+## 变更内容 / What does this PR do?
+
+
+
+-
+
+## 动机 / Motivation
+
+
+
+-
+
+## 测试 / Testing
+
+
+
+- [ ] 本地构建通过 / Local build passes (`npm run build`,仅 next 分支 / next branch only)
+- [ ] 相关功能已手动测试 / Related features manually tested
+- [ ] 测试用例已更新 / Tests updated
+
+## 截图 / Screenshots
+
+
+
+## 检查清单 / Checklist
+
+- [ ] 我已阅读并遵循了贡献指南 / I have read and followed the contributing guidelines
+- [ ] 我的代码遵循现有代码风格 / My code follows the existing code style
+- [ ] 我已同步最新的上游分支 / I have synced with the latest upstream branch
+- [ ] 本 PR 只包含必要的改动 / This PR contains only the necessary changes
diff --git a/.github/workflows/docker-lite.yml b/.github/workflows/docker-lite.yml
new file mode 100644
index 0000000..ea42fb6
--- /dev/null
+++ b/.github/workflows/docker-lite.yml
@@ -0,0 +1,55 @@
+name: Build & Push Docker to GHCR (Lite)
+
+on:
+ push:
+ branches: [Lite]
+ tags: ['v*']
+ workflow_dispatch:
+
+env:
+ REGISTRY: ghcr.io
+ # 推仓库自己的 GHCR 包(github.repository = Furrium/forumlify)——
+ # 仓库 GITHUB_TOKEN 无权推跨仓库包(如 lezi-fun/forumlify-deploy)
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to GHCR
+ uses: docker/login-action@v3
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata (tags, labels)
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ tags: |
+ # Lite 分支 → lite 标签(与 next 镜像隔离,避免覆盖)
+ type=raw,value=lite,enable=${{ github.ref == 'refs/heads/Lite' }}
+ type=semver,pattern={{version}}
+ type=sha,prefix=git-
+
+ - name: Build and push (linux/amd64 + linux/arm64)
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ push: true
+ platforms: linux/amd64, linux/arm64
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
diff --git a/.github/workflows/ghbot.yml b/.github/workflows/ghbot.yml
new file mode 100644
index 0000000..acfd270
--- /dev/null
+++ b/.github/workflows/ghbot.yml
@@ -0,0 +1,83 @@
+name: ghbot
+
+on:
+ pull_request_target:
+ types:
+ - opened
+ - synchronize
+ - reopened
+ - ready_for_review
+ - edited
+ issues:
+ types:
+ - opened
+ - edited
+ - reopened
+ issue_comment:
+ types:
+ - created
+ pull_request_review:
+ types:
+ - submitted
+
+permissions:
+ contents: write
+ pull-requests: write
+ checks: write
+ statuses: read
+ issues: write
+
+jobs:
+ review:
+ if: |
+ github.event_name == 'pull_request_target' ||
+ github.event_name == 'issues' ||
+ (github.event_name == 'issue_comment' && github.event.issue.pull_request != null) ||
+ github.event_name == 'pull_request_review'
+ uses: lezi-fun/ghbot/.github/workflows/review-reusable.yml@main
+ secrets:
+ GOOSE_API_KEY: ${{ secrets.GOOSE_API_KEY || secrets.OPENCODE_API_KEY }}
+ GH_APP_ID: ${{ secrets.GH_APP_ID }}
+ GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
+ GH_APP_INSTALLATION_ID: ${{ secrets.GH_APP_INSTALLATION_ID }}
+ R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
+ R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
+ with:
+ event_name: ${{ github.event_name }}
+ event_action: ${{ github.event.action }}
+ repository_owner: ${{ github.repository_owner }}
+ repository_name: ${{ github.event.repository.name }}
+ repository_id: ${{ github.repository_id }}
+ pull_number: ${{ github.event.pull_request.number || github.event.issue.number }}
+ pull_head_repository: ${{ github.event.pull_request.head.repo.full_name || '' }}
+ comment_id: ${{ github.event.comment.id || '' }}
+ commenter_login: ${{ github.event.comment.user.login || '' }}
+ comment_body: ${{ github.event.comment.body || '' }}
+ reviewer_login: ${{ github.event.review.user.login || '' }}
+ review_state: ${{ github.event.review.state || '' }}
+ review_commit_id: ${{ github.event.review.commit_id || '' }}
+ bot_name: ${{ vars.BOT_NAME || 'github-actions[bot]' }}
+ goose_base_url: ${{ vars.GOOSE_BASE_URL || vars.OPENCODE_BASE_URL || 'https://api.openai.com/v1' }}
+ goose_model: ${{ vars.GOOSE_MODEL || vars.OPENCODE_MODEL || 'gpt-5.4' }}
+ goose_thinking_effort: ${{ vars.GOOSE_THINKING_EFFORT || vars.OPENCODE_REASONING_EFFORT || 'high' }}
+ review_policy: ${{ vars.REVIEW_POLICY || 'allow' }}
+ review_strictness: ${{ vars.REVIEW_STRICTNESS || 'normal' }}
+ review_instructions: ${{ vars.REVIEW_INSTRUCTIONS || '' }}
+ review_branches: ${{ vars.REVIEW_BRANCHES || '' }}
+ repository_knowledge_enabled: ${{ vars.REPOSITORY_KNOWLEDGE_ENABLED || 'true' }}
+ repository_knowledge_write: ${{ vars.REPOSITORY_KNOWLEDGE_WRITE || 'false' }}
+ r2_endpoint: ${{ vars.R2_ENDPOINT || '' }}
+ r2_bucket_name: ${{ vars.R2_BUCKET_NAME || '' }}
+ r2_prefix: ${{ vars.R2_PREFIX || '' }}
+ triage_enabled: ${{ vars.TRIAGE_ENABLED || 'true' }}
+ triage_labels: ${{ vars.TRIAGE_LABELS || 'bug,enhancement,documentation,question' }}
+ triage_duplicate_label: ${{ vars.TRIAGE_DUPLICATE_LABEL || 'duplicate' }}
+ triage_candidate_limit: ${{ vars.TRIAGE_CANDIDATE_LIMIT || '50' }}
+ triage_instructions: ${{ vars.TRIAGE_INSTRUCTIONS || '' }}
+ auto_merge: ${{ vars.AUTO_MERGE || 'false' }}
+ auto_resolve_conflicts: ${{ vars.AUTO_RESOLVE_CONFLICTS || 'false' }}
+ conflict_test_command: ${{ vars.CONFLICT_TEST_COMMAND || '' }}
+ merge_method: ${{ vars.MERGE_METHOD || 'squash' }}
+ require_checks: ${{ vars.REQUIRE_CHECKS || 'true' }}
+ max_patch_chars: ${{ vars.MAX_PATCH_CHARS || '120000' }}
+ log_level: info
diff --git a/.gitignore b/.gitignore
index af05b1e..4377855 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,13 @@ uploads/
*.log
.DS_Store
.env
+
+# Wrangler 本地状态
+.wrangler/
+
+
+# 构建产物
+.open-next/
+.vercel/
+.next/
+.wrangler/
diff --git a/README.md b/README.md
index 5ab704e..1322178 100644
--- a/README.md
+++ b/README.md
@@ -37,16 +37,20 @@ Forumlify 提供了两个不同架构的分支版本,以满足不同部署环
### Docker 部署(推荐)
```
-git clone https://github.com/furrium/forumlify.git
+git clone https://github.com/forumlify/public.git
cd forumlify
-docker-compose up -d
+printf 'JWT_SECRET=%s\n' "$(openssl rand -hex 32)" > .env
+docker compose up -d
```
+旧版 Compose 也可以使用 `docker-compose up -d`。请妥善备份 `.env`;更换
+`JWT_SECRET` 会使现有登录令牌失效。
+
应用默认运行在 `http://localhost:3000`。
---
-> 如需部署 Next.js 版本,请前往 [forumlify/tree/next](https://github.com/furrium/forumlify/tree/next)。
+> 如需部署 Next.js 版本,请前往 [forumlify/tree/next](https://github.com/forumlify/public/tree/next)。
---
@@ -56,7 +60,7 @@ docker-compose up -d
#### 环境要求
-- Node.js 18+
+- Node.js 20+
- PostgreSQL 13+
#### 步骤
@@ -64,7 +68,7 @@ docker-compose up -d
1. **克隆并安装依赖**
```bash
-git clone https://github.com/furrium/forumlify.git
+git clone https://github.com/public/tree/lite.git
cd forumlify
npm install
```
@@ -86,6 +90,7 @@ psql -U forumlify -d forumlify -f schema.sql
| `JWT_SECRET` | 本地开发使用内置值 | JWT 签名密钥;`NODE_ENV=production` 时必须显式设置 |
| `ALLOWED_ORIGINS` | 空 | 允许跨域访问的来源,多个值用逗号分隔;为空时仅支持同源访问 |
| `TRUST_PROXY` | `false` | 位于可信反向代理后时设为 `true`,用于正确识别限流 IP |
+| `ADMIN_BOOTSTRAP_TOKEN` | 空 | 首次部署时设置强随机值;注册页填写相同值可创建唯一初始管理员,初始化后应删除该变量 |
4. **启动**
@@ -139,4 +144,3 @@ forumlify/
MIT
-
diff --git a/docker-compose.yml b/docker-compose.yml
index 54673b5..ba7a939 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,17 +11,25 @@ services:
- db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
+ restart: unless-stopped
app:
- build: .
+ # 从 GHCR 拉取镜像(每次 push Lite 自动重建),不再本地构建
+ image: ghcr.io/furrium/forumlify:lite
ports:
- "3000:3000"
depends_on:
- db
environment:
DATABASE_URL: postgresql://forumlify:123456@db:5432/forumlify
+ PORT: 3000
+ ENABLE_CAPTCHA: "true"
+ JWT_SECRET: "${JWT_SECRET:?Set JWT_SECRET in .env before starting Forumlify}"
+ # 信任反向代理(Nginx / Docker 端口转发),修复限流警告
+ TRUST_PROXY: "true"
volumes:
- ./uploads:/app/uploads
+ restart: unless-stopped
volumes:
db_data:
diff --git a/index.html b/index.html
index 30ce65d..c07866b 100644
--- a/index.html
+++ b/index.html
@@ -362,6 +362,7 @@
+
3 + 5 = ?
diff --git a/js/api.js b/js/api.js
index f0d0812..43418e8 100644
--- a/js/api.js
+++ b/js/api.js
@@ -35,10 +35,10 @@ const API = {
return data;
},
- async register(email, password, username) {
+ async register(email, password, username, bootstrapToken = '') {
const data = await apiFetch('/auth/register', {
method: 'POST',
- body: JSON.stringify({ email, password, username })
+ body: JSON.stringify({ email, password, username, bootstrap_token: bootstrapToken || undefined })
});
if (data.error) throw new Error(data.error);
return data;
@@ -214,14 +214,6 @@ const API = {
return data;
},
- async logEvent(action) {
- try {
- await apiFetch('/event-logs', {
- method: 'POST',
- body: JSON.stringify({ action })
- });
- } catch (e) { /* 静默失败 */ }
- },
// ============================================================
// 论坛设置
diff --git a/js/app.js b/js/app.js
index 24b6a44..d0557cf 100644
--- a/js/app.js
+++ b/js/app.js
@@ -458,7 +458,7 @@ function showCustomPage(pageName) {
API.getCustomPage(pageName).then(page => {
const iframe = document.createElement('iframe');
iframe.style.cssText = 'width:100%;min-height:70vh;border:none;border-radius:8px;background:var(--surface);';
- iframe.sandbox = 'allow-scripts allow-modals';
+ iframe.sandbox = 'allow-scripts allow-modals allow-top-navigation allow-same-origin allow-popups';
iframe.srcdoc = `
@@ -1091,7 +1091,7 @@ async function init() {
try {
const user = await API.getMe();
currentUser = user;
- API.logEvent('login').catch(() => {});
+
} catch (e) {
token = null;
localStorage.removeItem('forumlify-token');
@@ -1242,7 +1242,7 @@ async function init() {
});
try {
await API.createPost(title, content, images);
- API.logEvent('create_post').catch(() => {});
+
alert('发布成功!');
switchPage('feed');
renderFeed();
diff --git a/js/auth.js b/js/auth.js
index 7f620c5..86dfbbf 100644
--- a/js/auth.js
+++ b/js/auth.js
@@ -18,7 +18,6 @@ document.getElementById('loginSubmit').addEventListener('click', async () => {
document.getElementById('loginPassword').value = '';
if (result.user) {
currentUser = result.user;
- API.logEvent('login').catch(() => {});
renderNav();
if (currentPage === 'admin' && currentUser.role !== 'admin') {
switchPage('feed');
@@ -42,13 +41,14 @@ document.getElementById('registerSubmit').addEventListener('click', async () =>
const username = document.getElementById('regUsername').value.trim();
const email = document.getElementById('regEmail').value.trim();
const password = document.getElementById('regPassword').value;
+ const bootstrapToken = document.getElementById('regBootstrapToken').value.trim();
const captchaInput = document.getElementById('regCaptchaInput').value.trim();
const captchaAnswer = parseInt(document.getElementById('regCaptchaInput').dataset.answer);
if (!username || !email || !password) { alert('请填写完整信息'); return; }
if (password.length < 6) { alert('密码至少6位'); return; }
if (parseInt(captchaInput) !== captchaAnswer) { alert('验证码错误,请重新计算'); refreshCaptcha('reg'); return; }
try {
- await API.register(email, password, username);
+ await API.register(email, password, username, bootstrapToken);
} catch (err) {
alert('注册失败:' + err.message);
return;
@@ -58,12 +58,12 @@ document.getElementById('registerSubmit').addEventListener('click', async () =>
document.getElementById('regUsername').value = '';
document.getElementById('regEmail').value = '';
document.getElementById('regPassword').value = '';
+ document.getElementById('regBootstrapToken').value = '';
document.getElementById('regCaptchaInput').value = '';
try {
await API.login(email, password);
currentUser = await API.getMe();
- API.logEvent('register').catch(() => {});
renderNav();
if (currentPage === 'admin' && currentUser.role !== 'admin') {
diff --git a/js/post.js b/js/post.js
index 61725e0..95a0fad 100644
--- a/js/post.js
+++ b/js/post.js
@@ -228,7 +228,7 @@ async function handleReplySubmit(postId) {
if (parseInt(captchaInput) !== captchaAnswer) { alert('验证码错误,请重新计算'); refreshCaptcha('reply'); return; }
try {
await API.createReply(postId, content);
- API.logEvent('create_reply').catch(() => {});
+
renderPostDetail(postId);
if (currentPage === 'feed') {
renderFeed();
diff --git a/package-lock.json b/package-lock.json
index 0ed74ce..dab9d34 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,41 +8,41 @@
"name": "forumlify",
"version": "1.0.0",
"dependencies": {
- "bcrypt": "^5.1.1",
+ "bcryptjs": "3.0.3",
"cors": "^2.8.5",
"express": "^4.18.2",
- "express-rate-limit": "8.1.0",
+ "express-rate-limit": "8.6.2",
"helmet": "8.1.0",
"jsonwebtoken": "^9.0.2",
- "multer": "^1.4.5-lts.1",
+ "multer": "2.2.0",
"pg": "^8.11.3"
- }
- },
- "node_modules/@mapbox/node-pre-gyp": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
- "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==",
- "license": "BSD-3-Clause",
- "dependencies": {
- "detect-libc": "^2.0.0",
- "https-proxy-agent": "^5.0.0",
- "make-dir": "^3.1.0",
- "node-fetch": "^2.6.7",
- "nopt": "^5.0.0",
- "npmlog": "^5.0.1",
- "rimraf": "^3.0.2",
- "semver": "^7.3.5",
- "tar": "^6.1.11"
},
- "bin": {
- "node-pre-gyp": "bin/node-pre-gyp"
+ "devDependencies": {
+ "supertest": "7.2.2"
}
},
- "node_modules/abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "license": "ISC"
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@paralleldrive/cuid2": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz",
+ "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "^1.1.5"
+ }
},
"node_modules/accepts": {
"version": "1.3.8",
@@ -57,114 +57,39 @@
"node": ">= 0.6"
}
},
- "node_modules/agent-base": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
- "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
- "license": "MIT",
- "dependencies": {
- "debug": "4"
- },
- "engines": {
- "node": ">= 6.0.0"
- }
- },
- "node_modules/agent-base/node_modules/debug": {
- "version": "4.4.3",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
- "license": "MIT",
- "dependencies": {
- "ms": "^2.1.3"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/agent-base/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "license": "MIT"
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/append-field": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
"integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==",
"license": "MIT"
},
- "node_modules/aproba": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz",
- "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==",
- "license": "ISC"
- },
- "node_modules/are-we-there-yet": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
- "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
- "deprecated": "This package is no longer supported.",
- "license": "ISC",
- "dependencies": {
- "delegates": "^1.0.0",
- "readable-stream": "^3.6.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/are-we-there-yet/node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "license": "MIT",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
"license": "MIT"
},
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "node_modules/asap": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
+ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
+ "dev": true,
"license": "MIT"
},
- "node_modules/bcrypt": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz",
- "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==",
- "hasInstallScript": true,
- "license": "MIT",
- "dependencies": {
- "@mapbox/node-pre-gyp": "^1.0.11",
- "node-addon-api": "^5.0.0"
- },
- "engines": {
- "node": ">= 10.0.0"
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/bcryptjs": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz",
+ "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==",
+ "license": "BSD-3-Clause",
+ "bin": {
+ "bcrypt": "bin/bcrypt"
}
},
"node_modules/body-parser": {
@@ -191,16 +116,6 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
- "node_modules/brace-expansion": {
- "version": "1.1.18",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
- "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
"node_modules/buffer-equal-constant-time": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
@@ -262,51 +177,44 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/chownr": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
- "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
- "license": "ISC",
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
"engines": {
- "node": ">=10"
+ "node": ">= 0.8"
}
},
- "node_modules/color-support": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
- "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
- "license": "ISC",
- "bin": {
- "color-support": "bin.js"
+ "node_modules/component-emitter": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz",
+ "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "license": "MIT"
- },
"node_modules/concat-stream": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
- "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
+ "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
"engines": [
- "node >= 0.8"
+ "node >= 6.0"
],
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
- "readable-stream": "^2.2.2",
+ "readable-stream": "^3.0.2",
"typedarray": "^0.0.6"
}
},
- "node_modules/console-control-strings": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
- "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
- "license": "ISC"
- },
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -343,10 +251,11 @@
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
"license": "MIT"
},
- "node_modules/core-util-is": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
- "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
+ "node_modules/cookiejar": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
+ "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==",
+ "dev": true,
"license": "MIT"
},
"node_modules/cors": {
@@ -375,11 +284,15 @@
"ms": "2.0.0"
}
},
- "node_modules/delegates": {
+ "node_modules/delayed-stream": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
- "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
- "license": "MIT"
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
},
"node_modules/depd": {
"version": "2.0.0",
@@ -400,13 +313,15 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
- "node_modules/detect-libc": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
- "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=8"
+ "node_modules/dezalgo": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz",
+ "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "asap": "^2.0.0",
+ "wrappy": "1"
}
},
"node_modules/dunder-proto": {
@@ -438,12 +353,6 @@
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
"license": "MIT"
},
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "license": "MIT"
- },
"node_modules/encodeurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
@@ -483,6 +392,22 @@
"node": ">= 0.4"
}
},
+ "node_modules/es-set-tostringtag": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.6",
+ "has-tostringtag": "^1.0.2",
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -545,12 +470,13 @@
}
},
"node_modules/express-rate-limit": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.1.0.tgz",
- "integrity": "sha512-4nLnATuKupnmwqiJc27b4dCFmB/T60ExgmtDD7waf4LdrbJ8CPZzZRHYErDYNhoz+ql8fUdYwM/opf90PoPAQA==",
+ "version": "8.6.2",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.6.2.tgz",
+ "integrity": "sha512-YH4ru+eOJxQABscKFfRCy9R7x9QFGdezclVMwwgFFndzS2Xnm0uo6B0ABZsLhcpeptGv2qvuJVWlQr9gQZoC3A==",
"license": "MIT",
"dependencies": {
- "ip-address": "10.0.1"
+ "debug": "^4.4.3",
+ "ip-address": "^10.2.0"
},
"engines": {
"node": ">= 16"
@@ -562,6 +488,36 @@
"express": ">= 4.11"
}
},
+ "node_modules/express-rate-limit/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/express-rate-limit/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/fast-safe-stringify": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
+ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/finalhandler": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
@@ -580,6 +536,41 @@
"node": ">= 0.8"
}
},
+ "node_modules/form-data": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz",
+ "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.4",
+ "mime-types": "^2.1.35"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/formidable": {
+ "version": "3.5.4",
+ "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz",
+ "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@paralleldrive/cuid2": "^2.2.2",
+ "dezalgo": "^1.0.4",
+ "once": "^1.4.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "funding": {
+ "url": "https://ko-fi.com/tunnckoCore/commissions"
+ }
+ },
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -598,36 +589,6 @@
"node": ">= 0.6"
}
},
- "node_modules/fs-minipass": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
- "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
- "license": "ISC",
- "dependencies": {
- "minipass": "^3.0.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/fs-minipass/node_modules/minipass": {
- "version": "3.3.6",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
- "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
- "license": "ISC",
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "license": "ISC"
- },
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -637,27 +598,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/gauge": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
- "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
- "deprecated": "This package is no longer supported.",
- "license": "ISC",
- "dependencies": {
- "aproba": "^1.0.3 || ^2.0.0",
- "color-support": "^1.1.2",
- "console-control-strings": "^1.0.0",
- "has-unicode": "^2.0.1",
- "object-assign": "^4.1.1",
- "signal-exit": "^3.0.0",
- "string-width": "^4.2.3",
- "strip-ansi": "^6.0.1",
- "wide-align": "^1.1.2"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -695,27 +635,6 @@
"node": ">= 0.4"
}
},
- "node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
- "license": "ISC",
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@@ -740,11 +659,21 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/has-unicode": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
- "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
- "license": "ISC"
+ "node_modules/has-tostringtag": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/hasown": {
"version": "2.0.4",
@@ -787,42 +716,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/https-proxy-agent": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
- "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
- "license": "MIT",
- "dependencies": {
- "agent-base": "6",
- "debug": "4"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/https-proxy-agent/node_modules/debug": {
- "version": "4.4.3",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
- "license": "MIT",
- "dependencies": {
- "ms": "^2.1.3"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/https-proxy-agent/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "license": "MIT"
- },
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -835,17 +728,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "license": "ISC",
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@@ -853,9 +735,9 @@
"license": "ISC"
},
"node_modules/ip-address": {
- "version": "10.0.1",
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",
- "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==",
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.5.0.tgz",
+ "integrity": "sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g==",
"license": "MIT",
"engines": {
"node": ">= 12"
@@ -870,21 +752,6 @@
"node": ">= 0.10"
}
},
- "node_modules/is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
- "license": "MIT"
- },
"node_modules/jsonwebtoken": {
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz",
@@ -976,30 +843,6 @@
"integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
"license": "MIT"
},
- "node_modules/make-dir": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
- "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
- "license": "MIT",
- "dependencies": {
- "semver": "^6.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/make-dir/node_modules/semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- }
- },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -1069,73 +912,6 @@
"node": ">= 0.6"
}
},
- "node_modules/minimatch": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
- "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
- "license": "ISC",
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/minimist": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
- "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/minipass": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
- "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
- "license": "ISC",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/minizlib": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
- "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
- "license": "MIT",
- "dependencies": {
- "minipass": "^3.0.0",
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/minizlib/node_modules/minipass": {
- "version": "3.3.6",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
- "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
- "license": "ISC",
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/mkdirp": {
- "version": "0.5.6",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
- "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
- "license": "MIT",
- "dependencies": {
- "minimist": "^1.2.6"
- },
- "bin": {
- "mkdirp": "bin/cmd.js"
- }
- },
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -1143,22 +919,22 @@
"license": "MIT"
},
"node_modules/multer": {
- "version": "1.4.5-lts.2",
- "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz",
- "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==",
- "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz",
+ "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==",
"license": "MIT",
"dependencies": {
"append-field": "^1.0.0",
- "busboy": "^1.0.0",
- "concat-stream": "^1.5.2",
- "mkdirp": "^0.5.4",
- "object-assign": "^4.1.1",
- "type-is": "^1.6.4",
- "xtend": "^4.0.0"
+ "busboy": "^1.6.0",
+ "concat-stream": "^2.0.0",
+ "type-is": "^1.6.18"
},
"engines": {
- "node": ">= 6.0.0"
+ "node": ">= 10.16.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
}
},
"node_modules/negotiator": {
@@ -1170,60 +946,6 @@
"node": ">= 0.6"
}
},
- "node_modules/node-addon-api": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz",
- "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==",
- "license": "MIT"
- },
- "node_modules/node-fetch": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
- "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
- "license": "MIT",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- }
- },
- "node_modules/nopt": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
- "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
- "license": "ISC",
- "dependencies": {
- "abbrev": "1"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/npmlog": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
- "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
- "deprecated": "This package is no longer supported.",
- "license": "ISC",
- "dependencies": {
- "are-we-there-yet": "^2.0.0",
- "console-control-strings": "^1.1.0",
- "gauge": "^3.0.0",
- "set-blocking": "^2.0.0"
- }
- },
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -1261,6 +983,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
@@ -1275,15 +998,6 @@
"node": ">= 0.8"
}
},
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/path-to-regexp": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
@@ -1418,12 +1132,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
- "license": "MIT"
- },
"node_modules/proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
@@ -1478,40 +1186,17 @@
}
},
"node_modules/readable-stream": {
- "version": "2.3.8",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
- "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"license": "MIT",
"dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "node_modules/readable-stream/node_modules/safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "license": "MIT"
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "license": "ISC",
- "dependencies": {
- "glob": "^7.1.3"
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
},
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
+ "engines": {
+ "node": ">= 6"
}
},
"node_modules/safe-buffer": {
@@ -1597,12 +1282,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/set-blocking": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
- "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
- "license": "ISC"
- },
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
@@ -1681,12 +1360,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/signal-exit": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
- "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
- "license": "ISC"
- },
"node_modules/split2": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
@@ -1714,74 +1387,96 @@
}
},
"node_modules/string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"license": "MIT",
"dependencies": {
- "safe-buffer": "~5.1.0"
+ "safe-buffer": "~5.2.0"
}
},
- "node_modules/string_decoder/node_modules/safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "license": "MIT"
- },
- "node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "node_modules/superagent": {
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.3.0.tgz",
+ "integrity": "sha512-B+4Ik7ROgVKrQsXTV0Jwp2u+PXYLSlqtDAhYnkkD+zn3yg8s/zjA2MeGayPoY/KICrbitwneDHrjSotxKL+0XQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
+ "component-emitter": "^1.3.1",
+ "cookiejar": "^2.1.4",
+ "debug": "^4.3.7",
+ "fast-safe-stringify": "^2.1.1",
+ "form-data": "^4.0.5",
+ "formidable": "^3.5.4",
+ "methods": "^1.1.2",
+ "mime": "2.6.0",
+ "qs": "^6.14.1"
},
"engines": {
- "node": ">=8"
+ "node": ">=14.18.0"
}
},
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "node_modules/superagent/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "ansi-regex": "^5.0.1"
+ "ms": "^2.1.3"
},
"engines": {
- "node": ">=8"
- }
- },
- "node_modules/tar": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
- "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
- "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
- "license": "ISC",
- "dependencies": {
- "chownr": "^2.0.0",
- "fs-minipass": "^2.0.0",
- "minipass": "^5.0.0",
- "minizlib": "^2.1.1",
- "mkdirp": "^1.0.3",
- "yallist": "^4.0.0"
+ "node": ">=6.0"
},
- "engines": {
- "node": ">=10"
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "node_modules/tar/node_modules/mkdirp": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
- "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "node_modules/superagent/node_modules/mime": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
+ "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
+ "dev": true,
"license": "MIT",
"bin": {
- "mkdirp": "bin/cmd.js"
+ "mime": "cli.js"
},
"engines": {
- "node": ">=10"
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/superagent/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/supertest": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.2.2.tgz",
+ "integrity": "sha512-oK8WG9diS3DlhdUkcFn4tkNIiIbBx9lI2ClF8K+b2/m8Eyv47LSawxUzZQSNKUrVb2KsqeTDCcjAAVPYaSLVTA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cookie-signature": "^1.2.2",
+ "methods": "^1.1.2",
+ "superagent": "^10.3.0"
+ },
+ "engines": {
+ "node": ">=14.18.0"
+ }
+ },
+ "node_modules/supertest/node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.6.0"
}
},
"node_modules/toidentifier": {
@@ -1793,12 +1488,6 @@
"node": ">=0.6"
}
},
- "node_modules/tr46": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
- "license": "MIT"
- },
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -1851,35 +1540,11 @@
"node": ">= 0.8"
}
},
- "node_modules/webidl-conversions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
- "license": "BSD-2-Clause"
- },
- "node_modules/whatwg-url": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "license": "MIT",
- "dependencies": {
- "tr46": "~0.0.3",
- "webidl-conversions": "^3.0.0"
- }
- },
- "node_modules/wide-align": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
- "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
- "license": "ISC",
- "dependencies": {
- "string-width": "^1.0.2 || 2 || 3 || 4"
- }
- },
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true,
"license": "ISC"
},
"node_modules/xtend": {
@@ -1890,12 +1555,6 @@
"engines": {
"node": ">=0.4"
}
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
- "license": "ISC"
}
}
}
diff --git a/package.json b/package.json
index d44730c..ada1551 100644
--- a/package.json
+++ b/package.json
@@ -3,18 +3,26 @@
"version": "1.0.0",
"description": "Forumlify - 简洁优雅的现代社区系统",
"main": "server.js",
+ "engines": {
+ "node": ">=20"
+ },
"scripts": {
"start": "node server.js",
- "dev": "node server.js"
+ "dev": "node server.js",
+ "check": "node scripts/check-syntax.js",
+ "test": "node --test"
},
"dependencies": {
- "bcrypt": "^5.1.1",
+ "bcryptjs": "3.0.3",
"cors": "^2.8.5",
"express": "^4.18.2",
- "express-rate-limit": "8.1.0",
+ "express-rate-limit": "8.6.2",
"helmet": "8.1.0",
"jsonwebtoken": "^9.0.2",
- "multer": "^1.4.5-lts.1",
+ "multer": "2.2.0",
"pg": "^8.11.3"
+ },
+ "devDependencies": {
+ "supertest": "7.2.2"
}
}
diff --git a/schema.sql b/schema.sql
index a90b6b0..bb4a239 100644
--- a/schema.sql
+++ b/schema.sql
@@ -89,9 +89,20 @@ CREATE TABLE IF NOT EXISTS event_logs (
user_id UUID REFERENCES users(id) ON DELETE SET NULL,
action VARCHAR(50) NOT NULL,
ip VARCHAR(45),
+ method VARCHAR(10),
+ path TEXT,
+ user_agent TEXT,
+ metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT now()
);
+ALTER TABLE event_logs ADD COLUMN IF NOT EXISTS method VARCHAR(10);
+ALTER TABLE event_logs ADD COLUMN IF NOT EXISTS path TEXT;
+ALTER TABLE event_logs ADD COLUMN IF NOT EXISTS user_agent TEXT;
+ALTER TABLE event_logs ADD COLUMN IF NOT EXISTS metadata JSONB NOT NULL DEFAULT '{}'::jsonb;
+CREATE INDEX IF NOT EXISTS idx_event_logs_created_at ON event_logs(created_at DESC);
+CREATE INDEX IF NOT EXISTS idx_event_logs_user_id ON event_logs(user_id);
+
-- ============================================================
-- 论坛设置表
-- ============================================================
@@ -115,6 +126,7 @@ CREATE TABLE IF NOT EXISTS conversations (
user2_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
last_message_at TIMESTAMPTZ DEFAULT now(),
created_at TIMESTAMPTZ DEFAULT now(),
+ CHECK (user1_id < user2_id),
UNIQUE(user1_id, user2_id)
);
@@ -205,6 +217,69 @@ CREATE INDEX IF NOT EXISTS idx_posts_is_pinned ON posts(is_pinned);
ALTER TABLE users ADD COLUMN IF NOT EXISTS signature TEXT DEFAULT '';
+-- Canonicalize conversation pairs and merge any pre-existing reverse/duplicate
+-- conversations before enforcing one row per unordered user pair.
+ALTER TABLE conversations DROP CONSTRAINT IF EXISTS conversations_user1_id_user2_id_key;
+ALTER TABLE conversations DROP CONSTRAINT IF EXISTS conversations_canonical_pair;
+
+WITH ranked AS (
+ SELECT
+ id,
+ FIRST_VALUE(id) OVER (
+ PARTITION BY LEAST(user1_id, user2_id), GREATEST(user1_id, user2_id)
+ ORDER BY created_at, id
+ ) AS keep_id
+ FROM conversations
+)
+UPDATE messages AS m
+SET conversation_id = ranked.keep_id
+FROM ranked
+WHERE m.conversation_id = ranked.id
+ AND ranked.id <> ranked.keep_id;
+
+WITH ranked AS (
+ SELECT
+ id,
+ ROW_NUMBER() OVER (
+ PARTITION BY LEAST(user1_id, user2_id), GREATEST(user1_id, user2_id)
+ ORDER BY created_at, id
+ ) AS row_number
+ FROM conversations
+)
+DELETE FROM conversations AS c
+USING ranked
+WHERE c.id = ranked.id AND ranked.row_number > 1;
+
+UPDATE conversations
+SET user1_id = LEAST(user1_id, user2_id),
+ user2_id = GREATEST(user1_id, user2_id);
+
+ALTER TABLE conversations
+ ADD CONSTRAINT conversations_canonical_pair CHECK (user1_id < user2_id);
+ALTER TABLE conversations
+ ADD CONSTRAINT conversations_user1_id_user2_id_key UNIQUE (user1_id, user2_id);
+
+-- Keep one pending report per reporter/post at the database layer. Historical
+-- duplicates are rejected before creating the partial unique index.
+WITH duplicates AS (
+ SELECT id, ROW_NUMBER() OVER (
+ PARTITION BY post_id, reporter_id
+ ORDER BY created_at, id
+ ) AS row_number
+ FROM reports
+ WHERE status = 'pending' AND post_id IS NOT NULL
+)
+UPDATE reports AS r
+SET status = 'rejected',
+ handled_at = COALESCE(r.handled_at, NOW()),
+ handler_note = COALESCE(r.handler_note, '重复举报已自动合并')
+FROM duplicates
+WHERE r.id = duplicates.id AND duplicates.row_number > 1;
+
+CREATE UNIQUE INDEX IF NOT EXISTS idx_reports_unique_pending
+ ON reports(post_id, reporter_id)
+ WHERE status = 'pending' AND post_id IS NOT NULL;
+
-- ============================================================
-- 论坛默认设置
-- ============================================================
diff --git a/scripts/check-syntax.js b/scripts/check-syntax.js
new file mode 100644
index 0000000..362d5f7
--- /dev/null
+++ b/scripts/check-syntax.js
@@ -0,0 +1,12 @@
+const { execFileSync } = require('node:child_process');
+const path = require('node:path');
+
+const files = execFileSync('git', ['ls-files', '*.js'], { encoding: 'utf8' })
+ .split(/\r?\n/)
+ .filter(Boolean);
+
+for (const file of files) {
+ execFileSync(process.execPath, ['--check', path.resolve(file)], { stdio: 'inherit' });
+}
+
+console.log(`Syntax check passed for ${files.length} JavaScript files.`);
diff --git a/server.js b/server.js
index 366625a..0e067bd 100644
--- a/server.js
+++ b/server.js
@@ -7,12 +7,13 @@ const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
const { rateLimit } = require('express-rate-limit');
-const bcrypt = require('bcrypt');
+const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const { Pool } = require('pg');
const multer = require('multer');
const path = require('path');
const fs = require('fs');
+const crypto = require('crypto');
const app = express();
@@ -81,6 +82,7 @@ app.use(['/api/auth/login', '/api/auth/register', '/api/auth/reset-password'], a
app.use(express.json({ limit: '100kb' }));
app.use(express.urlencoded({ extended: true, limit: '100kb' }));
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
@@ -155,6 +157,69 @@ function validateUuidId(req, res, next) {
return next();
}
+const AUDIT_ACTIONS = new Map([
+ ['POST /api/auth/register', 'register'],
+ ['POST /api/auth/login', 'login'],
+ ['PUT /api/settings', 'update_settings'],
+ ['PUT /api/users/:id/role', 'update_user_role'],
+ ['PUT /api/users/:id', 'update_profile'],
+ ['PUT /api/users/:id/avatar', 'update_avatar'],
+ ['PUT /api/users/:id/password', 'change_password'],
+ ['PUT /api/users/:id/email', 'change_email'],
+ ['POST /api/posts', 'create_post'],
+ ['PUT /api/posts/:id', 'update_post'],
+ ['DELETE /api/posts/:id', 'delete_post'],
+ ['PUT /api/posts/:id/pin', 'toggle_post_pin'],
+ ['POST /api/posts/:id/replies', 'create_reply'],
+ ['DELETE /api/replies/:id', 'delete_reply'],
+ ['POST /api/reports', 'create_report'],
+ ['PUT /api/reports/:id', 'handle_report'],
+ ['POST /api/links', 'create_link'],
+ ['DELETE /api/links/:id', 'delete_link'],
+ ['POST /api/upload', 'upload_image'],
+ ['POST /api/admin/custom-css', 'upload_custom_css'],
+ ['DELETE /api/admin/custom-css', 'delete_custom_css'],
+ ['POST /api/conversations', 'create_conversation'],
+ ['POST /api/conversations/:id/messages', 'send_message'],
+ ['POST /api/admin/custom-pages', 'create_custom_page'],
+ ['PUT /api/admin/custom-pages/:id', 'update_custom_page'],
+ ['DELETE /api/admin/custom-pages/:id', 'delete_custom_page'],
+ ['POST /api/auth/recovery-codes/generate', 'rotate_recovery_codes'],
+ ['POST /api/auth/reset-password', 'reset_password'],
+]);
+
+function auditMetadata(req) {
+ const metadata = {};
+ for (const [key, value] of Object.entries(req.params || {})) {
+ if (typeof value === 'string' && value.length <= 100) metadata[key] = value;
+ }
+ for (const key of ['post_id', 'other_user_id', 'role', 'status']) {
+ const value = req.body?.[key];
+ if (typeof value === 'string' && value.length <= 100) metadata[key] = value;
+ }
+ return { ...metadata, ...(req.auditMetadata || {}) };
+}
+
+app.use((req, res, next) => {
+ res.on('finish', () => {
+ if (res.statusCode < 200 || res.statusCode >= 300 || !req.route?.path) return;
+ const routePath = Array.isArray(req.route.path) ? req.route.path[0] : req.route.path;
+ const action = AUDIT_ACTIONS.get(`${req.method} ${routePath}`);
+ if (!action) return;
+
+ const userId = req.auditUserId || req.user?.id || null;
+ const ip = String(req.ip || req.socket?.remoteAddress || '').slice(0, 45);
+ const userAgent = String(req.get('user-agent') || '').slice(0, 1000);
+ pool.query(
+ `INSERT INTO event_logs (user_id, action, ip, method, path, user_agent, metadata)
+ VALUES ($1, $2, $3, $4, $5, $6, $7::jsonb)`,
+ [userId, action, ip, req.method, req.originalUrl.slice(0, 2000), userAgent, JSON.stringify(auditMetadata(req))]
+ ).catch(error => console.error('Failed to write audit log:', error));
+ });
+ next();
+});
+
+
// 确保上传目录存在
if (!fs.existsSync('uploads')) fs.mkdirSync('uploads');
app.use('/uploads', express.static(path.join(__dirname, 'uploads'), {
@@ -244,9 +309,21 @@ app.put('/api/settings', auth, admin, async (req, res) => {
// 认证接口
// ============================================================
-// 注册 - 第一个用户自动成为管理员
+function secureTokenMatch(provided, expected) {
+ if (!provided || !expected) return false;
+ const providedBuffer = Buffer.from(String(provided));
+ const expectedBuffer = Buffer.from(String(expected));
+ return providedBuffer.length === expectedBuffer.length &&
+ crypto.timingSafeEqual(providedBuffer, expectedBuffer);
+}
+
+// 注册;管理员只能使用部署时配置的一次性引导令牌创建
app.post('/api/auth/register', async (req, res) => {
- const { email, password, username } = req.body;
+ const { email, password, username, bootstrap_token } = req.body;
+
+ if (!email || !password || !username) {
+ return res.status(400).json({ error: '请填写完整信息' });
+ }
const normalizedEmail = normalizeEmail(email);
@@ -257,31 +334,52 @@ app.post('/api/auth/register', async (req, res) => {
return res.status(400).json({ error: '密码长度应为6到128个字符' });
}
+ const hash = await bcrypt.hash(password, 10);
+ const avatar = 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username) + '&background=6366f1&color=fff&size=64';
+ let client;
try {
- const countResult = await pool.query('SELECT COUNT(*) FROM users');
- const isFirstUser = parseInt(countResult.rows[0].count) === 0;
+ client = await pool.connect();
+ await client.query('BEGIN');
+ await client.query("SELECT pg_advisory_xact_lock(hashtext('forumlify-admin-bootstrap'))");
+ const adminResult = await client.query("SELECT EXISTS(SELECT 1 FROM users WHERE role = 'admin') AS exists");
+ const hasAdmin = adminResult.rows[0].exists;
+ const requestedBootstrap = Boolean(bootstrap_token);
+ const validBootstrap = secureTokenMatch(bootstrap_token, process.env.ADMIN_BOOTSTRAP_TOKEN);
- const hash = await bcrypt.hash(password, 10);
- const avatar = 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username) + '&background=6366f1&color=fff&size=64';
- const role = isFirstUser ? 'admin' : 'user';
+ if (requestedBootstrap && !validBootstrap) {
+ await client.query('ROLLBACK');
+ return res.status(403).json({ error: '管理员初始化令牌无效' });
+ }
+ if (validBootstrap && hasAdmin) {
+ await client.query('ROLLBACK');
+ return res.status(409).json({ error: '管理员已初始化' });
+ }
- const r = await pool.query(
+ const role = validBootstrap && !hasAdmin ? 'admin' : 'user';
+ const r = await client.query(
`INSERT INTO users (email, password_hash, username, avatar_url, role, signature)
VALUES ($1, $2, $3, $4, $5, $6)
RETURNING id, username, avatar_url, role, signature, created_at`,
[normalizedEmail, hash, username.trim(), avatar, role, '']
);
+ await client.query('COMMIT');
+
+ req.auditUserId = r.rows[0].id;
+ req.auditMetadata = { role: r.rows[0].role };
res.json({
user: r.rows[0],
- message: isFirstUser ? '🎉 你是第一个用户,已自动设为管理员!' : '注册成功'
+ message: role === 'admin' ? '管理员初始化成功' : '注册成功'
});
} catch (err) {
+ if (client) await client.query('ROLLBACK').catch(() => {});
if (err.code === '23505') {
res.status(400).json({ error: '邮箱或用户名已被注册' });
} else {
res.status(500).json({ error: '注册失败,请稍后重试' });
}
+ } finally {
+ if (client) client.release();
}
});
@@ -305,6 +403,8 @@ app.post('/api/auth/login', async (req, res) => {
return res.status(401).json({ error: '邮箱或密码错误' });
}
+ req.auditUserId = user.id;
+
const token = jwt.sign(
{ id: user.id, email: user.email, role: user.role },
JWT_SECRET,
@@ -872,14 +972,6 @@ app.post('/api/reports', auth, async (req, res) => {
}
try {
- const existing = await pool.query(
- 'SELECT id FROM reports WHERE post_id = $1 AND reporter_id = $2 AND status = $3',
- [post_id, req.user.id, 'pending']
- );
- if (existing.rows.length > 0) {
- return res.status(400).json({ error: '你已经举报过此帖子,请等待处理' });
- }
-
await pool.query(
`INSERT INTO reports (post_id, reporter_id, reason)
VALUES ($1, $2, $3)`,
@@ -887,6 +979,9 @@ app.post('/api/reports', auth, async (req, res) => {
);
res.json({ success: true });
} catch (err) {
+ if (err.code === '23505') {
+ return res.status(409).json({ error: '你已经举报过此帖子,请等待处理' });
+ }
res.status(500).json({ error: '举报失败,请稍后重试' });
}
});
@@ -1060,23 +1155,7 @@ app.get('/api/event-logs', auth, admin, async (req, res) => {
}
});
-// 记录事件
-app.post('/api/event-logs', auth, async (req, res) => {
- const { action } = req.body;
- if (!isText(action, { min: 1, max: 50 })) {
- return res.status(400).json({ error: '操作类型无效' });
- }
- try {
- await pool.query(
- `INSERT INTO event_logs (user_id, action, ip)
- VALUES ($1, $2, $3)`,
- [req.user.id, action.trim(), req.ip || '0.0.0.0']
- );
- res.json({ success: true });
- } catch (err) {
- res.json({ success: true });
- }
-});
+
// ============================================================
// 图片上传
@@ -1208,7 +1287,7 @@ app.post('/api/conversations', auth, async (req, res) => {
if (!UUID_PATTERN.test(other_user_id || '')) {
return res.status(400).json({ error: '对方用户ID无效' });
}
- if (other_user_id === req.user.id) {
+ if (String(other_user_id).toLowerCase() === String(req.user.id).toLowerCase()) {
return res.status(400).json({ error: '不能与自己私信' });
}
@@ -1218,18 +1297,11 @@ app.post('/api/conversations', auth, async (req, res) => {
return res.status(404).json({ error: '用户不存在' });
}
- const existing = await pool.query(`
- SELECT id FROM conversations
- WHERE (user1_id = $1 AND user2_id = $2) OR (user1_id = $2 AND user2_id = $1)
- `, [req.user.id, other_user_id]);
-
- if (existing.rows.length > 0) {
- return res.json({ id: existing.rows[0].id });
- }
-
const r = await pool.query(`
INSERT INTO conversations (user1_id, user2_id)
- VALUES ($1, $2)
+ SELECT LEAST($1::uuid, $2::uuid), GREATEST($1::uuid, $2::uuid)
+ ON CONFLICT (user1_id, user2_id)
+ DO UPDATE SET user1_id = EXCLUDED.user1_id
RETURNING id
`, [req.user.id, other_user_id]);
@@ -1635,10 +1707,14 @@ app.use((err, req, res, next) => {
// 启动服务器
// ============================================================
-app.listen(PORT, '0.0.0.0', () => {
- console.log('========================================');
- console.log(' 🌊 Forumlify 已启动');
- console.log(' 📡 http://localhost:' + PORT);
- console.log(' 📡 API: http://localhost:' + PORT + '/api');
- console.log('========================================');
-});
+if (require.main === module) {
+ app.listen(PORT, '0.0.0.0', () => {
+ console.log('========================================');
+ console.log(' 🌊 Forumlify 已启动');
+ console.log(' 📡 http://localhost:' + PORT);
+ console.log(' 📡 API: http://localhost:' + PORT + '/api');
+ console.log('========================================');
+ });
+}
+
+module.exports = { app, pool };
diff --git a/style.css b/style.css
index d4b40b7..6bf8b5a 100644
--- a/style.css
+++ b/style.css
@@ -2522,8 +2522,42 @@ a.btn-secondary {
-webkit-backdrop-filter: blur(32px) !important;
border: 1px solid var(--glass-border) !important;
}
+
/* ============================================================
- 🌍 国际化加载前隐藏
+ 📄 自定义页面 —— 全屏沉浸式
============================================================ */
+/* ============================================================
+ 📄 自定义页面 —— 全屏沉浸式(位置修正版)
+ ============================================================ */
+
+#customPageContainer {
+ position: fixed !important;
+ top: 64px !important;
+ left: 0 !important;
+ width: 100vw !important;
+ height: calc(100vh - 64px) !important;
+ padding: 0 !important;
+ margin: 0 !important;
+ background: transparent !important;
+ z-index: 40 !important;
+ overflow: hidden !important;
+}
+
+#customPageContainer iframe {
+ display: block !important;
+ width: 100% !important;
+ height: 100% !important;
+ border: none !important;
+ border-radius: 0 !important;
+ background: transparent !important;
+}
+
+/* 移动端适配 */
+@media (max-width: 768px) {
+ #customPageContainer {
+ top: 56px !important;
+ height: calc(100vh - 56px) !important;
+ }
+}
diff --git a/test/app.test.js b/test/app.test.js
new file mode 100644
index 0000000..7af68f4
--- /dev/null
+++ b/test/app.test.js
@@ -0,0 +1,75 @@
+const test = require('node:test');
+const assert = require('node:assert/strict');
+const request = require('supertest');
+const bcrypt = require('bcryptjs');
+const multerPackage = require('multer/package.json');
+const projectPackage = require('../package.json');
+const { app, pool } = require('../server');
+
+test.after(async () => {
+ await pool.end();
+});
+
+test('serves the frontend with hardened response headers', async () => {
+ const response = await request(app).get('/').expect(200);
+ assert.match(response.headers['content-type'], /^text\/html/);
+ assert.equal(response.headers['x-content-type-options'], 'nosniff');
+ assert.equal(response.headers['x-frame-options'], 'SAMEORIGIN');
+ assert.equal(response.headers['x-powered-by'], undefined);
+});
+
+test('does not serve backend source and deployment files', async () => {
+ for (const path of ['/server.js', '/schema.sql', '/package.json', '/docker-compose.yml']) {
+ await request(app).get(path).expect(404);
+ }
+});
+
+test('unknown API route returns JSON 404 instead of hanging', async () => {
+ const response = await request(app)
+ .get('/api/definitely-unknown')
+ .timeout({ response: 1000, deadline: 2000 })
+ .expect(404);
+ assert.deepEqual(response.body, { error: '接口不存在' });
+ assert.ok(response.headers.ratelimit);
+});
+
+test('request body limit returns a structured 413 response', async () => {
+ const response = await request(app)
+ .post('/api/auth/login')
+ .send({ email: 'user@example.test', password: 'x'.repeat(110000) })
+ .expect(413);
+ assert.equal(response.body.error, '请求内容过大');
+});
+
+test('registration and login validate required fields before database access', async () => {
+ let response = await request(app)
+ .post('/api/auth/register')
+ .send({ email: '', password: '', username: '' })
+ .expect(400);
+ assert.equal(response.body.error, '请填写完整信息');
+
+ response = await request(app)
+ .post('/api/auth/login')
+ .send({ email: '', password: '' })
+ .expect(400);
+ assert.equal(response.body.error, '请填写邮箱和密码');
+});
+
+test('protected routes reject unauthenticated requests', async () => {
+ const response = await request(app)
+ .post('/api/posts')
+ .send({ title: 'test', content: 'test' })
+ .expect(401);
+ assert.equal(response.body.error, '请先登录');
+});
+
+test('bcryptjs hashes passwords without native install scripts', async () => {
+ const hash = await bcrypt.hash('correct horse battery staple', 4);
+ assert.equal(await bcrypt.compare('correct horse battery staple', hash), true);
+ assert.equal(await bcrypt.compare('wrong password', hash), false);
+});
+
+test('security-sensitive dependencies are on patched release lines', () => {
+ assert.match(multerPackage.version, /^2\.2\./);
+ assert.equal(projectPackage.dependencies['express-rate-limit'], '8.6.2');
+});