Skip to content

Commit e2a0850

Browse files
author
Aaron Chambers
committed
Merge pull request #31 from nikz/master
Minor Readme Updates
2 parents e92e68b + b508822 commit e2a0850

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

README.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The Redis client to be used to upload files to the Redis store. By default this
133133

134134
A message that will be displayed after the file has been successfully uploaded to Redis. By default this message will only display if the revision for `revisionData.revisionKey` of the deployment context has been activated.
135135

136-
*Default:*
136+
*Default:*
137137

138138
```javascript
139139
if (context.revisionData.revisionKey && !context.revisionData.activatedRevisionKey) {
@@ -181,9 +181,10 @@ So, if the `keyPrefix` was configured to be `my-app:index` and there had been 3
181181
$ redis-cli
182182

183183
127.0.0.1:6379> KEYS *
184-
1) my-app:index:9ab2021411f0cbc5ebd5ef8ddcd85cef
185-
2) my-app:index:499f5ac793551296aaf7f1ec74b2ca79
186-
3) my-app:index:f769d3afb67bd20ccdb083549048c86c
184+
1) my-app:index
185+
2) my-app:index:9ab2021411f0cbc5ebd5ef8ddcd85cef
186+
3) my-app:index:499f5ac793551296aaf7f1ec74b2ca79
187+
4) my-app:index:f769d3afb67bd20ccdb083549048c86c
187188
```
188189

189190
Activating a revison would add a new entry to Redis pointing to the currently active revision:
@@ -194,10 +195,11 @@ $ ember deploy:activate f769d3afb67bd20ccdb083549048c86c
194195
$ redis-cli
195196

196197
127.0.0.1:6379> KEYS *
197-
1) my-app:index:9ab2021411f0cbc5ebd5ef8ddcd85cef
198-
2) my-app:index:499f5ac793551296aaf7f1ec74b2ca79
199-
3) my-app:index:f769d3afb67bd20ccdb083549048c86c
200-
4) my-app:index:current
198+
1) my-app:index
199+
2) my-app:index:9ab2021411f0cbc5ebd5ef8ddcd85cef
200+
3) my-app:index:499f5ac793551296aaf7f1ec74b2ca79
201+
4) my-app:index:f769d3afb67bd20ccdb083549048c86c
202+
5) my-app:index:current
201203

202204
127.0.0.1:6379> GET my-app:index:current
203205
"f769d3afb67bd20ccdb083549048c86c"
@@ -207,6 +209,52 @@ $ redis-cli
207209

208210
Activation occurs during the `activate` hook of the pipeline. By default, activation is turned off and must be explicitly enabled by one of the 3 methods above.
209211

212+
## What if my Redis server isn't publicly accessible?
213+
214+
Not to worry! Just install the handy-dandy `ember-cli-deploy-ssh-tunnel` plugin:
215+
216+
```
217+
ember install ember-cli-deploy-ssh-tunnel
218+
```
219+
220+
Add set up your `deploy.js` similar to the following:
221+
222+
```js
223+
'redis': {
224+
host: "localhost",
225+
port: 49156
226+
},
227+
'ssh-tunnel': {
228+
username: "your-ssh-username",
229+
host: "remote-redis-host"
230+
srcPort: 49156
231+
}
232+
```
233+
234+
_(NB: by default `ssh-tunnel` assigns a random port for srcPort, but we need that
235+
to be the same for our `redis` config, so I've just hardcoded it above)_
236+
237+
### What if my Redis server is only accessible *from* my remote server?
238+
239+
Sometimes you need to SSH into a server (a "bastion" server) and then run
240+
`redis-cli` or similar from there. This is really common if you're using
241+
Elasticache on AWS, for instance. We've got you covered there too - just
242+
set your SSH tunnel host to the bastion server, and tell the tunnel to use
243+
your Redis host as the destination host, like so:
244+
245+
```js
246+
'redis': {
247+
host: "localhost",
248+
port: 49156
249+
},
250+
'ssh-tunnel': {
251+
username: "your-ssh-username",
252+
host: "remote-redis-host"
253+
srcPort: 49156,
254+
dstHost: "location-of-your-elasticache-node-or-remote-redis"
255+
}
256+
```
257+
210258
## Prerequisites
211259

212260
The following properties are expected to be present on the deployment `context` object:

0 commit comments

Comments
 (0)