Private
Public Access
1
0
Commit Graph

215 Commits

Author SHA1 Message Date
904654212f fix: remove all Alpine cleanup steps that broke abuild
- Revert build-alpine.sh to original (no cleanup lines)
- Remove CI Alpine cleanup step entirely
- Keep version verification and exact version upload in CI
- The original build worked fine without cleanup; stale packages
  are caught by version verification
2026-05-27 20:44:16 -05:00
1fb9962c22 fix: remove mkdir -p from Alpine cleanup that broke abuild
- Remove mkdir -p /home/builduser/packages/home/x86_64/ that was creating
  root-owned directories that abuild (running as builduser) couldnt write to
- Keep targeted rm -f of stale .apk files only
- abuild creates its own output directories with correct ownership
2026-05-27 20:42:48 -05:00
f1602fde4c fix: preserve abuild directory structure in Alpine cleanup
- Replace aggressive rm -rf /home/builduser/packages/ with targeted rm -f of stale .apk files
- Add mkdir -p to ensure abuild output directory exists before build
- Fixes Alpine CI build failure caused by removing required directory structure
2026-05-27 20:21:23 -05:00
0ffdb0eb2d fix: correct Alpine version bug and add Ubuntu 24.04 package suffix
- Alpine: clean entire /home/builduser/packages/ before abuild (not just releases/)
- Alpine: add version verification step to CI (like RPM already has)
- Alpine: upload uses exact version match instead of head -1
- Debian: add u2404 suffix to build-deb output filename
- Remove duplicate 1.1.12 entry from debian/changelog
2026-05-27 19:58:35 -05:00
5a6165a7fe fix: remove stale build artifacts from releases/ and add cleanup to Alpine build
- Add /releases/ to .gitignore to prevent tracking build artifacts
- Remove old 1.0.0 .deb files from git tracking
- Add stale .apk cleanup to build-alpine.sh (matching build-arch.sh)
- Add cleanup step to CI Alpine workflow to remove stale packages

