Skip to main content

Configuration

The doc service's own properties live under the jeap.doc prefix. Everything else comes from the jEAP starters it builds on - see jeap-spring-boot-starters for the security, object storage, database, Swagger and web header properties.

Object storage​

jeap:
doc:
storage:
bucket: my-doc-service-documents
upload-prefix: uploads
spool-directory: /var/doc-service/spool
PropertyDefaultDescription
jeap.doc.storage.bucket-Bucket holding the documentation
jeap.doc.storage.upload-prefixuploadsPrefix the bundles of the uploads are stored under, in the bucket
jeap.doc.storage.site-prefixsitesPrefix the generated sites are published under, in the bucket
jeap.doc.storage.spool-directoryJVM temp directoryDirectory an uploaded bundle is spooled to while it is transferred
jeap.doc.storage.publication-concurrency16How many files of a generated site are written into the bucket at a time. A site is thousands of small files, so publishing it is bound by round trips; above the connection pool of the S3 client this buys nothing
jeap.doc.storage.microsite-concurrency16How many files of an uploaded HTML microsite are written into the bucket at a time. The same reasoning, and a knob of its own because this runs while a pipeline waits for its upload to be answered. Below 1 stops the startup

The uploaded documentation lies under its own prefix, separately from the documentation the generator writes: an upload is stored as <upload-prefix>/docs/<id>/<attempt>/bundle.zip, where <id> is the identifier the doc service gave the upload. Every attempt of an upload writes its own object - see Uploads for why - and the upload records the one it points at.

An uploaded bundle is written to a file before it is transferred to the object storage, which is what keeps it out of the memory of the service. The spool directory should therefore be on a disk: a /tmp that is a memory-backed tmpfs - as containers with a read-only root filesystem often have - would put the bundle back into memory. It needs room for as many bundles of jeap.doc.upload.max-size as are uploaded at the same time, and the service does not start when it cannot write there.

The bucket is checked while the service starts: the service does not start when the property is missing or when the bucket cannot be reached with the configured credentials. A missing bucket is a configuration error of the instance, and it should surface in the deployment instead of in the first upload.

The connection to the object storage itself is configured with the jeap.s3.client.* properties of the jEAP object storage starter.

Uploads​

PropertyDefaultDescription
jeap.doc.upload.max-size50MBMaximum size of an uploaded bundle; a larger one is rejected with 413
jeap.doc.upload.in-progress-timeoutPT2MHow long an upload may be in progress before another attempt under the same upload id takes it over

The service stops reading a bundle as soon as it exceeds the limit, so an oversized upload cannot fill its heap.

An upload that is rejected before its body is read - an unannounced size, a wrong parameter, another attempt of the same upload already running - can only be answered while the rest of the request is discarded, which the servlet container does up to server.tomcat.max-swallow-size. The service derives that limit from max-size, plus a margin, so it follows whatever an instance accepts and there is nothing to keep in step; below the size of an accepted bundle a rejected upload would see a closed connection instead of the problem document telling it what to fix. The margin is there for the one rejection that is by definition larger than the limit - a bundle that is too large - and an upload overshooting it by more than the margin still ends in a closed connection.

The in-progress timeout is what frees an upload id whose service died while the bundle was streaming - see Uploads. It has to be longer than a legitimate upload of max-size takes, so an instance that raises the maximum size raises the timeout with it.

Housekeeping​

jeap:
doc:
upload:
housekeeping:
enabled: true
retention: P14D
cron: "0 30 2 * * *"
validation:
max-paths: 200
max-microsite-paths: 5000
max-findings: 50
PropertyDefaultDescription
jeap.doc.upload.housekeeping.enabledtrueWhether old uploads are removed at all
jeap.doc.upload.housekeeping.retentionP14DHow long an upload is kept after it was last received
jeap.doc.upload.housekeeping.cron0 30 2 * * *When to look, in the time zone of the service
jeap.doc.upload.validation.max-paths200The most files a markdown documentation set may hold. Past it a validation is refused with 413 and an upload with the same, rather than answered: a tree of that size is a path pointing at more than the documentation. The sets that exist hold twelve to seventeen pages, and a page per chapter with thirty screenshots is about fifty files. It also bounds the validation request body, which is derived from it. Below 1 or above 100000 stops the startup
jeap.doc.upload.validation.max-microsite-paths5000The most files an HTML set may hold. A microsite is a built site rather than a chapter of pages: the Javadoc of one module is over five hundred files, an Allure report about forty. It bounds the upload and the validation request body the same way max-paths does, and the same ceiling of 100000 applies. Below 1 or above it stops the startup
jeap.doc.upload.validation.max-findings50The most findings one report carries. A report of forty problems is already unreadable; what is left out is counted in findingsOmitted rather than dropped in silence. Below 1 stops the startup - a report that may carry no finding could not say what is wrong

The job removes the uploads from the database only, whatever state they are in; the bundles are expired by a lifecycle rule of the bucket, which has to be set a little longer than the retention - see Uploads. Of several instances only one runs it, using a lock in the shedlock table.

The documentation a team writes​

What an uploaded documentation set may be, and what becomes of the objects nothing references. See The documentation a team writes.

