Skip to content

Commit 224fea5

Browse files
authored
repo sync
2 parents 03572eb + c270a02 commit 224fea5

19 files changed

Lines changed: 45 additions & 114 deletions

File tree

content/github/authenticating-to-github/githubs-ssh-key-fingerprints.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ versions:
99
free-pro-team: '*'
1010
---
1111

12-
These are {% data variables.product.prodname_dotcom %}'s public key fingerprints (in hexadecimal format):
13-
14-
- `16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48` (RSA)
15-
- `ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c` (DSA)
16-
17-
These are the SHA256 hashes shown in OpenSSH 6.8 and newer (in base64 format):
12+
These are {% data variables.product.prodname_dotcom %}'s public key fingerprints:
1813

1914
- `SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8` (RSA)
2015
- `SHA256:br9IjFspm1vxR3iA35FWE+4VTyz1hYVLIE2t1/CeyWQ` (DSA)

content/github/authenticating-to-github/testing-your-ssh-connection.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ When you test your connection, you'll need to authenticate this action using you
2424

2525
You may see a warning like this:
2626

27-
```shell
28-
> The authenticity of host '{% data variables.command_line.codeblock %} (IP ADDRESS)' can't be established.
29-
> RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
30-
> Are you sure you want to continue connecting (yes/no)?
31-
```
32-
33-
or like this:
34-
3527
```shell
3628
> The authenticity of host '{% data variables.command_line.codeblock %} (IP ADDRESS)' can't be established.
3729
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

lib/hydro.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ module.exports = class Hydro {
2121
this.schemas = SCHEMAS
2222
}
2323

24+
/**
25+
* Can check if it can actually send to Hydro
26+
*/
27+
maySend () {
28+
return Boolean(this.secret && this.endpoint)
29+
}
30+
2431
/**
2532
* Generate a SHA256 hash of the payload using the secret
2633
* to authenticate with Hydro

middleware/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ module.exports = function (app) {
1616
app.use(require('morgan')('dev', { skip: (req, res) => !isDevelopment }))
1717
app.use(require('./rate-limit'))
1818
if (isDevelopment) app.use(require('./webpack'))
19+
app.use(require('./cookie-parser'))
20+
app.use(require('./req-utils'))
21+
app.use(require('./record-redirect'))
1922
app.use(require('./redirects/external'))
2023
app.use(require('./redirects/help-to-docs'))
2124
app.use(require('./set-fastly-cache-headers'))
@@ -24,9 +27,7 @@ module.exports = function (app) {
2427
app.use(require('./cors'))
2528
app.use(require('./csp'))
2629
app.use(require('helmet')())
27-
app.use(require('./req-utils'))
2830
app.use(require('./robots'))
29-
app.use(require('./cookie-parser'))
3031
app.use(express.json()) // Must come before ./csrf
3132
app.use(require('./csrf'))
3233
app.use(require('./handle-csrf-errors'))

middleware/record-redirect.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const { v4: uuidv4 } = require('uuid')
2+
const { inRange } = require('lodash')
3+
4+
module.exports = function (req, res, next) {
5+
if (!req.hydro.maySend()) return next()
6+
7+
res.on('finish', async function recordRedirect () {
8+
if (!inRange(res.statusCode, 300, 400)) return
9+
const schemaName = req.hydro.schemas.redirect
10+
const redirectEvent = {
11+
context: {
12+
user: req.cookies['_docs-events'] || uuidv4(),
13+
event_id: uuidv4(),
14+
version: '1.0.0',
15+
created: new Date().toISOString(),
16+
path: req.path,
17+
referrer: req.get('referer')
18+
},
19+
redirect_from: req.originalUrl,
20+
redirect_to: res.get('location')
21+
}
22+
const hydroRes = await req.hydro.publish(schemaName, redirectEvent)
23+
if (!hydroRes.ok) console.log('Failed to record redirect to Hydro')
24+
})
25+
26+
return next()
27+
}

translations/de-DE/content/github/authenticating-to-github/githubs-ssh-key-fingerprints.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ versions:
99
free-pro-team: '*'
1010
---
1111

12-
Dies sind die öffentlichen Schlüssel-Fingerprints von {% data variables.product.prodname_dotcom %} (im Hexadezimalformat):
13-
14-
- `16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48` (RSA)
15-
- `ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c` (DSA)
16-
17-
Dies sind die SHA256-Hashes, die in OpenSSH 6.8 und höher angezeigt werden (im base64-Format):
12+
Dies sind die öffentlichen Schlüssel-Fingerprints von {% data variables.product.prodname_dotcom %}:
1813

1914
- `SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8` (RSA)
2015
- `SHA256:br9IjFspm1vxR3iA35FWE+4VTyz1hYVLIE2t1/CeyWQ` (DSA)

translations/de-DE/content/github/authenticating-to-github/testing-your-ssh-connection.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ Für den Test Deiner Verbindung musst Du diese Aktion mit Deinem Passwort authen
2424

2525
Eventuell erhälst Du eine Warnung wie die folgende:
2626

27-
```shell
28-
> The authenticity of host '{% data variables.command_line.codeblock %} (IP ADDRESS)' can't be established.
29-
> RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
30-
> Are you sure you want to continue connecting (yes/no)?
31-
```
32-
33-
oder wie diese:
34-
3527
```shell
3628
> The authenticity of host '{% data variables.command_line.codeblock %} (IP ADDRESS)' can't be established.
3729
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