Fixes Alpine package version mismatch caused by old artifacts in releases/
2026-05-27 17:02:32 -05:00
fa01785632 fix: update debian changelog and RPM spec to v1.1.17 2026-05-27 16:17:10 -05:00
2aa504c087 Merge pull request 'fix: add package cache refresh before apply and on health check (#2)' (#3) from fix/package-cache-refresh into master
Reviewed-on: #3
2026-05-27 15:22:07 -05:00
cc67edab12 fix: resolve CI failures (fmt, clippy, tests)
- Fix rustfmt formatting in cache.rs, patches.rs, system.rs, routes.rs, main.rs
- Add Default impl for PackageCacheState (clippy new_without_default)
- Change apply_with_cache_retry generic bound from Fn to FnMut
- Add mut to refresh_fn parameter for FnMut compatibility
- Replace bool comparison with ! operator (clippy bool_comparison)
- Update todo.md with completed status
2026-05-27 15:04:25 -05:00
135c91d256 fix: add package cache refresh before apply and on health check
- New src/packages/cache.rs module with PackageCacheState, stale detection,
  state persistence, 404 retry logic
- Add refresh_package_cache() and last_cache_update() to PackageManagerBackend
  trait, implemented on all 5 backends (APT, DNF, YUM, APK, Pacman)
- Health check now reports last_cache_update and cache_status fields,
  triggers cache refresh if stale (>4h), returns degraded on failure
- Patch apply jobs now force cache refresh before applying patches,
  with 404/fetch error retry (1 retry after cache refresh)
- Cache state persists to /var/lib/linux_patch_api/state/cache.json
- Version bump to 1.1.17
- Update ARCHITECTURE.md and REQUIREMENTS.md (FR-007)

Closes: #2
2026-05-27 14:33:12 -05:00
7f5b0c2313 fix: update repo paths from echo/ to git-echo/ after account migration 2026-05-21 17:05:47 +00:00
6fab250ea8 feat: add Pacman backend for Arch Linux, fix Arch CI stale packages 2026-05-20 22:24:06 +00:00
58ad92d431 style: fix rustfmt formatting for DNF/YUM backend 2026-05-20 20:59:55 +00:00
d682c7c69c feat: add DNF and YUM package manager backends for RPM-based systems 2026-05-20 20:54:38 +00:00
ee46c48c0b fix: RPM packaging - pre-build binary, fix ownership, fix deps, prevent stale cache 2026-05-20 19:45:38 +00:00
21d01179d6 docs: update changelog for v1.1.13 2026-05-20 18:54:33 +00:00
1e4c8e4dc2 fix: detect apk at /sbin/apk on Alpine (not just /usr/bin/apk); v1.1.13 2026-05-20 18:54:10 +00:00
891ca09f34 feat: Add APK (Alpine Linux) package manager backend; machine-id generation; OpenRC fix; v1.1.12 2026-05-20 17:25:21 +00:00
551d73204f docs: add Alpine packaging root cause analysis and access lesson 2026-05-20 15:59:49 +00:00
07a073fb28 fix: OpenRC init script - change ownership from linux-patch-api:linux-patch-api to root:root
The system user was removed from all install scripts but the OpenRC init script
still referenced linux-patch-api:linux-patch-api in checkpath. This would cause
the service to fail on Alpine because the user does not exist.
2026-05-20 14:57:53 +00:00
b8900d1eae fix: Alpine install scripts - use separate files with valid abuild suffixes
Root cause: .apk-install is not a valid abuild suffix (lines 247-257 of abuild).
abuild expects SEPARATE files: pkgname.pre-install, .post-install, .pre-deinstall, .post-deinstall.
The old single .apk-install file caused abuild to die with "unknown install script suffix",
but CI used || true which masked the failure, so APK was built WITHOUT install scripts.

Verified on actual Alpine runner: install script suffixes now pass abuild validation.

- configs/linux-patch-api.pre-install: create dirs, set permissions (matches Debian preinst)
- configs/linux-patch-api.post-install: copy example configs, enable service (matches Debian postinst)
- configs/linux-patch-api.pre-deinstall: stop and disable service (matches Debian prerm)
- configs/linux-patch-api.post-deinstall: clean up empty dirs (matches Debian postrm)
- Removed configs/linux-patch-api.apk-install (invalid format)
- Updated build-alpine.sh: copy 4 install scripts to workspace, updated install= line in APKBUILD
2026-05-20 12:43:37 +00:00
dfc2370540 release: bump version to 1.1.9 for non-Ubuntu package fixes 2026-05-20 02:54:09 +00:00
1dfea9bbde fix: comment out RPM BuildRequires for CI (rustup not RPM), fix changelog date 2026-05-20 02:32:31 +00:00
aa721963b3 docs: add detailed Arch, RPM, Alpine installation instructions
- README: comprehensive per-platform install/build/verify/remove instructions
- README: prerequisites, post-install notes, Alpine OpenRC differences
- BUILD_PACKAGES: add Arch and Alpine build sections with troubleshooting
- BUILD_PACKAGES: fix Service Account table (runs as root, not system user)
- BUILD_PACKAGES: add Arch/Alpine supported distributions tables
2026-05-20 02:06:52 +00:00
63b0bfce34 fix: align all non-Ubuntu packages with Debian baseline behavior
- Arch: remove system user creation, root:root ownership, fix $startdir path in PKGBUILD
- RPM: uncomment BuildRequires, add runtime deps (openssl-libs, ca-certificates), remove system user, root:root ownership
- Alpine: remove system user creation, root:root ownership, co-locate install script with APKBUILD
- All platforms now match Debian: no system user, root:root, create dirs, copy example configs, enable service
2026-05-20 02:01:52 +00:00
f428a7cc1e release: bump version to 1.1.8 2026-05-19 00:34:21 +00:00
45e28e8911 fix: Arch build - install script filename must match PKGBUILD install= reference 2026-05-19 00:21:59 +00:00
f3fb84927a style: fix rustfmt formatting for CI 2026-05-18 23:54:15 +00:00
b6809dc935 fix: FQDN resolution and display_name blank bug; fix: Arch/Alpine/RPM packages
Bug fixes:
- get_fqdn() now prioritizes 'hostname -f' (returns full FQDN) over /etc/hostname (returns short hostname)
- Added get_hostname() for short hostname extraction
- Added hostname field to EnrollmentRequest for manager display_name population
- Updated SPEC.md and API_DOCUMENTATION.md

Package fixes:
- Arch: Added linux-patch-api.install with post_install/upgrade/remove hooks, user creation, directory creation, config handling
- Alpine: Added linux-patch-api.apk-install with pre/post install/deinstall hooks, user creation, directory creation, config handling, missing config.yaml.example
- RPM: Dynamic version from Cargo.toml, %ghost %config(noreplace) for live configs, tarball exclusions, /var/log in %files
2026-05-18 23:51:00 +00:00
13da27364b fix(ci): add cargo clean and artifact removal before packaging; bump to 1.1.7
- Insert 'Clean previous build artifacts' step (cargo clean + rm old .deb)
  before Build Debian package in both build-deb and build-deb-u2204 jobs.
- Bump version to 1.1.7 to ensure a clean build from scratch.
- Update debian/changelog with 1.1.7-1 entry.
2026-05-18 17:18:11 +00:00
6f6be7ef0c fix(certs): replace encrypted CA with unencrypted ECDSA P-256 CA
- Replaced password-protected RSA CA with unencrypted ECDSA P-256 CA
  to prevent manager startup failures from encrypted keys.
- Regenerated server and client certificates (client001) with new CA.
- Updated CA_SETUP.md to use openssl genpkey (unencrypted) instead of
  openssl genrsa -aes256, with warning against encrypted keys.
2026-05-18 16:00:22 +00:00
6a41eba9d8 fix(server): add explicit rustls CryptoProvider initialization for v1.1.6
- Add rustls::crypto::aws_lc_rs::default_provider().install_default()
  in main() before any TLS operations to prevent startup panic
- Bump version from 1.1.5 to 1.1.6
- Update debian/changelog with 1.1.6-1 entry
2026-05-18 13:43:34 +00:00
20b214eb9f style: fix cargo fmt in enroll_identity tests 2026-05-18 12:29:22 +00:00
48fb8752c9 feat(enrollment): add route-based IP selection and fix package versioning for v1.1.5 2026-05-18 03:35:46 +00:00
d4f9f1bf7f fix(clippy): remove needless return in Docker-compatible test 2026-05-18 02:11:45 +00:00
0de47b966b style: apply cargo fmt formatting 2026-05-18 02:06:25 +00:00
64187b03bd fix(enrollment): filter Docker bridge IPs and add report_interface/report_ip config
- identity.rs: filter 172.16.0.0/12 (Docker bridge) and 169.254.0.0/16 (link-local)
  from get_ip_addresses() auto-detection
- identity.rs: add is_container_bridge(), is_link_local(),
  get_ip_for_interface(), get_primary_ip() functions
- client.rs: add report_interface/report_ip fields to EnrollmentClient,
  new with_ip_overrides() constructor, register() uses get_primary_ip()
- loader.rs: add report_interface/report_ip to EnrollmentConfig
- mod.rs: wire config overrides through to EnrollmentClient
- config.yaml.example: document new report_interface/report_ip options
- Tests: add 18 new bridge filtering/IP override tests, fix Docker
  container compatibility in existing tests
2026-05-18 02:02:54 +00:00
f5eb2286a9 fix(tests): update test suite for AppConfig::load signature change 2026-05-17 22:28:17 +00:00
f57d92406f fix(enroll): skip TLS validation during enrollment bootstrap to allow certificate acquisition 2026-05-17 22:20:48 +00:00
286f9059e2 fix(ci): use github.ref_type for upload conditions to fix Gitea runner compatibility 2026-05-17 21:05:43 +00:00
c3cde6745d fix(ci): force IPv4 for rustup download on Alpine runner 2026-05-17 20:35:48 +00:00
1dc49bb76a fix(ci): add openssl runtime package for Alpine musl builds 2026-05-17 18:40:47 +00:00
175c21600c fix(ci): disable reqwest default features to eliminate OpenSSL on musl builds
Requiring default-features=false on reqwest prevents native-tls/openssl-sys
from being pulled in as transitive dependencies, which broke static linking
on Alpine musl target. Also reverts invalid openssl-static package from CI.

- Cargo.toml: add default-features = false to reqwest dependency
- ci.yml: revert non-existent openssl-static package
2026-05-17 17:18:35 +00:00
5082c21403 fix(ci): add openssl-static for Alpine musl static linking
The Alpine build job links against musl which requires static OpenSSL
libraries. Adding openssl-static package to resolve -lssl and -lcrypto
linker errors.
2026-05-17 17:07:10 +00:00
f2214e3eb4 fix(ci): add OpenSSL dev dependencies to all build jobs
Add libssl-dev to Ubuntu-based runners and openssl-devel to Fedora runner
to resolve openssl-sys crate compilation failures in CI pipeline.

- clippy, test, audit: +libssl-dev
- enrollment-tests, verify-enrollment-cli: +libssl-dev
- build-deb, build-deb-u2204: +libssl-dev
- build-rpm (Fedora): +openssl-devel
2026-05-17 16:48:43 +00:00
8bfa5f2273 fix(tests): resolve all clippy warnings for CI compliance
- Remove needless borrows on format!() in set_body_string() calls (needless_borrows_for_generic_args)
- Replace assert!(false, ...) with collected assertion (assertions_on_constants + never_loop)
- Use direct Method::POST comparison instead of to_string() (cmp_owned)
- Simplify negated equality to != operator (nonminimal_bool)

CI pipeline now passes with -D warnings enabled
2026-05-17 16:02:57 +00:00
a08145ed9e fix: add truncate(true) to lock file OpenOptions for clippy compliance
Resolves clippy::suspicious_open_options warning on whitelist lock file creation.
2026-05-17 15:21:52 +00:00
5c670cbd0c fix: apply cargo fmt to resolve CI formatting failures
Format all enrollment module source files and tests per rustfmt standards.
Resolves Gitea CI workflow cargo fmt check failures.
2026-05-17 05:49:26 +00:00
75ec2b8e3c feat: add self-enrollment workflow for automated PKI provisioning
- Phase 1: CLI args (--enroll flag), enroll module skeleton, config support
- Phase 2: Registration request, polling loop (24h timeout), main.rs integration
- Phase 3: PKI extraction, atomic cert writing, whitelist auto-append, mTLS transition
- Phase 4: E2E test suite, README/DEPLOYMENT docs, CI pipeline
- Phase 5: SPEC.md, API_DOCUMENTATION.md, CHANGELOG.md, ROADMAP.md sync

Security review: APPROVED (0 critical, 0 high findings)
Cross-distro compatible: Debian/Ubuntu, RHEL/CentOS/Fedora, Alpine, Arch Linux
2026-05-17 05:30:42 +00:00
949cbb2632 docs: add self-enrollment client workflow to API documentation 2026-05-16 19:18:25 +00:00
432e6785b2 fix: use resolved service name for socket activation detection 2026-05-07 01:42:20 +00:00