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