@waline/vercel 1.34.2 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -1,15 +1,15 @@
1
1
  # https://github.com/nodejs/LTS
2
2
  FROM node:lts AS build
3
3
  WORKDIR /app
4
- ENV NODE_ENV production
4
+ ENV NODE_ENV="production"
5
5
  RUN set -eux; \
6
6
  # npm config set registry https://registry.npm.taobao.org; \
7
7
  npm install --production --silent @waline/vercel
8
8
 
9
9
  FROM node:lts-slim
10
10
  WORKDIR /app
11
- ENV TZ Asia/Shanghai
12
- ENV NODE_ENV production
11
+ ENV TZ="Asia/Shanghai"
12
+ ENV NODE_ENV="production"
13
13
  COPY --from=build /app .
14
14
  EXPOSE 8360
15
15
  CMD ["node", "node_modules/@waline/vercel/vanilla.js"]
package/Dockerfile.alpine CHANGED
@@ -1,15 +1,15 @@
1
1
  # https://github.com/nodejs/LTS
2
2
  FROM node:lts AS build
3
3
  WORKDIR /app
4
- ENV NODE_ENV production
4
+ ENV NODE_ENV="production"
5
5
  RUN set -eux; \
6
6
  # npm config set registry https://registry.npm.taobao.org; \
7
7
  npm install --production --silent @waline/vercel
8
8
 
9
9
  FROM node:lts-alpine
10
10
  WORKDIR /app
11
- ENV TZ Asia/Shanghai
12
- ENV NODE_ENV production
11
+ ENV TZ="Asia/Shanghai"
12
+ ENV NODE_ENV="production"
13
13
  RUN set -eux; \
14
14
  # sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories; \
15
15
  apk add --no-cache bash; \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.34.2",
3
+ "version": "1.35.0",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -46,6 +46,7 @@ const {
46
46
  POSTGRES_USER,
47
47
  PG_SSL,
48
48
  POSTGRES_SSL,
49
+ POSTGRES_URL,
49
50
  MONGO_AUTHSOURCE,
50
51
  MONGO_DB,
51
52
  MONGO_HOST,
@@ -83,9 +84,6 @@ if (MONGO_DB) {
83
84
  type = 'tidb';
84
85
  }
85
86
 
86
- const isVercelPostgres =
87
- type === 'postgresql' && POSTGRES_HOST?.endsWith('vercel-storage.com');
88
-
89
87
  exports.model = {
90
88
  type,
91
89
  common: {
@@ -116,11 +114,12 @@ exports.model = {
116
114
  password: PG_PASSWORD || POSTGRES_PASSWORD,
117
115
  database: PG_DB || POSTGRES_DATABASE,
118
116
  host: PG_HOST || POSTGRES_HOST || '127.0.0.1',
119
- port: PG_PORT || POSTGRES_PORT || (isVercelPostgres ? '5432' : '3211'),
117
+ port: PG_PORT || POSTGRES_PORT || '5432',
120
118
  connectionLimit: 1,
121
119
  prefix: PG_PREFIX || POSTGRES_PREFIX || 'wl_',
122
120
  ssl:
123
- (PG_SSL || POSTGRES_SSL) == 'true' || isVercelPostgres
121
+ (PG_SSL || POSTGRES_SSL) == 'true' ||
122
+ POSTGRES_URL?.includes('sslmode=require')
124
123
  ? {
125
124
  rejectUnauthorized: false,
126
125
  }