Skip to content

Commit b46f11a

Browse files
committed
fix: rename agent/master comm doc to agent/server and modernize content
- Rename subsystem_agent_master_comm.markdown to subsystem_agent_server_comm.markdown - Rewrite content to adopt Puppet docs structure: single numbered flow (steps 1-6), updated cert acquisition steps (CRL, CSR with dns_alt_names/csr_attributes, waitforcert behavior), cleaner keep-alive section, accurate intro - Replace outdated GIF diagram with Mermaid sequence diagram; remove old GIF files - Add Mermaid rendering support to head_end.html (CDN, pinned to 11.15.0) - Add package.json and Dependabot npm tracking for Mermaid version management - Update inbound links in architecture.markdown, ssl_attributes_extensions.markdown, and nav file; drop unnecessary ./ prefix per CONTRIBUTING.md link rules Signed-off-by: Michael Harp <mike@mikeharp.com>
1 parent 346be08 commit b46f11a

10 files changed

Lines changed: 187 additions & 121 deletions

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ updates:
88
time: "13:00"
99
open-pull-requests-limit: 10
1010

11+
# Raise PRs for npm (mermaid CDN version tracking)
12+
- package-ecosystem: npm
13+
directory: "/"
14+
schedule:
15+
interval: weekly
16+
time: "13:00"
17+
open-pull-requests-limit: 5
18+
1119
# Maintain dependencies for GitHub Actions
1220
- package-ecosystem: github-actions
1321
directory: "/"

_data/nav/openvox_8x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
- text: Details about OpenVox's internals
463463
items:
464464
- text: Agent/server HTTPS communications
465-
link: "subsystem_agent_master_comm.html"
465+
link: "subsystem_agent_server_comm.html"
466466
- text: Catalog compilation
467467
link: "subsystem_catalog_compilation.html"
468468
- text: Experimental features

_includes/jekyll_vitepress/head_end.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,23 @@
1010
});
1111
});
1212
</script>
13+
14+
<script type="module">
15+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11.15.0/dist/mermaid.esm.min.mjs';
16+
mermaid.initialize({ startOnLoad: false });
17+
18+
function renderMermaid() {
19+
const blocks = document.querySelectorAll('pre > code.language-mermaid');
20+
if (blocks.length === 0) return;
21+
blocks.forEach((el) => {
22+
const div = document.createElement('pre');
23+
div.className = 'mermaid';
24+
div.textContent = el.textContent;
25+
el.parentElement.replaceWith(div);
26+
});
27+
mermaid.run();
28+
}
29+
30+
document.addEventListener('turbo:load', renderMermaid);
31+
window.addEventListener('load', renderMermaid);
32+
</script>

docs/_openvox_8x/architecture.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Overview of OpenVox's architecture"
55

66
[agent_unix]: ./services_agent_unix.html
77
[agent_win]: ./services_agent_windows.html
8-
[https_walkthrough]: ./subsystem_agent_master_comm.html
8+
[https_walkthrough]: subsystem_agent_server_comm.html
99
[server_http]: ./http_api/http_api_index.html
1010
[auth.conf]: ./config_file_auth.html
1111
[catalog_compilation]: ./subsystem_catalog_compilation.html
-374 KB
Binary file not shown.
-288 KB
Binary file not shown.

docs/_openvox_8x/ssl_attributes_extensions.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: "SSL configuration: CSR attributes and certificate extensions"
44
---
55

6-
[cert_request]: ./subsystem_agent_master_comm.html#check-for-keys-and-certificates
6+
[cert_request]: subsystem_agent_server_comm.html#check-for-keys-and-certificates
77
[csr_attributes]: ./configuration.html#csrattributes
88
[confdir]: ./configuration.html#confdir
99
[autosign_policy]: ./ssl_autosign.html#policy-based-autosigning

docs/_openvox_8x/subsystem_agent_master_comm.markdown