jeap:
doc:
custom:
max-unpacked-size: 200MB
sweep-cron: "0 50 2 * * *"
refused-extensions: [exe, cmd, bat, ps1, sh, jar, dmg, "…"]
additional-asset-extensions: []
PropertyDefaultWhat it does
jeap.doc.custom.max-unpacked-size200MBThe most a documentation set may unpack to, added up over its files and counted per set - one build writes the system's set, every component's and every library's, and each has this budget of its own. A build writes every file of a set into the tree it generates, so a bundle that unpacks to far more than it weighs would fill the disk of a build task long after the upload was accepted. Checked twice: against what the archive declares when the set is received, which answers the uploading pipeline with 413, and against the bytes actually written when a build writes them - the declared sizes are the uploader's to state, so only the second one measures. Past it during a build the rest of that set is left out and the build goes on
jeap.doc.custom.refused-extensionsthe list on What an upload is validated againstWhat an HTML microsite may not carry - executables, the scripts a workstation runs, and the archives that install them. A microsite follows no template, so there is no allowlist to bound it: what a build emits is carried, and what it may do is bounded by the sandbox it is served and framed with. Setting this replaces the list rather than adding to it. A Markdown set is bounded by its template's extensions and additional-asset-extensions instead
jeap.doc.custom.additional-asset-extensionsemptyAsset types a Markdown set may carry on top of its template's list - for example [xlsx, mp4]. It only adds: the template's list always applies, and an HTML microsite ignores this. Entries are lower-cased and lose a leading dot. An entry that can never be an asset fails the startup: md and mdx, what the site would render as a document (html, htm, xhtml, shtml), code (js, mjs, cjs, jsx, ts, tsx, css), and the executables of the default refused-extensions. The validation report's allowedExtensions lists what this instance takes
jeap.doc.custom.sweep-cron0 50 2 * * *When the objects that no documentation set names are removed. - switches it off. It selects on references, never on age - nothing under the current documentation is removed for being old - and it leaves alone anything written in the last six hours, which is an upload that may still be committing the rows that name it rather than an orphan

Documentation sites​

Which sites exist is configuration, not something the service works out from what has been uploaded. An upload naming a site nobody configured is rejected: a typo in a doc workflow would otherwise produce a second documentation site, generated and served next to the real one, and nobody would notice.

An instance that configures no site gets one called default, with every default value below - which is all a single-site instance needs. An instance that configures named sites has a default site only if it names one, and an upload that omits the site parameter targets default whatever else is configured - so an instance with named sites that expects such uploads has to configure default as well. Written out in full, that default site is:

jeap:
doc:
sites:
default:
title: Documentation # the site id for any site but this one
tagline: # none
logo: # the template's own mark
favicon: # the logo
color-scheme: jeap
publish-on-upload: true
environments:
- id: dev
short-name: DEV
label: Development
order: 1
main: false
latest: true # documentation of what is not deployed anywhere yet
- id: ref
short-name: REF
label: Reference
order: 2
main: false
latest: false
- id: abn
short-name: ABN
label: Acceptance
order: 3
main: false
latest: false
- id: prod
short-name: PROD
label: Production
order: 4
main: true # served at the site root, and the only indexed tree
latest: false

Every one of those values is what an instance gets without writing any of them down. A second site, and a first one that departs from the defaults:

jeap:
doc:
sites:
default:
title: JME Documentation
governance:
title: Governance
tagline: How the platform is governed
color-scheme: neutral
logo: classpath:/branding/governance.svg
per-environment: false # the Governance Service is read once per instance, not per stage
content: governance
publish-on-upload: false # published by the import only; nothing is ever uploaded for it
PropertyDefaultDescription
titleDocumentation for the default site, the site id for any otherWhat the browser tab says, and the navbar on a single site. On an instance with several sites, or with jeap.doc.publication.title, the navbar shows that one title on every site - see Several sites in one header bar
tagline-One line under the title on the root page
logo, faviconthe template'sA classpath: or filesystem resource with the site's own mark. Without a favicon the logo is used
color-schemejeapOne of the schemes the site template ships: jeap, neutral, high-contrast. A site does not bring its own CSS - a free-form stylesheet would make every later change to the template able to break it
per-environmenttrueWhether the site has a tree per environment. false makes it one tree served at the site root, with no environments, no switcher and no banner - see Sites without environments
contentsystem-documentationWhere the site's content comes from: system-documentation, generated from the architecture model and the teams' uploads; static-site, a tree uploaded for the site; or governance, the Governance Service's reports - see Where a site's content comes from
environmentsdev, ref, abn, prodThe environments of this site, below
publish-on-uploadtrueWhether an upload for this site asks for a build of the part that carries the system it is for
navigation-labelthe titleWhat the site's tab in the header bar says, on an instance with more than one site - see Several sites in one header bar
architecture-model-requiredtrueWhether this site is published only once the architecture model of its environments has been imported. It has an effect only where an architecture repository is configured for one of them, so a site documenting from other sources never meets it. Such a site is not failed but postponed until the first import - see the import
build.slots1How many of the instance's build slots a build of a part of this site occupies - see a site's weight in build slots

The default site is served at the context root of the service, and every other site below /site/ - /site/governance/, and its environments at /site/governance/dev/.

That one segment is what keeps the namespaces apart, and it is why a site id has no reserved names: it only has to be a slug, and short enough for the name of the lock its builds take. A site may be called api, dev or prod without colliding with anything.

What still takes a top-level segment is the default site's environments - /dev/, /prod/ - so it is there that the paths the service answers on itself are unusable. Reserved for them: api, ui-api, actuator, swagger-ui, api-docs, webjars, error, assets, img, and site, which is where every other site is served. The environments of any other site sit below /site/<id>/ and are not subject to these service-level restrictions.

