Commit Graph

183 Commits

Author SHA1 Message Date
Jonathon Anderson
abc5f0f0b9 Add doc comments to server code
Points to userdocs/server/routes.rst for more information.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-10 15:35:44 -06:00
Jonathon Anderson
5147d0970e Simplify warewulfd parser
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-10 15:17:40 -06:00
Jonathon Anderson
395fa2c283 Support requiring TLS for API access
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:48:20 -06:00
Jonathon Anderson
779434331c Add GRUB config route, tests, and server route documentation
- Add /grub/{hwaddr} route for serving GRUB configuration files,
  replacing the shim handler with a config-based approach
- Add short URL aliases: 'system' for overlay-system, 'runtime' for
  overlay-runtime, and 'grub' stage in parser
- Add 'grub' to status stage tracking in request handling
- Add comprehensive test coverage for EFI, GRUB, initramfs, iPXE,
  overlay, and provision handlers (efi_test.go, grub_test.go,
  initramfs_test.go, ipxe_test.go, overlay_test.go)
- Expand existing parser and provision tests
- Remove shim.go (functionality folded into grub.go)
- Add userdocs/server/routes.rst documenting all warewulfd HTTP routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:48:14 -06:00
Jonathon Anderson
a886b4958b Simplify and clarify configuration
- changed "secure port" to "tls port"
- removed the --create flag for "wwctl configure tls"; made it the default behavior
- fixed a TLS creation bug in "wwctl configure --all"
- added logging to "wwctl configure tls" and "wwctl configure --all" (for the tls case)

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:42:26 -06:00
Jonathon Anderson
6ce3d33f50 Move TLS check into HandleRuntimeOverlay
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:42:26 -06:00
Jonathon Anderson
91723a258a Refactor server to separate handlers
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:42:18 -06:00
Jonathon Anderson
ced93bcc5a Rename .Https template variable to .TLS
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:35:19 -06:00
Jonathon Anderson
3d5aa6b0e3 Better TLS configuration error handling in warewulf server
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:35:19 -06:00
Jonathon Anderson
dc21302f32 Warn when server starts with TLS enabled but no key available
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:35:19 -06:00
Jonathon Anderson
673d7627b5 Move TLS files from keys/ to tls/
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:35:19 -06:00
Jonathon Anderson
0eaaf66883 Pass TLS variable to iPXE template
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-03-09 21:35:19 -06:00
Christian Goll
bcf53f7efd renamed to tls instead of keys 2026-03-09 21:34:40 -06:00
Christian Goll
04c54f1907 only server runtime over https if enabled
server fix
2026-03-09 21:34:40 -06:00
Christian Goll
a1c11db8cc enable https and key handling
- add key generation and import for warewulfd
- add https port to warewulfd
- configuration optiions for port and

keys
2026-03-09 21:34:40 -06:00
Cédric Clerget
9f2ab5168d Return HTTP 409 status when creating an existing overlay
Signed-off-by: Cédric Clerget <cedric.clerget@gmail.com>
2026-01-14 13:58:12 -07:00
Timothy Middelkoop
4f58845a9e Add IPv6 support for Dnsmasq and NetworkManager
Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2025-11-27 01:56:18 +00:00
Cédric Clerget
718c79c7ca Fix ImageDelete API not returning error when checking if image is used by nodes/profiles
Signed-off-by: Cédric Clerget <cedric.clerget@gmail.com>
2025-10-27 16:41:15 -05:00
Jonathon Anderson
66450a7dcd Simpler names for overlay methods
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-27 22:33:18 -06:00
Jonathon Anderson
6fd858899d Fix warewulfd api behavior when deleting distribution overlay
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-27 22:25:21 -06:00
Jonathon Anderson
e609c599a1 Address feedback from Copilot
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-27 22:25:21 -06:00
Christian Goll
6f4fd60d8f refactored overlay class
overlay.GetOverlay(name) returns now an error if the overlay doesn't
exist. This is the most canonical way to act if there is no overlay.
2025-08-27 22:24:31 -06:00
Dacian Reece-Stremtan
efd63aecd4 IPv6 iPXE support
* Parse address and port with netip w/ tests
* Add Authority to provisioning templates based on remote IP family
  (name based on RFC 3986)