translations/es-XL/content/github/authenticating-to-github/githubs-ssh-key-fingerprints.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ versions:
99
free-pro-team: '*'
1010
---
1111

12-
Estas son las huellas digitales de clave pública de {% data variables.product.prodname_dotcom %} (en formato hexadecimal):
13-
14-
- `16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48` (RSA)
15-
- `ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c` (DSA)
16-
17-
Estos son los hashes SHA256 que se muestran en OpenSSH 6.8 y versiones posteriores (en formato base64):
12+
Estas son las huellas digitales de clave pública de {% data variables.product.prodname_dotcom %}:
1813

1914
- `SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8` (RSA)
2015
- `SHA256:br9IjFspm1vxR3iA35FWE+4VTyz1hYVLIE2t1/CeyWQ` (DSA)

translations/es-XL/content/github/authenticating-to-github/testing-your-ssh-connection.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ Cuando pruebes tu conexión, tendrás que autenticar esta acción utilizando tu
2424

2525
Puedes ver una advertencia como la siguiente:
2626

27-
```shell
28-
> La autenticidad del host '{% data variables.command_line.codeblock %} (DIRECCIÓN IP)' no se puede establecer.
29-
> La clave de huella digital RSA es 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
30-
> ¿Estás seguro de que quieres continuar conectado (sí/no)?
31-
```
32-
33-
o como la siguiente:
34-
3527
```shell
3628
> La autenticidad del host '{% data variables.command_line.codeblock %} (DIRECCIÓN IP)' no se puede establecer.
3729
> La clave de huella digital RSA es SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

translations/ja-JP/content/github/authenticating-to-github/githubs-ssh-key-fingerprints.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ versions:
99
free-pro-team: '*'
1010
---
1111

12-
{% data variables.product.prodname_dotcom %} のパブリックキーフィンガープリントを以下に示します (16 進形式):
13-
14-
- `16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48` (RSA)
15-
- `ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c` (DSA)
16-
17-
OpenSSH 6.8 以降で表示される SHA256 ハッシュを次に示します (base64 形式):
12+
{% data variables.product.prodname_dotcom %} のパブリックキーフィンガープリントを以下に示します:
1813

1914
- `SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8` (RSA)
2015
- `SHA256:br9IjFspm1vxR3iA35FWE+4VTyz1hYVLIE2t1/CeyWQ` (DSA)

0 commit comments

Comments
 (0)