update copyright
[websub-hub] / config / default.js
1 'use strict';
2
3 // Provide default values for all configuration.
4
5 const { name: packageName, version: packageVersion } = require('../package.json');
6 const common = require('../src/common');
7 const Enum = require('../src/enum');
8
9 const defaultOptions = {
10 // Uniquely identify this instance, used to tag work-in-progress.
11 nodeId: common.requestId(), // Default to ephemeral ID: easiest for clustered deployments.
12
13 // This should be set to a reasonably long passphrase or random buffer, to keep client session data secure.
14 encryptionSecret: undefined, // REQUIRED
15
16 // Dingus API Server Framework options. Be sure to set the one REQUIRED option here.
17 dingus: {
18 // This needs to be the full externally accessible root URL, including any proxyPrefix component, which clients will connect to, and which topics will list as their hub link.
19 selfBaseUrl: '', // REQUIRED
20
21 // trustProxy: true, // If true, trust values of some headers regarding client IP address and protocol.
22 proxyPrefix: '', // Leading path parts to ignore when parsing routes, and include when constructing links, e.g. /hub
23 },
24
25 // Database options
26 db: {
27 connectionString: '', // e.g. sqlite://path/to/dbfile.sqlite
28 queryLogLevel: undefined, // Set to log queries
29 cacheEnabled: true, // Cache some db responses. (Postgres only)
30 listener: { // Settings for the cache-invalidator connection. (Postgres only)
31 // pingDelayMs: 5000, // Connection keep-alive/health-check.
32 // reconnectDelayMs: 6000, // Wait time before attempting reconnection.
33 // reconnectTimes: 10, // Retries limit.
34 },
35 },
36
37 // Logging options
38 logger: {
39 ignoreBelowLevel: 'info',
40 },
41
42 // Lease time limits, if not specified per-topic. Comments are defaults in code.
43 topicLeaseDefaults: {
44 // leaseSecondsPreferred: 86400 * 10,
45 // leaseSecondsMin: 86400 * 1,
46 // leaseSecondsMax: 86400 * 365,
47 },
48
49 manager: {
50 pageTitle: packageName, // title on html pages
51 logoUrl: '/static/logo.svg', // image to go with title
52 footerEntries: [ // common footers on all html pages
53 '<a href="https://git.squeep.com/?p=websub-hub;a=tree">Development Repository</a> / <a href="https://github.com/thylacine/websub-hub/">GitHub mirror</a>',
54 '<span class="copyright">&copy;<time datetime="2022">&#8559;&#8559;&#8553;&#8553;&#8544;&#8544;</time></span>',
55 ],
56 strictSecrets: false, // If true, reject requests with secrets but not over https
57 publicHub: true, // Accept publish requests as new topics.
58 processImmediately: true, // If true, immediately attempt to process requests when accepted.
59 },
60
61 communication: {
62 strictTopicHubLink: true, // If true, deletes topics which do not list us (dingus.selfBaseUrl) as a hub relation.
63 retryBackoffSeconds: [60, 120, 360, 1440, 7200, 43200, 86400], // failed requests retry according to number of attempts
64 claimTimeoutSeconds: 600, // how long until an in-progress task is deemed abandoned
65 },
66
67 // Outgoing request UA header.
68 // These values are the same as the defaults in the code, but we are setting
69 // them here so they also apply to UA of other modules, e.g. @squeep/indieauth-helper
70 userAgent: {
71 product: packageName,
72 version: packageVersion,
73 implementation: Enum.Specification,
74 },
75
76 authenticator: {
77 basicRealm: packageName, // Realm prompt for login on administration pages
78 secureAuthOnly: true, // Require secure transport for authentication.
79 authnEnabled: ['indieAuth', 'argon2', 'pam'],
80 forbiddenPAMIdentifiers: ['root'],
81 },
82
83 worker: {
84 concurrency: 10, // maximum number of tasks to process at once
85 pollingEnabled: true, // periodically check for new tasks
86 recurrSleepMs: 60000, // check this often
87 },
88
89 };
90
91 module.exports = defaultOptions;