An environment of any site may not be called default or static, whatever its URL: those are names the site generator uses inside a site's own content tree. Nor microsites: every site serves its uploaded microsites below its own root, /microsites/ or /site/<id>/microsites/, and an environment of that name would lose its pages to them. reactions is also reserved on every site for the Reaction Graph Explorer, whether or not an observer is configured. All of it is checked while the service starts.

Where a site's content comes from​

Every site has a content source, named by content:

contentWhat the site isEnvironments
system-documentationThe documentation of the systems: generated from the architecture model of each environment and from what the teams upload, a part per system. What a site is without contentRequired
static-siteA tree of Markdown uploaded for the site itself and published as it is: its folders are the navigation - see Uploads, and nothing is generated into itNone: per-environment: false
governanceThe reports of the Governance Service: scores, trends and rule conformance, a part of its own - see The governance site for its pagesNone: per-environment: false
jeap:
doc:
sites:
handbook:
title: Handbook
per-environment: false
content: static-site

A content the instance provides no source for stops the service at startup, naming the site and the value, and so does a site its source cannot take: system-documentation without environments, static-site with them, or governance with them. Only the documentation of the systems is published by the architecture import; a static site is published when its tree is uploaded, and on the reconcile schedule - see Uploads for how its tree gets there; a governance site is published by the governance import.

Sites without environments​

A site that does not document stages has no use for a tree per environment. With per-environment: false it is one tree, served at the site root - /site/handbook/ and the pages below it, with no environment segment in any URL. Its content comes from a source that needs no environments - a static-site, configured as in the example above. Such a site configures no environments, and has no main or latest one; a site that sets per-environment: false and lists environments stops the service at startup, naming the site. It shows no environment switcher and no banner, and its pages are indexed for search like the main tree of any other site. A site that leaves per-environment out, or sets it to true, keeps its environments as described below.

Environments​

An environment is a tree of the same documentation showing the state of one stage. Exactly one environment of a site is main and exactly one is latest, and the service does not start otherwise.

PropertyDefaultDescription
id-The identifier, and the path segment the tree is served under - top-level for the default site, below /site/<id>/ for any other. A slug
short-namethe id in upper caseWhat the switcher and the banner show, e.g. DEV
labelthe idThe name a reader sees
order0Where it appears in the switcher
mainfalseThe tree served at the site root, and the only one search engines are invited to index. Every other tree carries a banner and noindex
latestfalseWhere the documentation of a component's current state goes, before it is deployed anywhere - the fast-feedback tree

main and latest may be the same environment, and usually are not: prod is main, dev is latest.

A site may be named after an environment of the default site: the site is served below /site/, the environment at the top level, and neither can take the other's URLs. The one name an environment of the default site may not have is site itself.

Building the documentation​

Cross-site: one Node, one workspace root, one timeout per container, however many sites.

