58ba307926fea8dd9cb0bbbb827b8ca152e90845
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');
8 const roman
= require('@squeep/roman');
10 const currentYear
= (new Date()).getFullYear();
11 const romanYearHTML
= roman
.toRoman(currentYear
, true);
13 const defaultOptions
= {
14 // Uniquely identify this instance, used to tag work-in-progress.
15 nodeId: common
.requestId(), // Default to ephemeral ID: easiest for clustered deployments.
17 // This should be set to a reasonably long passphrase or random buffer, to keep client session data secure.
18 encryptionSecret: undefined, // REQUIRED
20 // Dingus API Server Framework options. Be sure to set the one REQUIRED option here.
22 // 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.
23 selfBaseUrl: '', // REQUIRED
25 // trustProxy: true, // If true, trust values of some headers regarding client IP address and protocol.
26 proxyPrefix: '', // Leading path parts to ignore when parsing routes, and include when constructing links, e.g. /hub
31 connectionString: '', // e.g. sqlite://path/to/dbfile.sqlite
32 queryLogLevel: undefined, // Set to log queries
33 cacheEnabled: true, // Cache some db responses. (Postgres only)
34 listener: { // Settings for the cache-invalidator connection. (Postgres only)
35 // pingDelayMs: 5000, // Connection keep-alive/health-check.
36 // reconnectDelayMs: 6000, // Wait time before attempting reconnection.
37 // reconnectTimes: 10, // Retries limit.
43 ignoreBelowLevel: 'info',
46 // Lease time limits, if not specified per-topic. Comments are defaults in code.
48 // leaseSecondsPreferred: 86400 * 10,
49 // leaseSecondsMin: 86400 * 1,
50 // leaseSecondsMax: 86400 * 365,
54 pageTitle: packageName
, // title on html pages
55 logoUrl: 'static/logo.svg', // image to go with title
56 footerEntries: [ // common footers on all html pages
57 '<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>',
58 `<span class="copyright">©<time datetime="${currentYear}">${romanYearHTML}</time></span>`,
60 publishHistoryDays: 60, // Number of days of update history to show on topic details page
61 strictSecrets: false, // If true, reject requests with secrets but not over https
62 publicHub: true, // Accept publish requests as new topics.
63 processImmediately: true, // If true, immediately attempt to process requests when accepted.
67 requestTimeoutMs: 120000,
68 strictTopicHubLink: true, // If true, deletes topics which do not list us (dingus.selfBaseUrl) as a hub relation.
69 retryBackoffSeconds: [60, 120, 360, 1440, 7200, 43200, 86400], // failed requests retry according to number of attempts
70 claimTimeoutSeconds: 600, // how long until an in-progress task is deemed abandoned
73 // Outgoing request UA header.
74 // These values are the same as the defaults in the code, but we are setting
75 // them here so they also apply to UA of other modules, e.g. @squeep/indieauth-helper
78 version: packageVersion
,
79 implementation: Enum
.Specification
,
83 basicRealm: packageName
, // Realm prompt for login on administration pages
84 secureAuthOnly: true, // Require secure transport for authentication.
85 authnEnabled: ['indieAuth', 'argon2', 'pam'],
86 forbiddenPAMIdentifiers: ['root'],
90 concurrency: 10, // maximum number of tasks to process at once
91 pollingEnabled: true, // periodically check for new tasks
92 recurrSleepMs: 60000, // check this often
97 module
.exports
= defaultOptions
;