@evanp/activitypub-bot 0.47.1 → 0.48.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/CHANGELOG.md +7 -0
- package/lib/app.js +4 -0
- package/lib/routes/favicon.js +16 -0
- package/lib/routes/robotstxt.js +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/app.js
CHANGED
|
@@ -34,6 +34,8 @@ import sharedInboxRouter from './routes/sharedinbox.js'
|
|
|
34
34
|
import profileRouter from './routes/profile.js'
|
|
35
35
|
import proxyRouter from './routes/proxy.js'
|
|
36
36
|
import nodeinfoRouter from './routes/nodeinfo.js'
|
|
37
|
+
import robotsTxtRouter from './routes/robotstxt.js'
|
|
38
|
+
import faviconRouter from './routes/favicon.js'
|
|
37
39
|
import { BotContext } from './botcontext.js'
|
|
38
40
|
import { Transformer } from './microsyntax.js'
|
|
39
41
|
import { HTTPSignatureAuthenticator } from './httpsignatureauthenticator.js'
|
|
@@ -329,6 +331,8 @@ export async function makeApp ({ databaseUrl, origin, bots, logLevel = 'silent',
|
|
|
329
331
|
app.use('/', webfingerRouter)
|
|
330
332
|
app.use('/', proxyRouter)
|
|
331
333
|
app.use('/', nodeinfoRouter)
|
|
334
|
+
app.use('/', robotsTxtRouter)
|
|
335
|
+
app.use('/', faviconRouter)
|
|
332
336
|
|
|
333
337
|
// These should check HTTP Signature if provided
|
|
334
338
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Router } from 'express'
|
|
2
|
+
|
|
3
|
+
const router = Router()
|
|
4
|
+
|
|
5
|
+
const FAVICON_ICO =
|
|
6
|
+
`<svg
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
viewBox="0 0 100 100">
|
|
9
|
+
<text y=".9em" font-size="90">🤖</text>
|
|
10
|
+
</svg>`
|
|
11
|
+
|
|
12
|
+
router.get('/favicon.ico', async (req, res, next) => {
|
|
13
|
+
res.status(200).type('image/svg+xml').end(FAVICON_ICO)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export default router
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Router } from 'express'
|
|
2
|
+
|
|
3
|
+
const router = Router()
|
|
4
|
+
|
|
5
|
+
const ROBOTS_TXT =
|
|
6
|
+
`# We are all bots here
|
|
7
|
+
User-agent: *
|
|
8
|
+
Disallow:
|
|
9
|
+
`
|
|
10
|
+
|
|
11
|
+
router.get('/robots.txt', async (req, res, next) => {
|
|
12
|
+
res.status(200).type('text/plain').end(ROBOTS_TXT)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export default router
|