Private
Public Access
1
0
Commit Graph

225 Commits

Author SHA1 Message Date
2ac40076f5 ci: add debhelper dependency and contents:write permission
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 46s
CI/CD Pipeline / All Unit Tests (push) Successful in 1m18s
CI/CD Pipeline / Security Audit (push) Successful in 4s
CI/CD Pipeline / Enrollment Tests (push) Successful in 1m38s
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Successful in 1m11s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 2m28s
CI/CD Pipeline / Build RPM Package (push) Successful in 2m35s
CI/CD Pipeline / Build Arch Package (push) Successful in 2m37s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m32s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m2s
- Add debhelper to system dependencies for dpkg-buildpackage
- Add permissions: contents: write for GitHub Release creation
- Fixes Build & Release job failures on tag push

Co-authored-by: git-echo <git-echo@moon-dragon.us>
2026-05-31 02:08:36 -05:00
4375f915ca Merge pull request #1 from Draco-Lunaris/fix/ci-build-path
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 46s
CI/CD Pipeline / All Unit Tests (push) Successful in 1m17s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Has been cancelled
CI/CD Pipeline / Build Debian Package (push) Has been cancelled
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been cancelled
CI/CD Pipeline / Build RPM Package (push) Has been cancelled
CI/CD Pipeline / Build Alpine Package (push) Has been cancelled
CI/CD Pipeline / Build Arch Package (push) Has been cancelled
CI/CD Pipeline / Enrollment Tests (push) Has been cancelled
ci: fix dpkg-buildpackage PATH for cargo
2026-05-31 01:52:46 -05:00
0cc752ff3e ci: fix dpkg-buildpackage PATH for cargo
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 5s
CI/CD Pipeline / Clippy Lints (push) Successful in 42s
CI/CD Pipeline / All Unit Tests (push) Successful in 1m9s
CI/CD Pipeline / Security Audit (push) Successful in 6s
CI/CD Pipeline / Enrollment Tests (push) Successful in 1m21s
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Successful in 59s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 2m28s
CI/CD Pipeline / Build RPM Package (push) Successful in 2m23s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m5s
CI/CD Pipeline / Build Arch Package (push) Successful in 2m20s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m7s
v0.1.9
2026-05-31 01:08:50 -05:00
ae515ecb3a docs: add CONTRIBUTING.md and SECURITY.md for open source
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 4s
CI/CD Pipeline / Clippy Lints (push) Successful in 43s
CI/CD Pipeline / All Unit Tests (push) Successful in 1m12s
CI/CD Pipeline / Security Audit (push) Successful in 4s
CI/CD Pipeline / Enrollment Tests (push) Successful in 1m14s
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Successful in 1m8s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 2m26s
CI/CD Pipeline / Build RPM Package (push) Successful in 2m33s
CI/CD Pipeline / Build Arch Package (push) Successful in 2m37s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m15s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m31s
2026-05-31 00:12:14 -05:00
e80437ad06 ci: add GitHub Actions CI/CD and Apache-2.0 license
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 3s
CI/CD Pipeline / Clippy Lints (push) Successful in 44s
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Enrollment Tests (push) Has been cancelled
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Has been cancelled
CI/CD Pipeline / Build Debian Package (push) Has been cancelled
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been cancelled
CI/CD Pipeline / Build RPM Package (push) Has been cancelled
CI/CD Pipeline / Build Alpine Package (push) Has been cancelled
CI/CD Pipeline / Build Arch Package (push) Has been cancelled
CI/CD Pipeline / All Unit Tests (push) Has been cancelled
2026-05-31 00:10:01 -05:00
8fe6e0a72f chore: add .a0proj/ to .gitignore
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 3s
CI/CD Pipeline / Clippy Lints (push) Successful in 44s
CI/CD Pipeline / All Unit Tests (push) Successful in 1m10s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Enrollment Tests (push) Successful in 1m12s
CI/CD Pipeline / Verify Enrollment CLI Flag (push) Successful in 1m8s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 2m26s
CI/CD Pipeline / Build RPM Package (push) Successful in 2m36s
CI/CD Pipeline / Build Arch Package (push) Successful in 2m43s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m14s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m28s
2026-05-30 22:50:03 -05:00
8a9e9190e6 style: fix cargo fmt formatting issues 2026-05-29 11:11:07 -05:00
1322598581 feat: add auto-enrollment, cert validation, and crash loop fixes
- Auto-enrollment on startup when certs are missing/invalid and enrollment.manager_url configured
- Certificate validation (existence, parse, expiry, key match, CA trust)
- --enroll exits after completion (no port conflict with systemd service)
- --renew-certs flag for manual cert renewal
- SO_REUSEADDR on TcpListener::bind (prevents Address already in use)
- Polling token persistence for enrollment resume after restart
- Exit code strategy (0=clean, 1=error, 2=enrollment in progress)
- HTTP 409 (host already exists) handling during enrollment
- Move 'Listening on' log after actual bind
- Increase RestartSec to 10s and add StartLimitBurst=5
- Postinst checks for certs and enrollment URL, prints guidance
- EnrollmentConfig.manager_url changed to Option<String>
- cert_renewal_threshold_days and polling_token config fields
- Updated SPEC.md and DEPLOYMENT_GUIDE.md with new workflow
- RCA document for crash loop root cause analysis
- Version bumped to 1.2.0
2026-05-29 10:44:42 -05:00
48ec57581e feat: add bump-version.sh script for version management
Automates version bumps across all version source files:
- Cargo.toml (PRIMARY)
- debian/changelog (prepend new entry)
- install.sh (update VERSION variable)
- Stale references check after bump

Usage: ./scripts/bump-version.sh <new_version> <old_version>
2026-05-28 10:51:38 -05:00
2f73237fd6 fix: Alpine build - truncated YAML and wrong abuild output path
Root causes of ALL Alpine build failures:
1. ci.yml: Verify Alpine package step was TRUNCATED at line 339 -
   missing closing quote, then clause, fi, and entire upload step.
   This caused YAML parse failure every run.
2. build-alpine.sh: Copy path was /home/builduser/packages/home/x86_64/
   but abuild outputs to /home/builduser/packages/builduser/x86_64/.
   The find fallback caught stale packages from previous builds.

Fixes:
- Complete the Verify Alpine package step with proper if/fi
- Add Upload to Gitea Release step for Alpine (was completely missing)
- Fix abuild output path in build-alpine.sh
2026-05-27 22:01:19 -05:00
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