jeap:
doc:
build:
node-command: /opt/node/bin/node
node-modules-directory: /opt/jeap-doc/node_modules
workspace-directory: /app/build
poll-interval: PT30S
max-concurrent-parts: 3
lock-lease: PT2M
timeout: PT15M
max-node-memory: 1024MB
purge-native-memory: true
ssg-worker-threads: false
ssg-task-size: 100
perf-log: true
retention: 3
history-retention: P14D
departed-part-retention: P90D
PropertyDefaultDescription
jeap.doc.build.node-commandnodeThe Node runtime the site is generated with. An absolute path in a container: the child process gets an environment built from nothing, and its PATH is derived from this value
jeap.doc.build.node-modules-directory-Where the site template's dependencies are installed - by the image build, see The site image. The service does not start without them
jeap.doc.build.workspace-directoryJVM temp directoryWhere a build works. It belongs on storage that belongs to this container alone - the writable layer of a task on ECS, an emptyDir on Kubernetes. Nothing in it has to survive a restart, and a /tmp that is a memory-backed tmpfs would put the build into memory
jeap.doc.build.keep-workspacefalseKeeps the workspace of a build instead of deleting it. For reproducing a failure, and nothing else: it is a disk leak with a purpose, and it warns while it is on
jeap.doc.build.poll-intervalPT30SHow often an idle instance looks whether a build has been asked for. It is not what decides how fast a queue of parts drains: a pass builds what is owed and reads again after every build, so this only bounds how long an instance that was told nothing takes to notice - see Generation
jeap.doc.build.pick-up-on-triggertrueWhether a trigger starts a build pass at once instead of leaving it to the next poll. The instance that took an upload knows there is work, and waiting a poll interval to look is latency for nothing. Advisory either way: a wake-up that is lost costs nothing, because the request stands and the next poll serves it
jeap.doc.build.max-concurrent-parts3How many parts of the documentation one instance builds at a time. A memory decision rather than a parallelism one: every concurrent build holds a Docusaurus run in the same container, and the memory of a build is what decides whether it survives - see max-node-memory below and Observability. A full publication of a large landscape is a great many builds, and one after another they pay the fixed cost of a generator start each while the cores sit idle. Raise it against the memory a build is measured to hold, and not past the cores. It is how many run at once and not how many a pass builds: at 1 the parts are built one after another, within the same pass
jeap.doc.build.timeoutPT15MHow long a build may take before it is given up on
jeap.doc.build.lock-leasePT2MHow long a part's build lock is leased for - and therefore how long after an instance dies its lock survives it. Far shorter than a build may take, because the lock is extended while the build runs. The shortest accepted is 30 seconds, checked while the service starts
jeap.doc.build.shutdown-timeoutPT15SHow long a stopping instance may spend giving up its build. It has to stay below spring.lifecycle.timeout-per-shutdown-phase, and the platform's stop timeout has to be above both - see Generation
jeap.doc.build.max-node-memory1024MBThe heap the site generator may use. It has to fit beside the JVM in the container. It bounds the JS side of a build - the MDX compilation, the plugins, the static generation when it runs in the main process - and not the bundle phase: the template bundles with Rspack, whose memory is native and outside the Node heap. The container's limit is the only bound on that phase, and jeap.doc.container.memory.* is how to size both numbers - see Observability
jeap.doc.build.purge-native-memorytrueWhether the site generator's native allocator hands memory back to the operating system as soon as it is freed. It is about the bundler: Rspack is native code built with mimalloc, which keeps freed pages mapped for the next allocation - so the phases after the bundle run with the whole bundle phase still resident behind them, and the container is sized for the sum. On, a build holds what it is using rather than everything it has used, at the cost of the syscalls that return the pages. It bounds what a build holds, never what it allocates. Turn it off if the [PERF] lines show the phases after the bundle getting slower than the memory is worth
jeap.doc.build.ssg-worker-threadsfalseWhether the site generator writes the pages from a pool of worker threads. It makes the static generation about twice as fast, and it is off all the same: each worker thread is a V8 isolate with a heap of its own, and max-node-memory bounds an isolate rather than the process - so a pool of them may hold a multiple of that cap, in a container that also holds this JVM. An instance whose container has the room switches it on and reads what it cost off the memory log
jeap.doc.build.ssg-task-size100How many pages the site generator hands one static-generation worker at a time. Read only when ssg-worker-threads is on. Not the generator's own default of ten: at ten the workers wait on the one thread that hands the chunks out and collects their results - a worker is busy 66% of the time at four threads, 40% at eight - and a task of ten pages also caps how many pages one worker can have in flight. At a hundred the static generation of a large part is less than half of what it was. Above a hundred the tasks run out before the threads do, and the pool degenerates towards serial for the small parts of a site. At least 1: the generator does not check the value, and below one it renders no page at all and reports no error, so the service refuses to start
jeap.doc.build.perf-logtrueWhether the site generator reports how long each phase of a build took and what it did to the Node heap. The lines carry the prefix [PERF], nested by phase, each heap reading taken after a full garbage collection - so a build that grows or slows down names the phase responsible. The collections cost a large site seconds. Logged at DEBUG, like every other line of the generator's output: a build writes hundreds of lines and a publication is dozens of builds, so at INFO the generator's own output would be most of what an instance logs. Left on by default so that the lines are there the moment ch.admin.bit.jeap.doc.sitegenerator.NodeProcess is turned down to DEBUG, without a restart
jeap.doc.build.retention3How many publications are kept per part. At least 2, checked while the service starts: the one being served, and the one other instances may still be serving from their publication cache
jeap.doc.build.history-retentionP14DHow long the record of a build is kept. A part per system means a row per part per import - some eight hundred a day on a site of fifty-two parts, nearly all of them saying a part had not moved - so this is a fortnight rather than a quarter. The published build of each part is kept whatever its age - it is what says which publication a part is served from
jeap.doc.build.reconcile-cron0 15 6-18/4 * * *When to ask for the sites no architecture import publishes - one whose environments have no architecture repository. Every four hours through the working day; - switches it off. Such a site has no import to publish it, and the content digest covers the service version, so without this it keeps serving what an earlier release generated. Nearly free: a part whose content has not moved is not generated
jeap.doc.build.departed-part-retentionP90DHow long a part the site no longer has keeps what it published. On the system axis a decommissioned system takes its part with it, and nothing else would ever remove its objects or its pages. Long on purpose, and the nightly sweep leaves a site alone entirely while its partition produces nothing but the shell - so a landscape that goes briefly wrong cannot take a live system's documentation with it. DELETE /api/sites/{site}/parts/{part} removes one without waiting
jeap.doc.build.history-cron0 45 2 * * *When old build records are removed, and when what a part the site no longer has published is removed, in the time zone of the service

One build of a part at a time, and a site's weight in build slots​

A part is built by one instance at a time. Its build holds a lock named after the part, across every instance of the service. A part has at most one pending request: asks for a part that already has one are merged into it, and any number of asks arriving while its build runs lead to exactly one further build. So a burst of uploads, or of calls from another service, is one build after the one that is running - see Generation.

The slots of an instance are shared by all its sites, and a part of one site may need far more memory than a typical system part. Such a site sets its weight: how many of the instance's max-concurrent-parts slots a build of one of its parts occupies.

jeap:
doc:
sites:
deployments:
build:
slots: 2 # a build of this site occupies two slots
PropertyDefaultDescription
jeap.doc.sites.<id>.build.slots1How many build slots a build of a part of this site occupies. It starts only once that many are free, and parts asked for after it do not overtake it while it waits. Above max-concurrent-parts the service does not start

The memory an instance needs is then bounded by

JVM heap + D + (max-concurrent-parts - weight) * S

D = the peak memory of one build of the heavy site
S = the peak memory of the largest other part, read off max_over_time(jeap_doc_container_memory_used_bytes[15m])
while such a part builds alone - see Observability

