@evanp/activitypub-bot 0.40.1 → 0.40.2

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.
@@ -17,7 +17,9 @@ const { values } = parseArgs({
17
17
  fanout: { type: 'string' },
18
18
  intake: { type: 'string' },
19
19
  'index-file': { type: 'string' },
20
+ 'profile-file': { type: 'string' },
20
21
  'allow-private': { type: 'boolean' },
22
+ 'redis-url': { type: 'string' },
21
23
  help: { type: 'boolean', short: 'h' }
22
24
  },
23
25
  allowPositionals: false
@@ -39,6 +41,7 @@ Options:
39
41
  --index-file <path> HTML page to show at root path
40
42
  --profile-file <path> HTML page to show for bot profiles
41
43
  --allow-private flag to allow private network requests
44
+ --redis-url <url> Redis connection URL for rate limiting
42
45
  -h, --help Show this help
43
46
  `)
44
47
  process.exit(0)
@@ -78,6 +81,7 @@ const FANOUT = parseNumber(values.fanout) || parseNumber(process.env.FANOUT) ||
78
81
  const INTAKE = parseNumber(values.intake) || parseNumber(process.env.INTAKE) || 2
79
82
  const INDEX_FILE = values['index-file'] || process.env.INDEX_FILE || DEFAULT_INDEX_FILE
80
83
  const PROFILE_FILE = values['profile-file'] || process.env.PROFILE_FILE || DEFAULT_PROFILE_FILE
84
+ const REDIS_URL = normalize(values['redis-url']) || process.env.REDIS_URL || undefined
81
85
  const ALLOW_PRIVATE = values['allow-private'] ||
82
86
  ('ALLOW_PRIVATE' in process.env)
83
87
  ? parseBoolean(process.env.ALLOW_PRIVATE)
@@ -96,7 +100,8 @@ const app = await makeApp({
96
100
  intakeWorkerCount: INTAKE,
97
101
  indexFileName: INDEX_FILE,
98
102
  profileFileName: PROFILE_FILE,
99
- allowPrivateNetworkRequests: ALLOW_PRIVATE
103
+ allowPrivateNetworkRequests: ALLOW_PRIVATE,
104
+ redisUrl: REDIS_URL
100
105
  })
101
106
 
102
107
  const server = app.listen(parseInt(PORT), () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evanp/activitypub-bot",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "description": "server-side ActivityPub bot framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",