display timestamps more succinctly
[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 publishHistoryDays: 60, // Number of days of update history to show on topic details page
57 strictSecrets: false, // If true, reject requests with secrets but not over https
58 publicHub: true, // Accept publish requests as new topics.
59 processImmediately: true, // If true, immediately attempt to process requests when accepted.
60 },
61
62 communication: {
63 strictTopicHubLink: true, // If true, deletes topics which do not list us (dingus.selfBaseUrl) as a hub relation.
64 retryBackoffSeconds: [60, 120, 360, 1440, 7200, 43200, 86400], // failed requests retry according to number of attempts
65 claimTimeoutSeconds: 600, // how long until an in-progress task is deemed abandoned
66 },
67
68 // Outgoing request UA header.
69 // These values are the same as the defaults in the code, but we are setting
70 // them here so they also apply to UA of other modules, e.g. @squeep/indieauth-helper
71 userAgent: {
72 product: packageName,
73 version: packageVersion,
74 implementation: Enum.Specification,
75 },
76
77 authenticator: {
78 basicRealm: packageName, // Realm prompt for login on administration pages
79 secureAuthOnly: true, // Require secure transport for authentication.
80 authnEnabled: ['indieAuth', 'argon2', 'pam'],
81 forbiddenPAMIdentifiers: ['root'],
82 },
83
84 worker: {
85 concurrency: 10, // maximum number of tasks to process at once
86 pollingEnabled: true, // periodically check for new tasks
87 recurrSleepMs: 60000, // check this often
88 },
89
90 };
91
92 module.exports = defaultOptions;