diff --git a/.gitignore b/.gitignore index 4e585782d..17db7b7d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Build artifacts cfdoc_log.markdown +/tmp/ +/output/ + # emacs *~ diff --git a/build-locally.sh b/build-locally.sh new file mode 100755 index 000000000..6a6ee17cf --- /dev/null +++ b/build-locally.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +# +# Build the CFEngine documentation locally in a Docker container. +# +# Self-contained: clones the sibling repos that the build expects +# (core, nova, enterprise, masterfiles, nt-docs) into ./tmp/ and runs +# the existing Docker-based pipeline against them, without requiring +# anything outside this directory. +# +# Override via env vars if needed: +# BRANCH branch name to build for (default: master) +# PACKAGE_JOB cf-remote or a buildcache job (default: cf-remote) +# PACKAGE_UPLOAD_DIRECTORY (default: n/a — unused with cf-remote) +# PACKAGE_BUILD (default: n/a — unused with cf-remote) +# LTS_VERSION (default: empty) +# DOCKER docker binary to use (default: docker) +# IMAGE_NAME tag for the build image (default: cfengine-docs-hugo) +# SKIP_PUBLISH=1 skip the _publish.sh step (just build) + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$SCRIPT_DIR" + +TMP_DIR="$SCRIPT_DIR/tmp" +CACHE_DIR="$TMP_DIR/cache" # persistent clones with .git +WORK_DIR="$TMP_DIR/work" # clean working copies (.git stripped) — what we mount +DOC_WORK="$WORK_DIR/documentation" +mkdir -p "$CACHE_DIR" "$WORK_DIR" + +BRANCH="${BRANCH:-master}" +PACKAGE_JOB="${PACKAGE_JOB:-cf-remote}" +PACKAGE_UPLOAD_DIRECTORY="${PACKAGE_UPLOAD_DIRECTORY:-n/a}" +PACKAGE_BUILD="${PACKAGE_BUILD:-n/a}" +LTS_VERSION="${LTS_VERSION:-}" +DOCKER="${DOCKER:-docker}" +IMAGE_NAME="${IMAGE_NAME:-cfengine-docs-hugo}" + +# repo_name url default_branch +REPOS=( + "core git@github.com:cfengine/core.git master" + "nova git@github.com:cfengine/nova.git master" + "enterprise git@github.com:cfengine/enterprise.git master" + "masterfiles git@github.com:cfengine/masterfiles.git master" + "nt-docs git@github.com:northerntechhq/nt-docs.git main" +) + +# 1. Clone (or update) the sibling repos under tmp/cache/, then export a +# clean working copy (no .git) to tmp/work/. We mount the .git-free +# copy because the container does `chmod -R` over each repo, and on +# macOS Docker bind mounts can't chmod git pack files written by the +# host user. +echo "==> Preparing sibling repos under $TMP_DIR" +for entry in "${REPOS[@]}"; do + # shellcheck disable=SC2086 + set -- $entry + name="$1"; url="$2"; default_branch="$3" + cache="$CACHE_DIR/$name" + work="$WORK_DIR/$name" + + if [ -d "$cache/.git" ]; then + echo " - $name: fetching latest" + git -C "$cache" fetch --quiet --tags origin + else + echo " - $name: cloning $url" + git clone --quiet "$url" "$cache" + fi + + if git -C "$cache" rev-parse --verify --quiet "origin/$BRANCH" >/dev/null; then + git -C "$cache" checkout --quiet -B "$BRANCH" "origin/$BRANCH" + else + echo " branch '$BRANCH' not found in $name; using '$default_branch'" + git -C "$cache" checkout --quiet -B "$default_branch" "origin/$default_branch" + fi + + # Export a clean snapshot for the container. Using `git archive` so + # we get exactly what's tracked, without .git or untracked junk. + rm -rf "$work" + mkdir -p "$work" + git -C "$cache" archive --format=tar HEAD | tar -x -C "$work" +done + +# 1b. Sync the documentation source itself into tmp/work/documentation. +# The build mutates files in place (sed on config.toml, cfdoc_preprocess.py +# rewriting markdown, etc.), so we must NOT bind-mount the user's checkout +# directly. Use rsync with --delete to keep the copy in sync (including +# uncommitted/untracked changes) without dragging tmp/ or .git into it. +echo "==> Syncing documentation source to $DOC_WORK" +mkdir -p "$DOC_WORK" +rsync -a --delete \ + --exclude='/tmp/' \ + --exclude='/.git/' \ + "$SCRIPT_DIR/" "$DOC_WORK/" + +# 2. Build the docker image (only if it's not already built). +if ! "$DOCKER" image inspect "$IMAGE_NAME" >/dev/null 2>&1; then + echo "==> Building docker image $IMAGE_NAME" + "$DOCKER" build --tag "$IMAGE_NAME" "$SCRIPT_DIR/generator/build" +else + echo "==> Reusing docker image $IMAGE_NAME (delete it to rebuild)" +fi + +# 3. Run the build inside the container. +# main.sh expects /nt/{documentation,core,nova,enterprise,masterfiles,nt-docs}. +# We bind-mount this checkout as /nt/documentation and each tmp/ as +# its sibling, so nothing outside this directory is touched. +echo "==> Running documentation build in container" +RUN_FLAGS=( + --rm + -v "$DOC_WORK:/nt/documentation" +) +for entry in "${REPOS[@]}"; do + # shellcheck disable=SC2086 + set -- $entry + RUN_FLAGS+=(-v "$WORK_DIR/$1:/nt/$1") +done + +"$DOCKER" run "${RUN_FLAGS[@]}" "$IMAGE_NAME" \ + bash -x documentation/generator/build/main.sh \ + "$BRANCH" "$PACKAGE_JOB" "$PACKAGE_UPLOAD_DIRECTORY" \ + "$PACKAGE_BUILD" "$LTS_VERSION" + +# 4. Optionally package the result (mirrors the Jenkins pipeline). +if [ -z "${SKIP_PUBLISH:-}" ]; then + echo "==> Packaging output" + "$DOCKER" run "${RUN_FLAGS[@]}" "$IMAGE_NAME" \ + bash -x documentation/generator/_scripts/_publish.sh "$BRANCH" +fi + +echo "==> Done. Generated site is in: $DOC_WORK/generator/_site" +echo " Tarballs (if packaged) are in: $DOC_WORK/output/" diff --git a/content/enterprise-cfengine-guide/Dashboard.png b/content/enterprise-cfengine-guide/Dashboard.png deleted file mode 100644 index f75432f06..000000000 Binary files a/content/enterprise-cfengine-guide/Dashboard.png and /dev/null differ diff --git a/content/enterprise-cfengine-guide/_index.markdown b/content/enterprise-cfengine-guide/_index.markdown deleted file mode 100644 index 47cbefcaa..000000000 --- a/content/enterprise-cfengine-guide/_index.markdown +++ /dev/null @@ -1,56 +0,0 @@ ---- -layout: default -title: CFEngine Enterprise -published: false -sorting: 3 -aliases: - - "/enterprise-cfengine-guide.html" ---- - -CFEngine Enterprise is an IT automation platform that uses a model-based approach to manage your infrastructure, and applications at WebScale while providing best-in-class scalability, security, enterprise-wide visibility and control. - -## Webscale IT automation - -CFEngine Enterprise provides a secure and stable platform for building and managing both physical and virtual infrastructure. Its distributed architecture, minimal dependencies, and lightweight autonomous agents enable you to manage 5,000 nodes from a single policy server. - -WebScale does not just imply large server deployments. The speed at which changes are conceived and committed across infrastructure and applications is equally important. Due to execution times measurable in seconds, and one of the most efficient verification mechanisms, CFEngine reduces exposure to unwarranted changes, and prevents extreme delays for planned changes that need to be applied urgently at scale. - -## Intelligent automation of infrastructure - -Automate your infrastructure with self-service capabilities. CFEngine Enterprise enables you to take advantage of agile, secure, and scalable infrastructure automation that makes repairs using a policy-based approach. - -## Policy-based application deployment - -Achieve repeatable, error-free and automated deployment of middleware and application components to a datacenter or cloud-based infrastructure. Along with infrastructure, automated application deployment provides a standardized platform. - -## Self-healing continuous operations - -Gain visibility into your infrastructure and applications, and be alerted to issues immediately. CFEngine Enterprise contains built-in inventory and reporting modules that automate troubleshooting and compliance checks, as well as remediate in a self-healing fashion. - -## CFEngine Enterprise features - -### User interface - -The CFEngine Enterprise Mission Portal provides a central dashboard for real-time monitoring, search, and reporting for immediate visibility into your environment's actual vs desired state. You can also use Mission Portal to set individual and group alerts and track system events that make you aware of specific infrastructure changes. - -Dashboard - -### Scalability - -CFEngine Enterprise has a simple distributed architecture that scales with minimal resource consumption. Its pull-based system eliminates the need for server-side processing, which means that a single policy server can concurrently serve up to 5,000 nodes doing 5 minute runs with minimal hardware requirements. - -### Configurable data feeds - -The CFEngine Enterprise `Mission Portal` provides System Administrators and Infrastructure Engineers with detailed information about the actual state of the IT infrastructure and how that compares with the desired state. - -### Federation and SQL reporting - -CFEngine Enterprise has the ability to create federated structures, in which parts of organizations can have their own configuration, while at the same time the central IT organization may impose some policy that is more global in nature. - -### Monitoring and reporting - -The CFEngine Enterprise Mission Portal contains continual reporting that details compliance with policy, repairs and any failures of hosts to match their desired state. - -### Role-based access control - -Users can be assigned roles that limit their access levels throughout the Mission Portal. diff --git a/content/enterprise-cfengine-guide/install-get-started.markdown b/content/enterprise-cfengine-guide/install-get-started.markdown deleted file mode 100644 index aea1946c0..000000000 --- a/content/enterprise-cfengine-guide/install-get-started.markdown +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: default -title: Install and get started -published: false -sorting: 10 -aliases: - - "/enterprise-cfengine-guide-install-get-started.html" ---- - - - -- [Installation][Install and Get Started#Installation] -- [Post-install configuration][Install and Get Started#Post-install configuration] - -## Installation - -The [General installation][General installation] instructions provide the detailed steps for installing CFEngine, which are generally the same steps to follow for CFEngine Enterprise, with the exception of license keys (if applicable), and also some aspects of post-installation and configuration. - -### Installing Enterprise licenses - -Before you begin, you should have your license key, unless you only -plan to use the free 25 node license. The installation instructions -will be provided with the key. - -## Post-install configuration - -### Change email setup after CFEngine Enterprise installation - -For Enterprise 3.6 local mail relay is used, and it is assumed the server has a proper mail setup. - -The default FROM email for all emails sent from the Mission Portal is `admin@organization.com`. This can be changed on the CFE Server in `/var/cfengine/httpd/htdocs/application/config/appsettings.php:$config['appemail']`. - -### Version your policy - -Consider enabling the built-in version control of your policy as -described in -[Version control and configuration policy][Best practices#Version control and configuration policy] - -Whether you do or not, please put your policy in some kind of -backed-up VCS. Losing work because of "fat fingering" `rm` commands is -very, very depressing. - -### Configure collection for monitoring data - -[Measurements][Measurements app] allows you to sample a metric and assess its value -across your hosts over time. Collection of monitoring information is disabled by -default. Metrics must match `monitoring_include` in the appropriate -`report_data_select` body. -The [Masterfiles Policy Framework][Masterfiles Policy Framework] uses `body -report_data_select default_data_select_policy_hub` to specify metrics that -should be collected from policy hubs and `default_data_select_host` to specify -metrics that should be collected from non hubs. Augments can be used to [configure which metrics should be collected][Masterfiles Policy Framework#Configure Enterprise Measurement/Monitoring Collection] for central reporting. - -### Review settings - -See the [Masterfiles Policy Framework][Masterfiles Policy Framework] for a full -list of all the settings you can configure. diff --git a/content/examples/tutorials/policy-writing/external_data.markdown b/content/examples/tutorials/policy-writing/external_data.markdown index 207747cbc..d2d94f503 100644 --- a/content/examples/tutorials/policy-writing/external_data.markdown +++ b/content/examples/tutorials/policy-writing/external_data.markdown @@ -14,7 +14,7 @@ with other infrastructure components like a CMDB. CFEngine can load structured data defined in JSON, YAML, CSV using the `readjson()`, `readyaml()`, `readcsv()` and `readdata()` functions or by custom -parsing with `data_resdstringarray()` and `data_readstringarrayidx()`. +parsing with `data_readstringarray()` and `data_readstringarrayidx()`. Additionally CFEngine provides the [augments file][Augments] as a way to define variables and classes that are available from the beginning of policy evaluation. diff --git a/content/guide/CFEngine-workflow-agents-and-users.png b/content/guide/CFEngine-workflow-agents-and-users.png deleted file mode 100644 index 6a7f2488a..000000000 Binary files a/content/guide/CFEngine-workflow-agents-and-users.png and /dev/null differ diff --git a/content/guide/DCsketchworkflow.png b/content/guide/DCsketchworkflow.png deleted file mode 100644 index c0abb2aaa..000000000 Binary files a/content/guide/DCsketchworkflow.png and /dev/null differ diff --git a/content/guide/_index.markdown b/content/guide/_index.markdown deleted file mode 100644 index 882bb2b2e..000000000 --- a/content/guide/_index.markdown +++ /dev/null @@ -1,78 +0,0 @@ ---- -layout: default -title: Guide -published: false -sorting: 20 -aliases: - - "/guide.html" ---- - -CFEngine is a configuration management system that provides a framework for automated management of IT infrastructure. - -CFEngine is decentralized and highly scalable. It is powered by autonomous agents that can continuously monitor, self-repair, and update or restore an entire IT system, with negligible impact on system resources or performance. - -See also: [Overview][Overview] - -## CFEngine features - -- Defines the configuration of an entire IT system, including: Devices, Users, Applications, and Services. -- Helps maintain that system over time. -- Checks the system state at any given moment. -- Ensures compliance with a desired system state. -- Propagates real-time modifications or updates across the system. - -## Choose a CFEngine version - -[CFEngine Enterprise](https://cfengine.com/product-overview/) is a licensed edition for enterprises that plan to use the tool in production environments. The Enterprise edition comes in several variants, including one that can be evaluated for free (up to 25 servers). - -- [Get the Enterprise Edition][evaluate cfengine] - -CFEngine Community, a free GPL v3 open source edition. - -- [Get the Community Edition][community download page] - -See also: - -- [Supported platforms and versions][Supported platforms and versions] - -## Install it - -{{< CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown) >}} - -See [Installation][Installation] for a more detailed guide on how to get -CFEngine up and running for various environments. - -## Try it - -Walk through the examples, tutorials and how to guides to get a better -feel for the power and value of CFEngine: - -- [Policy Examples and tutorials][Examples and tutorials] - -## Learn more - -Take a look at the [Getting started][] section to learn more about CFEngine's architecture and components, as well as how to write policy that can help manage IT systems. - -Check out [External resources][External resources], for more guides, demos, and other resources from our CFEngine staff and our special CFEngine contributors. - -## Use our help - -[Support and community][External Resources#Support and community] We provide a number of ways to connect you to CFEngine -experts if you need more help. Contact us! - -## CFEngine guide - -- [Overview][] -- [Release notes][] -- [Installation][] - - [Pre-installation checklist] - - [General installation] - - [Upgrading] - - [Secure bootstrap] -- [Writing and serving policy][Policy writing] - - [Language concepts][] - - [Promises available in CFEngine][] - - [Authoring policy tools & workflow][] -- [Reports][] -- [FAQ][] -- [External Resources][] diff --git a/content/guide/components-overview.graffle b/content/guide/components-overview.graffle deleted file mode 100644 index dd394e50c..000000000 --- a/content/guide/components-overview.graffle +++ /dev/null @@ -1,642 +0,0 @@ - - - - - ActiveLayerIndex - 0 - ApplicationVersion - - com.omnigroup.OmniGrafflePro - 139.16.0.171715 - - AutoAdjust - - BackgroundGraphic - - Bounds - {{0, 0}, {576, 733}} - Class - SolidGraphic - ID - 2 - Style - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - BaseZoom - 0 - CanvasOrigin - {0, 0} - ColumnAlign - 1 - ColumnSpacing - 36 - CreationDate - 2013-03-05 12:51:39 +0000 - Creator - tobrien - DisplayScale - 1 0/72 in = 1 0/72 in - GraphDocumentVersion - 8 - GraphicsList - - - Class - LineGraphic - Head - - ID - 9 - - ID - 39 - Points - - {324.52771608688403, 411.5117419899305} - {229.47228391311592, 444.55146726367815} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - LineType - 1 - TailArrow - 0 - - - Tail - - ID - 34 - Info - 1 - - - - Class - LineGraphic - Head - - ID - 5 - - ID - 38 - Points - - {326, 410.99999999999994} - {229, 308.00986842105215} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - LineType - 1 - TailArrow - 0 - - - Tail - - ID - 34 - Info - 1 - - - - Bounds - {{325, 440.54275623120753}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 35 - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-runagent} - - - - Bounds - {{325, 389.37500000000045}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 34 - Magnets - - {-0.48850574712643668, 0.060443307757871878} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-server} - - - - Bounds - {{325, 338.20723684210526}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 33 - Magnets - - {-0.49065420560747675, 0.021739130434781373} - {0.48850574712643668, -0.038874680306905773} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-monitord} - - - - Bounds - {{325, 287.03947368421007}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 32 - Magnets - - {-0.48130841121495327, 0.043478260869564522} - {0.5, 0.043478260869564522} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-agent} - - - - Bounds - {{325, 235.87169551849377}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 31 - Magnets - - {-0.49065420560747675, 0.021739130434782261} - {0.5, -0.033503836317138713} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-execd} - - - - Class - LineGraphic - Head - - ID - 5 - Info - 1 - - ID - 15 - Points - - {141.61993078420883, 357.31891639871981} - {112, 332} - {141.60164142987483, 309.54557972944986} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - LineType - 1 - TailArrow - FilledArrow - - - Tail - - ID - 6 - Info - 1 - - - - Class - LineGraphic - Head - - ID - 4 - - ID - 14 - Points - - {141.61759139577896, 306.31793439216744} - {108, 278} - {141.57730772849646, 256.78410255466969} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - LineType - 1 - TailArrow - FilledArrow - - - Tail - - ID - 5 - - - - Bounds - {{142, 440.54275623120753}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 9 - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-runagent} - - - - Bounds - {{142, 389.37500000000045}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 7 - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-server} - - - - Bounds - {{142, 338.20723684210526}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 6 - Magnets - - {-0.49065420560747675, 0.021739130434781373} - {0.48850574712643668, -0.038874680306905773} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-monitord} - - - - Bounds - {{142, 287.03947368421007}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 5 - Magnets - - {-0.48130841121495327, 0.043478260869564522} - {0.5, 0.043478260869564522} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-agent} - - - - Bounds - {{142, 235.87169551849377}, {87, 38.585526315789458}} - Class - ShapedGraphic - ID - 4 - Magnets - - {-0.49065420560747675, 0.021739130434782261} - {0.5, -0.033503836317138713} - - Shape - Rectangle - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 cf-execd} - - - - Bounds - {{122, 204}, {128, 286}} - Class - ShapedGraphic - ID - 40 - Shape - Rectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 Host 1} - - TextPlacement - 0 - - - Bounds - {{305, 205}, {128, 286}} - Class - ShapedGraphic - ID - 41 - Shape - Rectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs24 \cf0 Host 2} - - TextPlacement - 0 - - - GridInfo - - GuidesLocked - NO - GuidesVisible - YES - HPages - 1 - ImageCounter - 2 - KeepToScale - - Layers - - - Lock - NO - Name - Layer 1 - Print - YES - View - YES - - - LayoutInfo - - Animate - NO - circoMinDist - 18 - circoSeparation - 0.0 - layoutEngine - dot - neatoSeparation - 0.0 - twopiSeparation - 0.0 - - LinksVisible - NO - MagnetsVisible - NO - MasterSheets - - ModificationDate - 2013-03-05 12:59:16 +0000 - Modifier - tobrien - NotesVisible - NO - Orientation - 2 - OriginVisible - NO - PageBreaks - YES - PrintInfo - - NSBottomMargin - - float - 41 - - NSHorizonalPagination - - coded - BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG - - NSLeftMargin - - float - 18 - - NSPaperSize - - size - {612, 792} - - NSPrintReverseOrientation - - int - 0 - - NSRightMargin - - float - 18 - - NSTopMargin - - float - 18 - - - PrintOnePage - - ReadOnly - NO - RowAlign - 1 - RowSpacing - 36 - SheetTitle - Canvas 1 - SmartAlignmentGuidesActive - YES - SmartDistanceGuidesActive - YES - UniqueID - 1 - UseEntirePage - - VPages - 1 - WindowInfo - - CurrentSheet - 0 - ExpandedCanvases - - - name - Canvas 1 - - - Frame - {{643, 266}, {930, 872}} - ListView - - OutlineWidth - 142 - RightSidebar - - ShowRuler - - Sidebar - - SidebarWidth - 120 - VisibleRegion - {{-110, 0}, {795, 733}} - Zoom - 1 - ZoomValues - - - Canvas 1 - 1 - 1 - - - - - diff --git a/content/guide/components-overview.png b/content/guide/components-overview.png deleted file mode 100644 index 8a8ff850f..000000000 Binary files a/content/guide/components-overview.png and /dev/null differ diff --git a/content/guide/design-center/Activated-sketch-copy.png b/content/guide/design-center/Activated-sketch-copy.png deleted file mode 100644 index 8409db70e..000000000 Binary files a/content/guide/design-center/Activated-sketch-copy.png and /dev/null differ diff --git a/content/guide/design-center/add-new-tracker-copy.png b/content/guide/design-center/add-new-tracker-copy.png deleted file mode 100644 index 7b1c3a0c7..000000000 Binary files a/content/guide/design-center/add-new-tracker-copy.png and /dev/null differ diff --git a/content/guide/learn_CFEngine-process-in-1-2-3_blocks_with_arrows.png b/content/guide/learn_CFEngine-process-in-1-2-3_blocks_with_arrows.png deleted file mode 100644 index 68c161b2e..000000000 Binary files a/content/guide/learn_CFEngine-process-in-1-2-3_blocks_with_arrows.png and /dev/null differ diff --git a/content/guide/policy-decision-flow.png b/content/guide/policy-decision-flow.png deleted file mode 100644 index 4655faa54..000000000 Binary files a/content/guide/policy-decision-flow.png and /dev/null differ diff --git a/content/reference/components/_index.markdown b/content/reference/components/_index.markdown index 646f875c8..64f57cebe 100644 --- a/content/reference/components/_index.markdown +++ b/content/reference/components/_index.markdown @@ -430,7 +430,7 @@ string is also prefixed messages in the event log. **Description:** List of package module bodies to query for package lists. Defines the list of [`package module bodies`][packages] which will be queries for -package lists, for use in `packagematching()`, `packageupdatesmatching()` and in +package lists, for use in `packagesmatching()`, `packageupdatesmatching()` and in Enterprise inventory reporting. **Type:** `slist` diff --git a/content/reference/promise-types/packages.markdown b/content/reference/promise-types/packages.markdown index e24874335..28ea995f1 100644 --- a/content/reference/promise-types/packages.markdown +++ b/content/reference/promise-types/packages.markdown @@ -733,12 +733,10 @@ The full path to the MSI package file must be supplied in order to promise the package is installed. In order to promise a package is absent (not installed) the package name must be used. -**Example**: install [Google Chrome][] but prevent it from self-upgrading +**Example**: install Google Chrome but prevent it from self-upgrading (otherwise Google Chrome's self-upgrading will conflict with CFEngine ensuring that version from this particular MSI is installed): -[Google Chrome]: https://cloud.google.com/chrome-enterprise/browser/download/#chrome-browser-update - ```cf3 {skip TODO} packages: windows:: diff --git a/generator/_references.md b/generator/_references.md index 5f992a0b5..d52fae0d2 100644 --- a/generator/_references.md +++ b/generator/_references.md @@ -70,3 +70,4 @@ [getgrnam()]: https://linux.die.net/man/3/getgrnam [getpwuid()]: https://linux.die.net/man/3/getpwuid [getpwnam()]: https://linux.die.net/man/3/getpwnam +[select()]: https://linux.die.net/man/3/select diff --git a/generator/_scripts/cfdoc_linkresolver.py b/generator/_scripts/cfdoc_linkresolver.py index bf90c8f64..5b7785a87 100644 --- a/generator/_scripts/cfdoc_linkresolver.py +++ b/generator/_scripts/cfdoc_linkresolver.py @@ -237,12 +237,21 @@ def applyLinkMap(file_name, config): for markdown_line in markdown_lines: config["context_current_line_number"] += 1 # we ignore everything in code blocks - if previous_empty or in_pre: - if markdown_line.lstrip()[:3] == "```": - in_pre = not in_pre - if markdown_line[:4] == " ": - new_lines.append(markdown_line) - continue + # triple-backtick fences must be detected on every line, not only after + # a blank line, otherwise content inside the block gets autolinked + if markdown_line.lstrip()[:3] == "```": + in_pre = not in_pre + new_lines.append(markdown_line) + previous_empty = False + continue + if in_pre: + new_lines.append(markdown_line) + previous_empty = markdown_line.lstrip() == "" + continue + if previous_empty and markdown_line[:4] == " ": + new_lines.append(markdown_line) + previous_empty = False + continue # don't link to the current section if markdown_line.find("title:") == 0: diff --git a/generator/_scripts/cfdoc_references_resolver.py b/generator/_scripts/cfdoc_references_resolver.py index 4f6071936..f511a5aaa 100644 --- a/generator/_scripts/cfdoc_references_resolver.py +++ b/generator/_scripts/cfdoc_references_resolver.py @@ -35,16 +35,39 @@ def load_references(references_file): return references -def process(file_path, references): - """Process a markdown file and replace reference links with direct links.""" +def process(file_path, references, missing): + """Process a markdown file and replace reference links with direct links. + + Any reference that cannot be resolved is appended to `missing` as a + (file_path, ref) tuple so the caller can fail the build. + + Code content is skipped so that things that look like reference links but + aren't (CFEngine array notation `a[b][c]`, sample output `[1][0]`, etc.) + don't get treated as broken `[text][ref]` links: + * Triple-backtick fenced code blocks — common when snippets are pulled + in from the core repo via macros. + * Inline single-backtick code spans on a single line. + + Function-name autolinking (``foo()``) is the inverse: it deliberately + targets backtick-quoted text, so it runs on every non-fenced line. + """ with open(file_path, "r", encoding="utf-8") as f: - content = f.read() + lines = f.readlines() # Pattern to match reference links: [`text`][reference] - pattern = r"\[(.*?)\]\[(.*?)\]" + pattern = re.compile(r"\[(.*?)\]\[(.*?)\]") + # finds functions except ones already processed inside [] + functions_pattern = re.compile(r"(?