* Add IPv6 support to the default iPXE (tested)
* Update `grub.cfg.ww` to use Authority (untested)

Co-authored-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
Co-authored-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
Signed-off-by: Timothy Middelkoop <tmiddelkoop@internet2.edu>
2025-08-01 14:46:36 -06:00
Jonathon Anderson
7d0b73e452 Address copilot review from #1945
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:57:01 -06:00
Jonathon Anderson
5ceeb60c24 Refactor wwapi tests for proper isolation
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
e149a332e6 Bugfix: cloning a site overlay when parent dir does not exist
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
9884aad504 Consolidated createOverlayFile and updateOverlayFile to addOverlayFile
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
jason yang
62d1aa654d Support for creating and updating overlay file in wwapi
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
7b2c0901ed Only return overlay files that refer to a path within the overlay
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
jason yang
e089fe0101 add overlay file deletion support
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
6b5115934b DELETE /api/overlays/{id}?force=true can delete overlays in use
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:48 -06:00
Jonathon Anderson
949dc9d46b Restore idempotency of PUT /api/nodes/{id}
HTTP PUT is supposed to be idempotent, so PUT for an existing node or
profile should replace the node or profile, not throw an error.

Generating an error on duplicate can now be requested using the
If-None-Match header with a `*` value.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:41 -06:00
Jonathon Anderson
a0752a5bd0 Simplify overlay mtime api and add tests
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-28 18:18:22 -06:00
jason yang
a3dbf6aeee add node overlay buildtime
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2025-07-28 18:18:13 -06:00
Jonathon Anderson
a2c7caa4ba Rebuild overlays for discovered nodes
- Fixes: #1468

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-09 14:29:38 -06:00
Christian Goll
b8641b8569 more variables for the grub templates
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-06-17 01:34:23 -06:00
Jonathon Anderson
7d437e9e58 Merge pull request #1925 from MatthewHink/mhink-ovl
Add uid, gid, and permissions to OverlayFile struct
2025-06-16 17:13:20 -06:00
Jonathon Anderson
f61dfdde87 Use jsonassert in test
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-06-16 17:09:34 -06:00
MatthewHink
b6c33d9567 Add uid, gid, and permissions to OverlayFile struct
There is an existing test for this. uid, gid, and permissions seem
consistent across test boxes.
2025-06-16 17:09:24 -06:00
MatthewHink
0a1d12e6d4 Fail API add node if node exists 2025-06-13 12:22:03 -07:00
Jonathon Anderson
4005afac4c Add a new OpenAPI v3 REST API to warewulfd at /api
Co-authored-by: jason yang <jasonyangshadow@gmail.com>

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-04-03 07:12:03 -06:00
Jonathon Anderson
4367b56120 Restore some default behaviors
- If `init` is not specified, wwinit looks for /sbin/init, /etc/init,
  and /bin/init, matching dracut behavior.
- assume ipxe template=default if not set
- Display a warning during overlay build if an overlay list is empty

Issues:

- Closes: #1808
- Closes: #1813

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-03-25 09:07:03 +01:00
Christian Goll
a4035faff9 Fix warewulfd panic when netdev is only in profile
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-03-18 10:55:24 -06:00
Christian Goll
fafaaf9675 add failing test for #1817
Signed-off-by: Christian Goll <cgoll@suse.com>
2025-03-17 11:05:34 +01:00
Jonathon Anderson
fd49254ac5 Display auto-detected kernel version during iPXE and GRUB
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-18 17:00:21 -07:00
Xu YANG
470f8c65d5 Merge pull request #1707 from anderbubble/remove-syslog
Remove `warewulf.conf:syslog`
2025-02-07 12:08:48 +09:00
Jonathon Anderson
89721c6832 Remove warewulf.conf:syslog
- Fixes: #1606

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-05 21:58:39 -07:00
Jonathon Anderson
5bc82f97cc Urlencode asset keys during dracut boot
- Fixes: #1610

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 13:49:29 -07:00
Jonathon Anderson
6ad7178ad8 Fix a panic in warewulfd when no kernel fields are specified
- Fixes: #1689

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-03 03:48:10 -07:00
Christian Goll
755411d3cb Added warewulfd:/overlay-file/{overlay}/{path...}?render={nodeID}
Co-authored-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-29 00:08:30 -07:00