b23d0f8833919fdd29af7480abd552f9f3b74b30
3 // Provide default values for all configuration.
5 const { name: packageName
, version: packageVersion
} = require('../package.json');
6 const common
= require('../src/common');
7 const Enum
= require('../src/enum');
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.
13 // This should be set to a reasonably long passphrase or random buffer, to keep client session data secure.
14 encryptionSecret: undefined, // REQUIRED
16 // Dingus API Server Framework options. Be sure to set the one REQUIRED option here.
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
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
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.
39 ignoreBelowLevel: 'info',
42 // Lease time limits, if not specified per-topic. Comments are defaults in code.
44 // leaseSecondsPreferred: 86400 * 10,
45 // leaseSecondsMin: 86400 * 1,
46 // leaseSecondsMax: 86400 * 365,
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">©<time datetime="2022">ⅯⅯⅩⅩⅠⅠ</time></span>',
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.
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
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
72 version: packageVersion
,
73 implementation: Enum
.Specification
,
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'],
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
91 module
.exports
= defaultOptions
;