Most of a build's memory is native and outside max-node-memory, so the container's limit is what the formula sizes - see Observability.

The service does not start when the site template's dependencies are missing, when they were installed from a different package-lock.json than the one this version of the service carries, or when Node cannot be run - a configuration error of an instance belongs in its deployment rather than fifteen minutes into its first build.

Searching the documentation​

One index over the whole site, built at the end of the build pass that published it - see Search. There is no schedule: a site is indexed when it changes.

PropertyDefault
jeap.doc.search.enabledtrueWhether this instance indexes at all. The way out when the service and the image do not ship together: the indexer arrives with node_modules, so an instance whose image predates the search would otherwise fail its startup check. Off, and neither the check nor a build pass asks for it
jeap.doc.search.retention2How many published indexes of a site are kept, the current one included. Two is the minimum and it is refused below that: every file the indexer writes is named by a content hash, so a reader whose browser holds the manifest of the index that was current a moment ago is still fetching chunks that exist only under its prefix
jeap.doc.search.lock-leasePT30MHow long an index run's lock survives an instance that dies holding it. Of several instances, one indexes a site
jeap.doc.search.abandoned-afterPT2HHow long after it started a run still recorded as running is taken to be dead, and its files removed with its row. Refused at or below the lock lease: a run that is alive holds and extends that lock, and treating one as dead that early would delete the files of a run that is still writing them
jeap.doc.search.failure-retentionP30DHow long the record of a failed index run is kept. It is evidence of what went wrong, which is worth a month rather than for ever
jeap.doc.search.max-microsite-pages200How many pages of one uploaded microsite are indexed, its entry point first. The reason is flooding, not size: a Javadoc of 519 pages costs a reader five kilobytes before their first query, and filled ten of ten first hits for a common word. Applied while a set is received, so a change takes effect on the next upload
jeap.doc.search.max-microsite-page-bytes512KBHow much of one page is read while its text is extracted. A larger page is read down to the cut and indexed as far as it got
jeap.doc.html.ignored-selectorsscripts, styles and the usual navigationWhat is dropped from an uploaded HTML page before its text is taken. A generated documentation site repeats its navigation on every page, and without this the excerpt of one class page reads like the excerpt of every other

Both of the last two are acted on by the nightly clean-up, on jeap.doc.build.history-cron with the others - see Operating the bucket.

The architecture model​

Where the documentation the doc service generates itself comes from. The map is instance-wide and keyed by the id of an environment, not a property of each site. An environment names a stage, and two sites with a prod environment mean the same stage of the same landscape.

