Skip to main content
Community Scripts logo

Architecture

The repositories behind Community Scripts and a map of every engine file, what it holds and who loads it.

Community Scripts is split across several repositories. The application scripts say what an application needs; one shared engine does the work.

RepositoryHolds
coreThe engine: Bash libraries, dialogs, host backends, in-container bootstrap, helper functions, telemetry client, header banners
ProxmoxVEThe released application scripts (ct/, install/), VM scripts (vm/) and tools (tools/)
DevScriptsNew application scripts while they are being tested
IncusThe application scripts for Incus hosts, plus Incus-only VMs and tools

No script repository contains engine code. Each script loads the engine from core when it starts.

How a run flows

ct/<app>.sh                          host
  └─ core/build.func                 find both roots, prefetch, detect platform
       ├─ ui/build-ui.func           dialogs; loads api, core, error handler, dev mode
       └─ pve/backend.func           or incus/build.func on Incus
            └─ build_container       create and start the container
                 └─ lxc/install.func + install/<app>-install.sh      container
                      └─ core/core.func, core/error_handler.func, lib/tools.func

The ct script never chooses a platform. core/build.func detects the host once and loads the matching backend; the dialogs and the in-container bootstrap are shared. The step-by-step order is on Runtime, and how files are found is on Loading.

Why the engine is separate

The engine and the scripts are resolved independently: a local checkout wins, then the Git origin of that checkout, then the published default. A fork of an application script therefore runs against the released engine, and an engine branch can be tested with the released scripts, without touching the other side.

It is also why DevScripts and Incus are repositories of their own and not branches of ProxmoxVE. A new script is tested in DevScripts against the same engine every other script uses and then moved to ProxmoxVE.

The engine's files

The engine consists of 36 .func files in nine folders. Paths are always written with the folder, because several folders contain a file of the same name.

core/ — runs everywhere

FileHoldsLoaded byDocs
core/build.funcEntry point of every ct script: the two source roots, _cs_source_func, prefetch, host probes, platform dispatchthe first lines of a ct scriptLoading
core/core.funcColours, msg_*, $STD/silent, prompts, host checks, cleanup_lxc, the update entry pointui/build-ui.func, incus/core.func, lxc/install.func, add-on scriptscore.func
core/error_handler.funccatch_errors, the ERR/EXIT/signal handlers, failure explanation and hintsui/build-ui.func, lxc/install.func, add-on scriptsError handling
core/dev-mode.funcparse_dev_mode, the dev context block, step timing, the dev-mode pickerui/build-ui.func; lxc/install.func when dev_mode is setDev mode

host/ — host-side helpers

FileHoldsLoaded byDocs
host/source-origin.funcTurns a checkout's Git remote and branch into a raw-content URLcore/build.func, only from a local engine checkoutLoading
host/validate.funcvalidate_mac_address, validate_vlan_tag, validate_mtuui/build-ui.func, pve/vm-core.func, incus/vm-core.funcWizard
host/preflight.funcOptional pre-flight checks for kernel keys, storage, bridge, DNS, quorum, LXC stack and templatesrun_preflight in ui/build-ui.func, only with ENABLE_PREFLIGHT=1below

ui/ — the install dialogs

FileHoldsLoaded byDocs
ui/build-ui.funcLoader of the dialog parts; variables, maxkeys_checkcore/build.func, incus/build.funcWizard
ui/menu.funcinstall_script, start, the settings and diagnostics menus, the update path and its guardsui/build-ui.funcWizard, Updates
ui/advanced.funcadvanced_settings, the Advanced Install dialogsui/build-ui.funcWizard
ui/defaults.funcbase_settings, default.vars and app defaults files, storage selection for defaultsui/build-ui.funcWizard
ui/validate.funcInput validation and IP helpers, SSH key installationui/build-ui.funcWizard

pve/ and incus/ — platform backends

