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