Lines changed: 0 additions & 118 deletions
This file was deleted.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
title: "Subsystems: Agent/server HTTPS communications"
3+
layout: default
4+
---
5+
6+
[http_api]: http_api/http_api_index.html
7+
[authconf]: config_file_auth.html
8+
[facts]: lang_variables.html#facts-and-built-in-variables
9+
[catalog]: lang_summary.html#compilation-and-catalogs
10+
[file]: type.html#file
11+
[static]: indirection.html#catalog
12+
[keepalive_setting]: configuration.html#httpkeepalivetimeout
13+
14+
OpenVox agent and OpenVox Server communicate via mutually authenticated HTTPS using client
15+
certificates.
16+
17+
The available HTTPS endpoints are detailed in the [HTTP API reference][http_api]. Access to each
18+
endpoint is controlled by [auth.conf][authconf] settings.
19+
20+
## Persistent HTTP and HTTPS connections and Keep-Alive
21+
22+
When acting as an HTTPS client, OpenVox reuses connections by sending `Connection: Keep-Alive`
23+
in HTTP requests. This reduces transport layer security (TLS) overhead, improving performance
24+
for runs with dozens of HTTPS requests.
25+
26+
You can configure the Keep-Alive duration using the [`http_keepalive_timeout`
27+
setting][keepalive_setting], but it must be shorter than the maximum keepalive allowed by the
28+
OpenVox Server web server.
29+
30+
OpenVox caches HTTP connections and verified HTTPS connections. If you specify a custom HTTP
31+
connection class, OpenVox does not cache the connection.
32+
33+
OpenVox always requests that a connection be kept open, but the server can choose to close the
34+
connection by sending `Connection: close` in the HTTP response. If that occurs, OpenVox does not
35+
cache the connection and starts a new connection for its next request.
36+
37+
## Diagram
38+
39+
This sequence diagram illustrates the HTTPS requests an OpenVox agent makes to the OpenVox Server
40+
during a single agent run. See the sections below for a detailed description of each step.
41+
42+
```mermaid
43+
sequenceDiagram
44+
participant A as OpenVox Agent
45+
participant S as OpenVox Server
46+
47+
Note over A: 1. Check for keys and certificates
48+
49+
A->>S: GET /puppet/v3/node/NAME
50+
S-->>A: 2. Node object (environment)
51+
52+
A->>S: GET /puppet/v3/file_metadatas/plugins
53+
S-->>A: 3. Plugin metadata
54+
A->>S: GET /puppet/v3/file_content/plugins/FILE
55+
S-->>A: Plugin files
56+
57+
A->>S: POST /puppet/v3/catalog/NAME (facts as JSON)
58+
S-->>A: 4. Compiled catalog
59+
60+
A->>S: GET /puppet/v3/file_metadata/PATH
61+
S-->>A: 5. File metadata
62+
A->>S: GET /puppet/v3/file_content/PATH
63+
S-->>A: File content
64+
65+
A->>S: PUT /puppet/v3/report/NAME
66+
Note over S: 6. Report stored
67+
```
68+
69+
## The process of Agent-side checks and HTTPS requests during a single agent run
70+
71+
1. **Check for keys and certificates:**
72+
73+
a. The agent downloads the CA (Certification Authority) bundle.
74+
75+
b. If certificate revocation is enabled, the agent loads or downloads the Certificate
76+
Revocation List (CRL) bundle using the previous CA bundle to verify the connection.
77+
78+
c. The agent loads or generates a private key. If the agent needs a certificate, it generates
79+
a Certificate Signing Request (CSR), including any `dns_alt_names` and `csr_attributes`,
80+
and submits the request using `PUT /puppet-ca/v1/certificate_request/:certname`.
81+
82+
d. The agent attempts to download the signed certificate using
83+
`GET /puppet-ca/v1/certificate/:certname`.
84+
85+
* If there is a conflict that must be resolved on the OpenVox Server, such as cleaning the
86+
old CSR or certificate, the agent sleeps for `waitforcert` seconds, or exits with `1` if
87+
waiting is not allowed, such as when running `puppet agent -t`.
88+
89+
> **Tip:** This can happen if the agent's SSL directory is deleted, as the OpenVox Server
90+
> still has the valid, unrevoked certificate.
91+
92+
* If the downloaded certificate fails verification — for example, if it does not match its
93+
private key — OpenVox discards the certificate. The agent sleeps for `waitforcert`
94+
seconds, or exits with `1` if waiting is not allowed, such as when running
95+
`puppet agent -t`.
96+
97+
2. **Request a node object and switch environments:**
98+
99+
Do a GET request to `/puppet/v3/node/<NAME>`.
100+
101+
* If the request is successful, read the environment from the node object. If the node object
102+
has an environment, use that environment instead of the one in the agent's config file in all
103+
subsequent requests during this run.
104+
* If the request is unsuccessful, or if the node object had no environment set, use the
105+
environment from the agent's config file.
106+
107+
3. **If `pluginsync` is enabled on the agent, fetch plugins** from a file server mountpoint that
108+
scans the `lib` directory of every module:
109+
110+
* Do a GET request to `/puppet/v3/file_metadatas/plugins` with `recurse=true` and
111+
`links=manage`.
112+
* Check whether any of the discovered plugins need to be downloaded. If so, do a GET request
113+
to `/puppet/v3/file_content/plugins/<FILE>` for each one.
114+
115+
4. **Request catalog while submitting facts:**
116+
117+
Do a POST request to `/puppet/v3/catalog/<NAME>`, where the post data is all of the node's
118+
[facts][] encoded as JSON. Receive a compiled [catalog][] in return.
119+
120+
> **Note:** Submitting facts isn't logically bound to requesting a catalog. For more
121+
> information about facts, see [Language: Facts and built-in variables][facts].
122+
123+
5. **Make file source requests while applying the catalog:**
124+
125+
[File][] resources can specify file contents as either a `content` or `source` attribute.
126+
Content attributes go into the catalog, and the agent needs no additional data. Source
127+
attributes put only references into the catalog and might require additional HTTPS requests.
128+
129+
* If you are using the normal compiler, then for each file source, the agent makes a GET
130+
request to `/puppet/v3/file_metadata/<SOMETHING>` and compares the metadata to the state
131+
of the file on disk.
132+
* If it is in sync, it continues on to the next file source.
133+
* If it is out of sync, it does a GET request to `/puppet/v3/file_content/<SOMETHING>` for
134+
the content.
135+
* If you are using the [static compiler][static], all file metadata is embedded in the
136+
catalog. For each file source, the agent compares the embedded metadata to the state of the
137+
file on disk.
138+
* If it is in sync, it continues on to the next file source.
139+
* If it is out of sync, it does a GET request to
140+
`/puppet/v3/file_bucket_file/md5/<CHECKSUM>` for the current content.
141+
142+
The static compiler is cheaper in terms of network traffic, but potentially more expensive
143+
during catalog compilation. Large amounts of files, especially recursive directories, amplify
144+
the effect in both directions.
145+
146+
6. **Submit report:**
147+
148+
If `report` is enabled on the agent, do a PUT request to `/puppet/v3/report/<NAME>`. The
149+
content of the PUT should be a Puppet report object in YAML format.

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "openvox-docs",
3+
"private": true,
4+
"dependencies": {
5+
"mermaid": "11.15.0"
6+
}
7+
}

0 commit comments

Comments
 (0)