File tree 5 files changed +29
-15
lines changed
5 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ A Redis connection url to the Redis store
94
94
95
95
* Example:* 'redis://some-user: some-password @some-host.com:1234'
96
96
97
+ ### redisOptions
98
+
99
+ Options to be passed to the redis client.
100
+
101
+ * Example:* { tls: { rejectUnauthorized: false } }
97
102
### filePattern
98
103
99
104
A file matching this pattern will be uploaded to Redis.
Original file line number Diff line number Diff line change @@ -46,19 +46,20 @@ module.exports = {
46
46
return context . commandOptions . revision || ( context . revisionData && context . revisionData . revisionKey ) ;
47
47
} ,
48
48
redisDeployClient ( context , pluginHelper ) {
49
- var redisLib = context . _redisLib ;
50
- var options = {
49
+ let redisLib = context . _redisLib ;
50
+ let libOptions = {
51
51
url : pluginHelper . readConfig ( 'url' ) ,
52
52
host : pluginHelper . readConfig ( 'host' ) ,
53
53
port : pluginHelper . readConfig ( 'port' ) ,
54
54
password : pluginHelper . readConfig ( 'password' ) ,
55
55
database : pluginHelper . readConfig ( 'database' ) ,
56
+ redisOptions : pluginHelper . readConfig ( 'redisOptions' ) ,
56
57
maxRecentUploads : pluginHelper . readConfig ( 'maxRecentUploads' ) ,
57
58
allowOverwrite : pluginHelper . readConfig ( 'allowOverwrite' ) ,
58
59
activationSuffix : pluginHelper . readConfig ( 'activationSuffix' )
59
60
} ;
60
61
61
- return new Redis ( options , redisLib ) ;
62
+ return new Redis ( libOptions , redisLib ) ;
62
63
} ,
63
64
64
65
revisionData ( context ) {
Original file line number Diff line number Diff line change @@ -5,31 +5,33 @@ module.exports = CoreObject.extend({
5
5
6
6
init ( options , lib ) {
7
7
this . _super ( ) ;
8
- var redisOptions = { } ;
9
- var RedisLib = lib ;
10
-
8
+ let libOptions = { } ;
9
+ let RedisLib = lib ;
11
10
if ( options . url ) {
12
- redisOptions = this . _stripUsernameFromConfigUrl ( options . url ) ;
11
+ libOptions = { url : this . _stripUsernameFromConfigUrl ( options . url ) } ;
13
12
} else {
14
- redisOptions = {
13
+ libOptions = {
15
14
host : options . host ,
16
15
port : options . port
17
16
} ;
18
17
19
18
if ( options . password ) {
20
- redisOptions . password = options . password ;
19
+ libOptions . password = options . password ;
21
20
}
22
21
23
22
if ( options . database ) {
24
- redisOptions . db = options . database ;
23
+ libOptions . db = options . database ;
25
24
}
26
25
}
26
+ if ( options . redisOptions ) {
27
+ libOptions = Object . assign ( libOptions , options . redisOptions ) ;
28
+ }
27
29
28
30
if ( ! RedisLib ) {
29
31
RedisLib = require ( 'ioredis' ) ;
30
32
}
31
33
32
- this . _client = new RedisLib ( redisOptions ) ;
34
+ this . _client = new RedisLib ( libOptions ) ;
33
35
34
36
this . _maxRecentUploads = options . maxRecentUploads || 10 ;
35
37
this . _allowOverwrite = options . allowOverwrite || false ;
Original file line number Diff line number Diff line change 60
60
"infile" : " CHANGELOG.md"
61
61
}
62
62
}
63
+ },
64
+ "volta" : {
65
+ "node" : " 14.18.1" ,
66
+ "yarn" : " 1.22.17"
63
67
}
64
68
}
Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ describe("redis plugin", function() {
84
84
redis : {
85
85
host : "somehost" ,
86
86
port : 1234 ,
87
- database : 4
87
+ database : 4 ,
88
+ redisOptions : { tls : { rejectUnauthorized : false } }
88
89
}
89
90
} ,
90
91
_redisLib : redisLibStub
@@ -97,7 +98,8 @@ describe("redis plugin", function() {
97
98
redisLibStub . calledWith ( {
98
99
host : "somehost" ,
99
100
port : 1234 ,
100
- db : 4
101
+ db : 4 ,
102
+ tls : { rejectUnauthorized : false }
101
103
} )
102
104
) ;
103
105
} ) ;
@@ -125,7 +127,7 @@ describe("redis plugin", function() {
125
127
plugin . readConfig ( "redisDeployClient" ) ;
126
128
127
129
assert . isTrue (
128
- redisLibStub . calledWith ( "redis://:password@host.amazonaws.com:6379/4" )
130
+ redisLibStub . calledWith ( { url : "redis://:password@host.amazonaws.com:6379/4" } )
129
131
) ;
130
132
} ) ;
131
133
@@ -151,7 +153,7 @@ describe("redis plugin", function() {
151
153
plugin . readConfig ( "redisDeployClient" ) ;
152
154
153
155
assert . isTrue (
154
- redisLibStub . calledWith ( "redis://:password@host.amazonaws.com:6379/4" )
156
+ redisLibStub . calledWith ( { url : "redis://:password@host.amazonaws.com:6379/4" } )
155
157
) ;
156
158
} ) ;
157
159
You can’t perform that action at this time.
0 commit comments