jeap:
doc:
archrepo:
environments:
dev:
url: https://internal.example.ch/archrepo-service
client-registration: doc-service
prod:
url: https://internal.example.ch/archrepo-service
client-registration: doc-service
client:
connect-timeout: PT5S
read-timeout: PT30S
generator:
max-diagram-nodes: 100
max-detailed-edges: 20
max-diagram-edges: 40
max-edge-labels: 4
max-context-components: 40
max-schema-table-diagram: 100
max-schema-table-list: 200
max-schema-group-members: 1000
rest-api-excluded-paths:
- /actuator(/.*)?
view-excluded-components: []
view-excluded-relations: []
schema-table-groups: {}
PropertyDefaultDescription
jeap.doc.archrepo.environments.<environment>.url-Where the architecture repository of that stage is. On a platform giving a service two hostnames this is the internal one: it is a service calling a service, not a browser following a link
jeap.doc.archrepo.environments.<environment>.client-registration-The spring.security.oauth2.client.registration entry the token is obtained with. Its client needs <system-name>_@architecture-model_#read on the architecture repository's authorization server - see Security
jeap.doc.archrepo.client.connect-timeoutPT5SHow long the client waits for the connection
jeap.doc.archrepo.client.read-timeoutPT30SHow long the client waits for one response. The budget of a whole import step is jeap.doc.archrepo.import.timeout
jeap.doc.archrepo.client.retries2How often a failed request is tried again, so three attempts in all. Only a connection failure, a read timeout, a 5xx or a 429 is retried
jeap.doc.archrepo.client.retry-delayPT0.5SHow long to wait before the first retry, doubled for each further one
jeap.doc.archrepo.client.retry-jitterPT0.25SHow much the delay is varied, so that instances whose schedules fire together do not retry in lockstep
jeap.doc.archrepo.client.max-retry-delayPT2SThe longest a retry waits, however often the delay has been doubled
jeap.doc.archrepo.import.cron0 45 5-19 * * *When the architecture repository is imported - hourly at a quarter to, so a fresh model stands in front of the publication at five past. Empty means never - see the import and the scheduled jobs
jeap.doc.archrepo.import.on-startuptrueWhether an environment that has never been imported is imported once while the service starts
jeap.doc.archrepo.import.timeoutPT10MHow long one step of one environment may spend fetching. Checked between items, and it has to leave room for one item's retries. A step that runs out of time achieves nothing - the model is all or nothing - so the budget is deliberately more than a landscape needs. It has to stay below lock-lease, which is checked while the service starts
jeap.doc.archrepo.import.lock-leasePT15MHow long the lock of an import survives an instance that dies holding it. Not a work budget, and it has to be longer than the timeout
jeap.doc.archrepo.import.stale-afterPT2HHow old the model may be before a build says so while generating from it
jeap.doc.archrepo.import.cache-landscapetrueWhether the landscape a build reads is held between builds instead of read from the database for each of them. A build reads the whole landscape of every environment its part carries, so a site of fifty parts over four environments read four landscapes two hundred times - about a third of a full publication. What is held is keyed on when that environment was last read successfully, so the import that could have changed a landscape is what drops it; a stale answer is not possible. It costs one landscape per environment in memory
jeap.doc.archrepo.import.max-artifact-size8MBThe largest OpenAPI specification, database schema or message schema answer that is replicated. A bigger one is left where it is, with a warning naming it. It bounds what one answer costs in memory as well as what is stored: nothing past it is read off the wire. Zero fails the startup
jeap.doc.generator.max-diagram-nodes100How many other systems a diagram may draw before the rest are left out - the neighbours of the system context view and of the whitebox view alike. A system exchanging something with a hundred others renders a diagram nobody can read; above this the diagram is truncated, the page says so, and the table below it still lists every one. A system's own components are never cut: the whitebox view draws all of them regardless
jeap.doc.generator.max-detailed-edges20How many relations a whitebox picture may draw in full - an arrow per kind and direction, in its colour, with the names on it. Above this the picture is folded to its shape: one grey line per pair of boxes, with an arrowhead only where the pair is joined one way. The relations table below it is unaffected and names every one
jeap.doc.generator.max-diagram-edges40How many relations a whitebox picture may draw at all. Above this it is not drawn and the page says so in a sentence, because a whitebox view is dense rather than long-tailed: there is no part of it that is both readable and honest. Must not be below max-detailed-edges, which stops the startup
jeap.doc.generator.max-edge-labels4How many names one arrow of a diagram may carry. Above this the arrow shows the count for its kind - 5 Events - and the page's table names every one of them. It is not only about size: the diagram engine lays a label out by recursion and overflows the browser's stack at about sixty lines, so an uncapped label is a diagram that does not render at all. 0 is legal and means an arrow always shows a count
jeap.doc.generator.max-context-components40How many component boxes a component's context view may draw - its siblings and the counterpart components of other systems together. Only the counterparts it actually exchanges something with are candidates. The siblings come first, then one component of each other system in turn, so one large neighbour cannot push a component's own siblings off its own page. Above the bound a system whose components got no box is drawn as a single box instead, the page says how many counterparts were left out, and its table of relations lists every one
jeap.doc.generator.max-schema-table-diagram100How many entries an entity relationship diagram may draw, out of the ones the list below carries - so a box on the diagram always has a list entry, and the effective bound is the smaller of the two. The limit is the reader's browser rather than the page: the engine lays a diagram out by recursion, so a schema of three hundred tables is not a large picture but no picture at all. Above this the page says how many tables were left out, and the list of tables carries them as far as its own, larger bound below. An entry is one table, or one family of partitions: a partitioned table is grouped into a single entry before either bound applies
jeap.doc.generator.max-schema-table-list200How many entries a database schema page writes with their columns, by name. The one bound on the facts rather than on a picture, and what makes a schema page's cost finite: unbounded, one component's page carried 33 527 rows of columns and cost an hour and a half to build. Above this the page says how many entries it did not write. It links nothing: what carries all of them is the architecture repository's own API, which is not a page a reader of a published site can open. Larger than the diagram's bound on purpose - a diagram of a hundred tables is already at the edge of what renders, and a list can afford far more than a picture
jeap.doc.generator.max-schema-group-members1000How many entities the entry of a configured table group lists, by name - see schema-table-groups below. A bound on the facts, like max-schema-table-list, and above it the entry says how many entities it did not list. Larger than the list bound on purpose: one group of one schema stands for 253 entities, and an entity is one row of three cells rather than a table of columns. Below 1 stops the startup
jeap.doc.generator.rest-api-excluded-paths/actuator(/.*)?The paths a REST API page does not describe, as regular expressions that have to match a whole path - so /health means that one path and not /api/health-reports. The default is the actuator: every jEAP service publishes the operational endpoints the platform needs, they are in its specification, and on a small service they outnumber the operations a reader came for. A list rather than a rule about the actuator, because a component with a management context path of its own is the same question with a different answer. The page names the operations it left out, up to twenty, so the count can still be compared with the specification. An empty list documents every path. Applied when a page is written, so a change takes effect on the next build rather than on the next import; a pattern that is not a regular expression stops the startup
jeap.doc.generator.view-excluded-components-The components left out of the diagrams and relations tables of other pages, as regular expressions that have to match a whole component name - a test double that publishes the events of other systems, say. A system it alone exchanges something with is then no neighbour either. Its own pages stay, and say that it is left out. One list for the whole service. Applied when a page is written; a pattern that is not a regular expression stops the startup
jeap.doc.generator.view-excluded-relations-The relations left out of the diagrams and relations tables of other pages - the platform's plumbing rather than a component's architecture, such as every component uploading its schemas to the architecture repository. An entry is a set of fields (consumer, provider, method, path, message-type), all of which have to match; one that is not given matches anything. It removes arrows and never boxes: a component named here keeps its box and its pages, and its own page says that some of its relations are elsewhere left out. A consumer, a provider and a message-type are regular expressions over the whole name; a path is not - it is compared literally after normalising its variable names, because /api/openapi/{systemComponentName} is no regular expression and is what an operator writes. An entry with no field at all, or one naming a path or a method together with a message-type, stops the startup
jeap.doc.generator.schema-table-groups.<component>-Tables with the same structure under different names, documented as one entry on the database schema page of that component - one table per entity and month, say. The key is the component name, compared exactly; a name with a dot or an upper-case letter has to be written "[Name.With.Dots]", or Spring changes the key. Each entry has a name, the heading of the entry and the name of its box on the diagram, and tables, a regular expression over the whole table name with a named group entity (required) and a named group partition (optional, gives each entity its range), for example name: "id_<entity>_<yymm>" with tables: "id_(?<entity>.+)_(?<partition>\\d{4})". A table belongs to the first group that matches it. Only the matching tables of the most common shape - columns and primary key - are grouped; the others are documented apart from the group like any other table, and the entry says how many there are. Applied when a page is written. A pattern that is not a regular expression or has no group entity, a blank name, a name with *, and two groups of one component with one name stop the startup