FileHoldsLoaded byDocs
pve/backend.funcbuild_container, create_lxc_container, storage and template handling, the recovery menu, descriptioncore/build.func on everything that is not IncusPlatforms
pve/vm-core.funcEntry point of VM scripts on Proxmox VE: messages, dialogs and qm handlingvm/*.sh scriptsVM paths
pve/vm-app.funcbuild_app_vm: runs a container install script inside a VM imagenothing in the engine; a script has to source it itselfVM paths
incus/build.funcIncus entry: loads the shared dialogs and replaces the Proxmox-specific hookscore/build.func on Incus hosts and in Incus containersPlatforms
incus/core.funcIncus variants of the message, execution and error functionsincus/build.func, incus/tools.func, incus/vm-core.funcPlatforms
incus/backend.funcContainer creation and install on Incusincus/build.funcPlatforms
incus/tools.funcCompatibility aliases and Incus overrides on top of lib/tools.funcincus/build.funcPlatforms
incus/vm-core.funcVM creation on Incus (incus_vm_create)pve/vm-core.func when it runs on an Incus hostVM paths

vm/ — shared VM helpers

FileHoldsLoaded byDocs
vm/common.funcVM helpers that call neither qm nor incus: host tools, release assets, checksumspve/vm-core.func, incus/vm-core.funcVM paths
vm/cloud-init.funcCloud-Init setup for Proxmox VE VMsload_cloud_init_functions in pve/vm-core.funcVM paths

lxc/ — inside the container

FileHoldsLoaded byDocs
lxc/install.funcThe in-container bootstrap for all distributions: setting_up_container, network_check, update_os, motd_ssh, customize, the pkg_* and svc_* wrappersthe install script, from FUNCTIONS_FILE_PATHContainers
lxc/platform.funcdetect_lxc_platform, community_scripts_dircore/build.funcLoading

lib/ — install helpers

Scripts load lib/tools.func (or lib/alpine.func on Alpine) and get all parts.

FileHoldsLoaded byDocs
lib/tools.funcLoader of the five parts belowstart on the host, update_os in the container, add-on scriptsLibraries
lib/system.funcPackages, repositories, OS probes, services, temporary fileslib/tools.funcSystem helpers
lib/forge.funcGitHub, GitLab and Codeberg releases, tags and brancheslib/tools.funcReleases
lib/runtime.funcLanguage runtimes and application installerslib/tools.funcRuntimes
lib/db.funcDatabases and search engineslib/tools.funcDatabases
lib/hwaccel.funcGPU detection and hardware accelerationlib/tools.funcHardware acceleration
lib/alpine.funcHelper set for Alpine containersupdate_os on AlpineAlpine helpers

api/ — telemetry and error texts

FileHoldsLoaded byDocs
api/api.funcLoader of the four parts below; telemetry URL and payload versionui/build-ui.func, VM cores, add-on scriptsTelemetry
api/exitcodes.funcexplain_exit_code, categorize_errorapi/api.func; lxc/install.func in the containerExit codes
api/errorlog.funcThe .errinfo capture format, log filtering, build_error_stringapi/api.func; lxc/install.func in the containerError handling
api/sysinfo.funcWhich repository the script came from, and host factsapi/api.funcTelemetry
api/telemetry.funcpost_to_api, post_update_to_api, payload and deliveryapi/api.funcTelemetry

Pre-flight checks

host/preflight.func is not loaded in a normal run. It defines twelve checks that collect results instead of stopping at the first problem, and assign each failure an exit code:

CheckFails with
Kernel key limits for UID 100000107 (unreadable), 108 (near the limit)
A storage with rootdir content119
A storage with vztmpl content120
Free space for var_disk214
A vmbr* bridge116 (a missing vmbr0 alone is a warning)
DNS resolution222
Enterprise repository without subscriptionwarning only
Cluster quorum210
pve-container and lxc-pve installed231
A container ID can be allocated109
Template server reachable, or local templates present222
A template for var_os and var_version225

On current main setting ENABLE_PREFLIGHT=1 loads the file but the checks are not executed by the install flow: the wrapper in ui/build-ui.func looks for a function named run_preflight_full, and the file defines run_preflight. The kernel key check that always runs is maxkeys_check in ui/build-ui.func.

Rules that follow from this layout

  • A ct script loads core/build.func and nothing else from the engine.
  • An install script sources FUNCTIONS_FILE_PATH and nothing else.
  • Load lib/tools.func, ui/build-ui.func and api/api.func, not their parts. The loaders set the order the parts depend on.
  • Inside the engine, load files with _cs_source_func "<folder>/<file>", never with a fixed URL.

The technical reference lists load guards and the variables that make up the contract between host and container.