Upload 16 files
Browse files- .dockerignore +8 -0
- .gitignore +132 -0
- .markdownlint.yaml +9 -0
- .npmrc +3 -0
- .prettierignore +8 -0
- .prettierrc.json +5 -0
- Dockerfile +61 -0
- LICENSE +21 -0
- docker-compose.dev.yml +11 -0
- docker-compose.sqlite.yml +25 -0
- docker-compose.yml +47 -0
- package.json +22 -0
- pnpm-lock.yaml +0 -0
- pnpm-workspace.yaml +2 -0
- release.sh +34 -0
- tsconfig.json +22 -0
.dockerignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules
|
2 |
+
.git
|
3 |
+
.gitignore
|
4 |
+
*.md
|
5 |
+
dist
|
6 |
+
.env
|
7 |
+
.next
|
8 |
+
.DS_Store
|
.gitignore
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Logs
|
2 |
+
logs
|
3 |
+
*.log
|
4 |
+
npm-debug.log*
|
5 |
+
yarn-debug.log*
|
6 |
+
yarn-error.log*
|
7 |
+
lerna-debug.log*
|
8 |
+
.pnpm-debug.log*
|
9 |
+
|
10 |
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
11 |
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
12 |
+
|
13 |
+
# Runtime data
|
14 |
+
pids
|
15 |
+
*.pid
|
16 |
+
*.seed
|
17 |
+
*.pid.lock
|
18 |
+
|
19 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
20 |
+
lib-cov
|
21 |
+
|
22 |
+
# Coverage directory used by tools like istanbul
|
23 |
+
coverage
|
24 |
+
*.lcov
|
25 |
+
|
26 |
+
# nyc test coverage
|
27 |
+
.nyc_output
|
28 |
+
|
29 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
30 |
+
.grunt
|
31 |
+
|
32 |
+
# Bower dependency directory (https://bower.io/)
|
33 |
+
bower_components
|
34 |
+
|
35 |
+
# node-waf configuration
|
36 |
+
.lock-wscript
|
37 |
+
|
38 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
39 |
+
build/Release
|
40 |
+
|
41 |
+
# Dependency directories
|
42 |
+
node_modules/
|
43 |
+
jspm_packages/
|
44 |
+
|
45 |
+
# Snowpack dependency directory (https://snowpack.dev/)
|
46 |
+
web_modules/
|
47 |
+
|
48 |
+
# TypeScript cache
|
49 |
+
*.tsbuildinfo
|
50 |
+
|
51 |
+
# Optional npm cache directory
|
52 |
+
.npm
|
53 |
+
|
54 |
+
# Optional eslint cache
|
55 |
+
.eslintcache
|
56 |
+
|
57 |
+
# Optional stylelint cache
|
58 |
+
.stylelintcache
|
59 |
+
|
60 |
+
# Microbundle cache
|
61 |
+
.rpt2_cache/
|
62 |
+
.rts2_cache_cjs/
|
63 |
+
.rts2_cache_es/
|
64 |
+
.rts2_cache_umd/
|
65 |
+
|
66 |
+
# Optional REPL history
|
67 |
+
.node_repl_history
|
68 |
+
|
69 |
+
# Output of 'npm pack'
|
70 |
+
*.tgz
|
71 |
+
|
72 |
+
# Yarn Integrity file
|
73 |
+
.yarn-integrity
|
74 |
+
|
75 |
+
# dotenv environment variable files
|
76 |
+
.env
|
77 |
+
.env.development.local
|
78 |
+
.env.test.local
|
79 |
+
.env.production.local
|
80 |
+
.env.local
|
81 |
+
|
82 |
+
# parcel-bundler cache (https://parceljs.org/)
|
83 |
+
.cache
|
84 |
+
.parcel-cache
|
85 |
+
|
86 |
+
# Next.js build output
|
87 |
+
.next
|
88 |
+
out
|
89 |
+
|
90 |
+
# Nuxt.js build / generate output
|
91 |
+
.nuxt
|
92 |
+
dist
|
93 |
+
|
94 |
+
# Gatsby files
|
95 |
+
.cache/
|
96 |
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
97 |
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
98 |
+
# public
|
99 |
+
|
100 |
+
# vuepress build output
|
101 |
+
.vuepress/dist
|
102 |
+
|
103 |
+
# vuepress v2.x temp and cache directory
|
104 |
+
.temp
|
105 |
+
.cache
|
106 |
+
|
107 |
+
# Docusaurus cache and generated files
|
108 |
+
.docusaurus
|
109 |
+
|
110 |
+
# Serverless directories
|
111 |
+
.serverless/
|
112 |
+
|
113 |
+
# FuseBox cache
|
114 |
+
.fusebox/
|
115 |
+
|
116 |
+
# DynamoDB Local files
|
117 |
+
.dynamodb/
|
118 |
+
|
119 |
+
# TernJS port file
|
120 |
+
.tern-port
|
121 |
+
|
122 |
+
# Stores VSCode versions used for testing VSCode extensions
|
123 |
+
.vscode-test
|
124 |
+
|
125 |
+
# yarn v2
|
126 |
+
.yarn/cache
|
127 |
+
.yarn/unplugged
|
128 |
+
.yarn/build-state.yml
|
129 |
+
.yarn/install-state.gz
|
130 |
+
.pnp.*
|
131 |
+
|
132 |
+
.DS_Store
|
.markdownlint.yaml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Default state for all rules
|
2 |
+
default: true
|
3 |
+
|
4 |
+
line-length: false
|
5 |
+
|
6 |
+
# MD033/no-inline-html - Inline HTML
|
7 |
+
MD033:
|
8 |
+
# Allowed elements
|
9 |
+
allowed_elements: ["style"]
|
.npmrc
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
public-hoist-pattern[]=*@nextui-org/*
|
2 |
+
engine-strict=true
|
3 |
+
deploy-all-files=true
|
.prettierignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**/*.log
|
2 |
+
**/.DS_Store
|
3 |
+
*.
|
4 |
+
*.json
|
5 |
+
apps/web/.next
|
6 |
+
dist
|
7 |
+
node_modules
|
8 |
+
pnpm-lock.yaml
|
.prettierrc.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"tabWidth": 2,
|
3 |
+
"singleQuote": true,
|
4 |
+
"trailingComma": "all"
|
5 |
+
}
|
Dockerfile
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:20-alpine AS base
|
2 |
+
ENV PNPM_HOME="/pnpm"
|
3 |
+
ENV PATH="$PNPM_HOME:$PATH"
|
4 |
+
|
5 |
+
RUN npm i -g pnpm
|
6 |
+
|
7 |
+
FROM base AS build
|
8 |
+
COPY . /usr/src/app
|
9 |
+
WORKDIR /usr/src/app
|
10 |
+
|
11 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
12 |
+
|
13 |
+
RUN pnpm run -r build
|
14 |
+
|
15 |
+
RUN pnpm deploy --filter=server --prod /app
|
16 |
+
RUN pnpm deploy --filter=server --prod /app-sqlite
|
17 |
+
|
18 |
+
RUN cd /app && pnpm exec prisma generate
|
19 |
+
|
20 |
+
RUN cd /app-sqlite && \
|
21 |
+
rm -rf ./prisma && \
|
22 |
+
mv prisma-sqlite prisma && \
|
23 |
+
pnpm exec prisma generate
|
24 |
+
|
25 |
+
FROM base AS app-sqlite
|
26 |
+
COPY --from=build /app-sqlite /app
|
27 |
+
|
28 |
+
WORKDIR /app
|
29 |
+
|
30 |
+
EXPOSE 4000
|
31 |
+
|
32 |
+
ENV NODE_ENV=production
|
33 |
+
ENV HOST="0.0.0.0"
|
34 |
+
ENV SERVER_ORIGIN_URL=""
|
35 |
+
ENV MAX_REQUEST_PER_MINUTE=60
|
36 |
+
ENV AUTH_CODE=""
|
37 |
+
ENV DATABASE_URL="file:../data/wewe-rss.db"
|
38 |
+
ENV DATABASE_TYPE="sqlite"
|
39 |
+
|
40 |
+
RUN chmod +x ./docker-bootstrap.sh
|
41 |
+
|
42 |
+
CMD ["./docker-bootstrap.sh"]
|
43 |
+
|
44 |
+
|
45 |
+
FROM base AS app
|
46 |
+
COPY --from=build /app /app
|
47 |
+
|
48 |
+
WORKDIR /app
|
49 |
+
|
50 |
+
EXPOSE 4000
|
51 |
+
|
52 |
+
ENV NODE_ENV=production
|
53 |
+
ENV HOST="0.0.0.0"
|
54 |
+
ENV SERVER_ORIGIN_URL=""
|
55 |
+
ENV MAX_REQUEST_PER_MINUTE=60
|
56 |
+
ENV AUTH_CODE=""
|
57 |
+
ENV DATABASE_URL=""
|
58 |
+
|
59 |
+
RUN chmod +x ./docker-bootstrap.sh
|
60 |
+
|
61 |
+
CMD ["./docker-bootstrap.sh"]
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2024 cooderl
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
docker-compose.dev.yml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
services:
|
2 |
+
mysql:
|
3 |
+
image: mysql:latest
|
4 |
+
command: --default-authentication-plugin=mysql_native_password
|
5 |
+
environment:
|
6 |
+
MYSQL_ROOT_PASSWORD: 123456
|
7 |
+
TZ: 'Asia/Shanghai'
|
8 |
+
ports:
|
9 |
+
- 3306:3306
|
10 |
+
volumes:
|
11 |
+
mysql:
|
docker-compose.sqlite.yml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.9'
|
2 |
+
|
3 |
+
services:
|
4 |
+
app:
|
5 |
+
image: cooderl/wewe-rss-sqlite:latest
|
6 |
+
ports:
|
7 |
+
- 4000:4000
|
8 |
+
environment:
|
9 |
+
# 数据库连接地址
|
10 |
+
# - DATABASE_URL=file:../data/wewe-rss.db
|
11 |
+
- DATABASE_TYPE=sqlite
|
12 |
+
# 服务接口请求授权码
|
13 |
+
- AUTH_CODE=123567
|
14 |
+
# 提取全文内容模式
|
15 |
+
# - FEED_MODE=fulltext
|
16 |
+
# 定时更新订阅源Cron表达式
|
17 |
+
# - CRON_EXPRESSION=35 5,17 * * *
|
18 |
+
# 服务接口请求限制,每分钟请求次数
|
19 |
+
# - MAX_REQUEST_PER_MINUTE=60
|
20 |
+
# 外网访问时,需设置为服务器的公网 IP 或者域名地址
|
21 |
+
# - SERVER_ORIGIN_URL=http://localhost:4000
|
22 |
+
|
23 |
+
volumes:
|
24 |
+
# 映射数据库文件存储位置,容器重启后不丢失
|
25 |
+
- ./data:/app/data
|
docker-compose.yml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.9'
|
2 |
+
|
3 |
+
services:
|
4 |
+
db:
|
5 |
+
image: mysql:latest
|
6 |
+
command: --default-authentication-plugin=mysql_native_password
|
7 |
+
environment:
|
8 |
+
# 请修改为自己的密码
|
9 |
+
MYSQL_ROOT_PASSWORD: 123456
|
10 |
+
TZ: 'Asia/Shanghai'
|
11 |
+
MYSQL_DATABASE: 'wewe-rss'
|
12 |
+
# ports:
|
13 |
+
# - 13306:3306
|
14 |
+
volumes:
|
15 |
+
- db_data:/var/lib/mysql
|
16 |
+
healthcheck:
|
17 |
+
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
|
18 |
+
timeout: 45s
|
19 |
+
interval: 10s
|
20 |
+
retries: 10
|
21 |
+
|
22 |
+
app:
|
23 |
+
image: cooderl/wewe-rss:latest
|
24 |
+
ports:
|
25 |
+
- 4000:4000
|
26 |
+
depends_on:
|
27 |
+
db:
|
28 |
+
condition: service_healthy
|
29 |
+
environment:
|
30 |
+
# 数据库连接地址
|
31 |
+
- DATABASE_URL=mysql://root:123456@db:3306/wewe-rss?schema=public&connect_timeout=30&pool_timeout=30&socket_timeout=30
|
32 |
+
# 服务接口请求授权码
|
33 |
+
- AUTH_CODE=123567
|
34 |
+
# 提取全文内容模式
|
35 |
+
# - FEED_MODE=fulltext
|
36 |
+
# 定时更新订阅源Cron表达式
|
37 |
+
# - CRON_EXPRESSION=35 5,17 * * *
|
38 |
+
# 服务接口请求限制,每分钟请求次数
|
39 |
+
# - MAX_REQUEST_PER_MINUTE=60
|
40 |
+
# 外网访问时,需设置为服务器的公网 IP 或者域名地址
|
41 |
+
# - SERVER_ORIGIN_URL=http://localhost:4000
|
42 |
+
|
43 |
+
networks:
|
44 |
+
wewe-rss:
|
45 |
+
|
46 |
+
volumes:
|
47 |
+
db_data:
|
package.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "wewe-rss",
|
3 |
+
"version": "2.2.3",
|
4 |
+
"private": true,
|
5 |
+
"author": "cooderl <[email protected]>",
|
6 |
+
"description": "",
|
7 |
+
"main": "index.js",
|
8 |
+
"engines": {
|
9 |
+
"node": ">=18",
|
10 |
+
"pnpm": ">=8.6.1",
|
11 |
+
"vscode": ">=1.79"
|
12 |
+
},
|
13 |
+
"scripts": {
|
14 |
+
"dev": "pnpm run --parallel dev",
|
15 |
+
"build:server": "pnpm --filter server build",
|
16 |
+
"build:web": "pnpm --filter web build",
|
17 |
+
"start:server": "pnpm --filter server start:prod",
|
18 |
+
"start:web": "pnpm --filter web start",
|
19 |
+
"fmt": "prettier --write .",
|
20 |
+
"fmt.check": "prettier --check ."
|
21 |
+
}
|
22 |
+
}
|
pnpm-lock.yaml
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pnpm-workspace.yaml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
packages:
|
2 |
+
- 'apps/*'
|
release.sh
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# 检查是否提供了版本号
|
4 |
+
if [ "$#" -ne 1 ]; then
|
5 |
+
echo "Usage: $0 <new-version>"
|
6 |
+
exit 1
|
7 |
+
fi
|
8 |
+
|
9 |
+
# 新版本号
|
10 |
+
NEW_VERSION=$1
|
11 |
+
|
12 |
+
# 更新根目录下的 package.json
|
13 |
+
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json
|
14 |
+
|
15 |
+
# 更新 apps 目录下所有子包的 package.json
|
16 |
+
for d in apps/*; do
|
17 |
+
if [ -d "$d" ] && [ -f "$d/package.json" ]; then
|
18 |
+
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" "$d/package.json"
|
19 |
+
fi
|
20 |
+
done
|
21 |
+
|
22 |
+
echo "All packages updated to version $NEW_VERSION"
|
23 |
+
|
24 |
+
# 创建 Git 提交(可选)
|
25 |
+
git add .
|
26 |
+
git commit -m "Release version $NEW_VERSION"
|
27 |
+
|
28 |
+
# 创建 Git 标签
|
29 |
+
git tag "v$NEW_VERSION"
|
30 |
+
|
31 |
+
# 推送更改和标签到远程仓库
|
32 |
+
git push && git push origin --tags
|
33 |
+
|
34 |
+
echo "Git tag v$NEW_VERSION has been created and pushed"
|
tsconfig.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
"baseUrl": ".",
|
4 |
+
"experimentalDecorators": true,
|
5 |
+
"emitDecoratorMetadata": true,
|
6 |
+
"incremental": true,
|
7 |
+
"skipLibCheck": true,
|
8 |
+
"strictNullChecks": true,
|
9 |
+
"noImplicitAny": false,
|
10 |
+
"strictBindCallApply": true,
|
11 |
+
"forceConsistentCasingInFileNames": true,
|
12 |
+
"noFallthroughCasesInSwitch": true,
|
13 |
+
"paths": {
|
14 |
+
"@server/*": [
|
15 |
+
"./apps/server/src/*"
|
16 |
+
],
|
17 |
+
"@web/*": [
|
18 |
+
"./apps/web/src/*"
|
19 |
+
]
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|