An environment no entry names has no model-derived documentation. Its tree carries the root page and whatever was uploaded into it. An instance that reads no architecture model configures none of this, and starts.

Two things fail the startup. Both are configuration errors nobody would notice until a page was missing:

  • an entry naming an environment no site declares. It is a typo, and the tree it configures would never be generated;
  • a client-registration naming an entry that does not exist, when the instance has an OAuth2 client registry at all. Without the check, that is a failed build an hour later.

The architecture repository is not called while the service starts. It may be deploying, and an instance that refuses to boot because a neighbour is restarting cannot serve the documentation it already has.

The Governance Service​

Where the governance reports are read from. Instance-wide and not per environment, unlike the architecture model: a landscape has one Governance Service, and the governance site has no environments either. A blank url counts as no Governance Service configured, exactly like a missing one.

jeap:
doc:
governance:
url: https://internal.example.ch/governance-service
client-registration: doc-service
client:
connect-timeout: PT5S
read-timeout: PT30S
max-resource-size: 1MB
import:
cron: "0 55 6-20 * * MON-FRI"
PropertyDefaultDescription
jeap.doc.governance.url-Where the Governance Service is. On a platform giving a service two hostnames this is the internal one - see Security
jeap.doc.governance.client-registration-The spring.security.oauth2.client.registration entry the token is obtained with. Its client needs <system-name>_@governance-documentation_#read on the Governance Service's authorization server
jeap.doc.governance.client.connect-timeoutPT5SHow long the client waits for the connection
jeap.doc.governance.client.read-timeoutPT30SHow long the client waits for one response
jeap.doc.governance.client.retries2How often a failed request is tried again, so three attempts in all. Only a connection failure, a read timeout, a 5xx or a 429 is retried
jeap.doc.governance.client.retry-delayPT0.5SHow long to wait before the first retry, doubled for each further one
jeap.doc.governance.client.retry-jitterPT0.25SHow much the delay is varied, so that instances whose schedules fire together do not retry in lockstep
jeap.doc.governance.client.max-retry-delayPT2SThe longest a retry waits, however often the delay has been doubled
jeap.doc.governance.max-resource-size1MBThe largest systems index, rules index, system or rule resource that is stored. A bigger one is left where it is, with a warning naming it
jeap.doc.governance.import.cron0 55 6-20 * * MON-FRIWhen the Governance Service is imported as the safety net - the same minutes as its own reporting job, ten after its scoring. Empty means never - see the import and the scheduled jobs
jeap.doc.governance.excerpts.site-The site with content: governance the excerpts link into. Required where there is more than one such site, and not needed otherwise

An instance that configures no jeap.doc.governance.url reads no Governance Service and starts; it publishes no governance site. The Governance Service is not called while the service starts, for the same reason the architecture repository is not: it may be deploying.

The reactions​

What reacts to what at runtime, read from the reaction observer of each stage and drawn as the runtime views of a system, a component and a message. Off by default, because a platform may run no reaction observer at all. The published graph, viewer and Explorer are described in Reaction graphs.

jeap:
doc:
reactions:
enabled: true
environments:
dev:
url: https://internal.example.ch/reaction-observer-service
client-registration: doc-service
PropertyDefaultDescription
jeap.doc.reactions.enabledfalseWhether this instance imports reactions at all. Off registers no work, calls nothing and writes no state row. On with no environment configured fails the startup: without that, a platform with no observer and a property path with a typo would look the same and both import nothing quietly
jeap.doc.reactions.environments.<environment>.url-Where the reaction observer of that stage is - the internal hostname, as for the architecture repository. An environment no entry names has no reactions even with the flag on
jeap.doc.reactions.environments.<environment>.client-registration-The spring.security.oauth2.client.registration entry the token is obtained with. Its client needs <system-name>_@reactions_#read on that stage's authorization server - see Security. There is no other way to authenticate: the observer offers HTTP Basic and this service does not use it
jeap.doc.reactions.max-graph-size8MBThe largest reaction graph that is replicated. A bigger one is left where it is, with a warning naming it; nothing past the cap is read off the wire
jeap.doc.reactions.client.connect-timeoutPT5SHow long the client waits for the connection
jeap.doc.reactions.client.read-timeoutPT30SHow long the client waits for one response
jeap.doc.reactions.client.retries2How often a failed request is tried again, so three attempts in all. Only a connection failure, a read timeout, a 5xx or a 429 is retried
jeap.doc.reactions.client.retry-delayPT0.5SHow long to wait before the first retry, doubled for each further one
jeap.doc.reactions.client.retry-jitterPT0.25SHow much the delay is varied, so that instances whose schedules fire together do not retry in lockstep
jeap.doc.reactions.client.max-retry-delayPT2SThe longest a retry waits, however often the delay has been doubled

