@waline/vercel 1.18.8 → 1.18.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.18.8",
3
+ "version": "1.18.9",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -22,16 +22,16 @@
22
22
  "dompurify": "2.3.8",
23
23
  "dy-node-ip2region": "1.0.1",
24
24
  "fast-csv": "4.3.6",
25
- "jsdom": "19.0.0",
25
+ "jsdom": "20.0.0",
26
26
  "jsonwebtoken": "8.5.1",
27
27
  "katex": "0.16.0",
28
- "leancloud-storage": "4.12.2",
28
+ "leancloud-storage": "4.12.3",
29
29
  "markdown-it": "13.0.1",
30
30
  "markdown-it-emoji": "2.0.2",
31
31
  "markdown-it-sub": "1.0.0",
32
32
  "markdown-it-sup": "1.0.0",
33
33
  "mathjax-full": "3.2.2",
34
- "nodemailer": "6.7.5",
34
+ "nodemailer": "6.7.6",
35
35
  "nunjucks": "3.2.3",
36
36
  "phpass": "0.1.1",
37
37
  "prismjs": "1.28.0",
@@ -42,7 +42,7 @@
42
42
  "think-logger3": "1.3.1",
43
43
  "think-model": "1.5.4",
44
44
  "think-model-mysql": "1.1.7",
45
- "think-model-postgresql": "1.1.6",
45
+ "think-model-postgresql": "1.1.7",
46
46
  "think-model-sqlite": "1.2.3",
47
47
  "think-mongo": "2.2.1",
48
48
  "think-router-rest": "1.0.5",
@@ -18,6 +18,7 @@ const {
18
18
  MYSQL_PASSWORD,
19
19
  MYSQL_PREFIX,
20
20
  MYSQL_CHARSET,
21
+ MYSQL_SSL,
21
22
  SQLITE_PATH,
22
23
  SQLITE_DB,
23
24
  SQLITE_PREFIX,
@@ -27,6 +28,7 @@ const {
27
28
  PG_PORT,
28
29
  PG_PREFIX,
29
30
  PG_USER,
31
+ PG_SSL,
30
32
  MONGO_AUTHSOURCE,
31
33
  MONGO_DB,
32
34
  MONGO_HOST,
@@ -93,6 +95,12 @@ exports.model = {
93
95
  port: PG_PORT || '3211',
94
96
  connectionLimit: 1,
95
97
  prefix: PG_PREFIX || 'wl_',
98
+ ssl:
99
+ PG_SSL == 'true'
100
+ ? {
101
+ rejectUnauthorized: false,
102
+ }
103
+ : null,
96
104
  },
97
105
 
98
106
  sqlite: {
@@ -113,6 +121,12 @@ exports.model = {
113
121
  password: MYSQL_PASSWORD,
114
122
  prefix: MYSQL_PREFIX || 'wl_',
115
123
  charset: MYSQL_CHARSET || 'utf8mb4',
124
+ ssl:
125
+ MYSQL_SSL === 'true'
126
+ ? {
127
+ rejectUnauthorized: false,
128
+ }
129
+ : null,
116
130
  },
117
131
  };
118
132
 
@@ -97,7 +97,7 @@ if (AVATAR_PROXY) {
97
97
  avatarProxy = !isFalse(AVATAR_PROXY) ? AVATAR_PROXY : '';
98
98
  }
99
99
 
100
- const oauthUrl = OAUTH_URL || 'https://user.75.team';
100
+ const oauthUrl = OAUTH_URL || 'https://oauth.lithub.cc';
101
101
 
102
102
  module.exports = {
103
103
  workers: 1,
@@ -55,7 +55,7 @@ module.exports = {
55
55
  });
56
56
  },
57
57
  async ip2region(ip, { depth = 1 }) {
58
- if (!ip) return '';
58
+ if (!ip || ip.includes(':')) return '';
59
59
 
60
60
  try {
61
61
  const search = helper.promisify(regionSearch.btreeSearch, regionSearch);
@@ -5,8 +5,21 @@ module.exports = class extends MySQL {
5
5
  return super.model(tableName.toLowerCase());
6
6
  }
7
7
 
8
- async select(...args) {
9
- const data = await super.select(...args);
8
+ async select(where, options = {}) {
9
+ const lowerWhere = {};
10
+ for (const i in where) {
11
+ lowerWhere[i.toLowerCase()] = where[i];
12
+ }
13
+
14
+ if (options && options.desc) {
15
+ options.desc = options.desc.toLowerCase();
16
+ }
17
+
18
+ if (Array.isArray(options.field)) {
19
+ options.field = options.field.map((field) => field.toLowerCase());
20
+ }
21
+
22
+ const data = await super.select(where, options);
10
23
  return data.map(({ insertedat, createdat, updatedat, ...item }) => {
11
24
  const mapFields = {
12
25
  insertedAt: insertedat,