Enabling or disabling an observer for a site's environment changes reactionEnvironments in site.json. Because this shared navigation metadata participates in every part's content digest, the next build of each part rebuilds and republishes it once, including system parts without reactions. Explorer navigation appears only after the shell has successfully published its route and a reaction snapshot; a configured observer without an imported snapshot does not expose a navigation link.

The complete reaction snapshot is imported on jeap.doc.archrepo.import.cron, as one step of that import. An environment named here must also be named under jeap.doc.archrepo.environments, and the startup fails when it is not: the import runs the environments the architecture repository is configured for, and a runtime view is written onto the pages of a model. The other way round is a landscape - most stages have an architecture repository and no reaction observer.

Publishing and serving​

jeap:
doc:
publication:
url: https://doc.example.ch
refresh: PT10S
title: Example Documentation
PropertyDefaultDescription
jeap.doc.publication.url-The origin the documentation is published under, without a path. It is what the page metadata names - the canonical URL of a page, and its Open Graph tags
jeap.doc.publication.refreshPT10SHow often an instance re-reads which build of a site is the published one, so it picks up what another instance published without asking the database per file
jeap.doc.publication.titlethe default site's title, else the first site'sThe title beside the logo on every site of the instance - see Several sites in one header bar

The path below the origin is derived rather than configured: it is server.servlet.context-path, and below it the site. A path that has to agree with another value is computed, not written twice.

Several sites in one header bar​

An instance that serves more than one site shows one tab per site on the left of the header bar of every site, in configuration order, with the current site marked. A tab leads to the root of its site and shows the site's navigation-label, or its title where it sets none. On a narrow screen the tabs are in the navigation menu. The footer keeps its group of sites.

Beside the logo, every site shows the same title: jeap.doc.publication.title, or without it the title of the default site, or else of the first configured site. The title of a page in the browser keeps naming its own site, so a browser tab or a bookmark still says which site a page belongs to.

jeap:
doc:
publication:
title: Example Documentation
sites:
default:
title: System Documentation
navigation-label: Architecture
deployments:
title: Deployments

The tabs come from the configuration. A site added later appears on each other site with that site's next build, since sites do not ask each other to be built. An instance with one site shows no tabs, and unless it configures a title its header bar and its content are unchanged.

The generated sites are stored under jeap.doc.storage.site-prefix (sites by default) and are served to anyone who can reach the service - see Security.

Database​

The doc service persists on PostgreSQL with Flyway. The instance configures the connection, and it also chooses how the connection is authenticated: on AWS by adding jeap-spring-boot-postgresql-aws-starter, elsewhere with a user and a password.

spring:
datasource:
url: jdbc:postgresql://localhost:5432/docservice
username: docservice
password: ${DB_PASSWORD}

The migrations of the doc service live in jeap-doc-persistence under db/migration and are applied while the service starts.

A read replica is used where the instance has one (jeap.datasource.replica.enabled, from the PostgreSQL AWS starter). Only the reads behind what is shown and served go there: the published site, the site status, the parts listing, the live status and the import states. They may lag a moment. Every read that decides a write - a build, an import, an upload, a clean-up - stays on the primary. Without a replica everything runs on the primary.

API documentation​

The jEAP Swagger starter disables the OpenAPI endpoints by default. An instance switches them on where it wants them:

jeap:
swagger:
status: OPEN # or SECURED, with jeap.swagger.secured.username/password

Defaults the service sets itself​

The service ships jeapDocDefaultProperties.properties, contributed to the environment before the context is built - so a value read while the web server or the lifecycle processor is created sees it. An instance that sets any of these itself wins; they are defaults, not decisions.

PropertyValueWhy
jeap.web.headers.content-security-policya policy allowing only self and data:The documentation is self-contained and loads no external content
jeap.web.headers.additional-content-sourcesemptyThe web config starter would otherwise add the OAuth2 issuer's origin to the policy
jeap.web.headers.skip-path-prefixes/api/,/actuator/The starter's defaults are /api and -api, matched against the first path segment - and the default site's trees take one each. An environment called orders-api would otherwise be served with no security headers at all
jeap.web.headers.skip-path-suffixesemptyThe same
spring.jpa.open-in-viewfalsejEAP guideline
spring.task.scheduling.pool.size4A build runs on the scheduler for as long as jeap.doc.build.timeout allows; with one thread it would hold the only one and stop every cron trigger beside it. The architecture imports do not run on it - they queue on the doc service's own single import thread, so an import never holds a scheduler thread
spring.web.resources.add-mappingsfalseSpring Boot's catch-all /** resource handler is matched just ahead of the one that serves the documentation, and would answer for every page of it
server.shutdowngracefulAn upload is a bundle of up to 50MB; a deployment landing on one would make the client retry a transfer it had all but completed
spring.lifecycle.timeout-per-shutdown-phase20sAbove jeap.doc.build.shutdown-timeout, so giving up a running build is never the phase that is cut short. This is the number the platform's stop timeout is derived from - see Generation
server.compression.*on, from 1KBThe documentation is text throughout - the HTML and the bundles. An instance behind a compressing CDN can turn it off

The reaction graph size limit applies to the complete /api/v2/graphs response. Size it for the whole environment; an oversized replacement leaves the last valid snapshot available.