Commit Graph

449 Commits

Author SHA1 Message Date
Ilia Ross
14f90afb89 Fix to cache init mode for menu title selection 2026-06-07 16:55:20 +02:00
Ilia Ross
4e929b5fa2 Update module description and language files 2026-06-05 21:17:12 +02:00
Ilia Ross
5499d1c051 Fix to modernize init module configuration by boot system 2026-06-05 20:49:53 +02:00
Ilia Ross
750940e2f5 Fix to respect Unix user identity for systemd user unit defaults 2026-06-04 12:11:35 +02:00
Ilia Ross
d590fafd6c Fix indent and comment 2026-06-03 19:01:17 +02:00
Ilia Ross
a83db9f57d Add advanced systemd unit and user unit management
This PR expands the "Bootup and Shutdown" module’s systemd support with creation and management for services, timers, sockets, paths and targets. It also adds user-scoped systemd units, linger controls, status and log actions, tabbed unit listings by type, and contextual help for the new options.

For user-scoped units, the implementation includes several safety guards because unit files live under user-controlled home directories:

- User accounts are validated with system account data before any user-unit operation is attempted.
- User unit names are restricted to known systemd unit suffixes and safe filename characters.
- User unit files are limited to direct children of `~/.config/systemd/user`.
- Symlinked `.config`, `.config/systemd`, and `.config/systemd/user` paths are rejected.
- User unit reads, writes, directory creation, and deletes are performed after dropping privileges to the target Unix user.
- File operations re-check paths close to the actual read/write/delete operation to reduce symlink race exposure.
- User unit create failures roll back half-created files when daemon reload fails.
- User-provided unit names, owners, paths, command output, and logs are HTML-escaped before display.
- systemctl, journalctl, and loginctl command arguments are shell-quoted before execution.
- User services omit `User=` and `Group=` directives because they already run under the selected user’s systemd manager.

Together, all these changes will allow Webmin admin to manage both system and user systemd units while keeping user-controlled home-directory paths from becoming root-level file read/write/delete exploits.

Implemented in response to these two issue requests  https://github.com/webmin/webmin/issues/2733 and https://github.com/webmin/webmin/issues/2734
2026-06-02 20:32:03 +02:00
Ilia Ross
911aa64a36 Fix systemd multiline ExecStart handling
* Note: Generate separate ExecStart= entries for newline-separated systemd start commands and set Type=oneshot when required.

https://github.com/webmin/webmin/issues/2697
2026-05-13 01:06:57 +02:00
Ilia Ross
5558910722 Add API to activate and deactivate a service 2026-03-17 20:05:06 +02:00
Ilia Ross
2c211e557e Fix runlevel change input validation and escaping (#2) 2026-03-10 17:29:16 +02:00
Ilia Ross
b3ec013fc9 Fix init start/stop command injection guard (#1) 2026-03-10 17:29:15 +02:00
Ilia Ross
f778af84a0 Fix create_launchd_agent to support optional load parameter
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
https://github.com/webmin/authentic-theme/issues/1729#issuecomment-3899950457
2026-02-16 20:15:52 +02:00
Ilia Ross
2eb2be2318 Add support for updating launchd agents with start init wrapper
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
https://github.com/webmin/authentic-theme/issues/1729
2026-02-13 17:44:07 +02:00
Ilia Ross
76efb4ee10 Fix not to show runlevels config option for systemd 2025-07-12 19:40:04 +03:00
Ilia Ross
ed42dd5822 Fix to always show description 2025-07-11 15:25:02 +03:00
Ilia Ross
a65f9f5d6c Fix to respect config option and show no description 2025-07-05 18:57:23 +03:00
Ilia Ross
4d417ea4bf Fix to put lengthy descriptions to a nice details element 2025-07-05 16:38:55 +03:00
Ilia Ross
2e245a1035 Add a separate "Unit type" column 2025-07-05 16:03:47 +03:00
Ilia Ross
049542b7ed Add DropInPaths property 2025-07-05 15:43:26 +03:00
Ilia Ross
780cc982b7 Revert "Fix to show .service unit type"
72621c2929 (commitcomment-161382677)

This reverts commit 37f9ce4bb4.
2025-07-04 01:18:58 +03:00
Ilia Ross
90f4265389 Fix to use unit term for systemd systems 2025-07-03 13:28:55 +03:00
Ilia Ross
37f9ce4bb4 Fix to show .service unit type
72621c2929 (commitcomment-161316248)
2025-07-03 13:10:00 +03:00
Jamie Cameron
ceb3e583a3 Reduce duplication in list of unit types 2025-07-02 16:51:17 -07:00
Jamie Cameron
436d6f70bb Its cleaner for the API to always return a list 2025-07-02 16:48:39 -07:00
Jamie Cameron
72621c2929 No need to show the .service suffix 2025-07-02 16:44:21 -07:00
MacSteini
c3d03ed9e7 Update de 2025-02-17 00:32:15 +00:00
Ilia Ross
f880192526 Remove languages with 0% coverage
https://github.com/webmin/webmin/issues/2403#issuecomment-2652613588
2025-02-12 13:19:49 +02:00
Ilia Ross
699de35596 Fix to create correct rc script
2b357cf0f1 (r152033120)
2025-02-02 13:57:35 +02:00
Ilia Ross
9d5d790526 Fix to ensure systemd custom units are created in the correct directory 2025-02-01 21:23:22 +02:00
Ilia Ross
761a879919 Add ability to return filtered systemd unit options 2025-01-16 21:45:47 +02:00
Ilia Ross
1c8c259eae Add API to edit systemd units 2025-01-16 15:02:54 +02:00
Ilia Ross
468a570adf Add cat_systemd sub to parse systemd unit config 2025-01-15 02:27:50 +02:00
Ilia Ross
dedfc90e71 Fix comment 2025-01-15 01:34:08 +02:00
Ilia Ross
89ae8632e0 Add is_active_systemd sub 2025-01-15 01:23:03 +02:00
MacSteini
162206949f Consecutive Spaces Replacement
Replaced multiple consecutive spaces with a single space
2024-12-16 16:57:09 +00:00
MacSteini
5ea0cc6b42 Trailing Spaces Removal
Removed trailing spaces
2024-12-16 15:16:55 +00:00
MacSteini
64598e5f39 Blanks Removal
Removed blanks before or after the equal sign
2024-12-16 12:59:19 +00:00
MacSteini
477982776c Updated de
Corrections (UTF-8, new lines at file end), amendments, updates
2024-11-26 01:43:34 +00:00
MacSteini
d3f8859df2 German translation files reviewed and updated 2024-09-06 15:22:42 +01:00
Jamie Cameron
0009335636 HTML escape description in actions list 2024-09-02 10:13:19 -07:00
Jamie Cameron
d8a7a583a3 Prevent duplication of systemd actions and init scripts https://github.com/webmin/webmin/issues/2227 2024-07-26 14:56:46 -07:00
Ilia Ross
61d2081371 Add to support more passible options to systemd service file 2024-06-16 01:55:03 +03:00
Ilia Ross
9b496bf413 Fix to drop installing systemd service at boot script [build]
https://github.com/webmin/webmin/issues/2133
2024-04-21 17:53:03 +03:00
Ilia Ross
f1804201e6 Fix indent [build] 2024-04-21 16:43:47 +03:00
Ilia Ross
0b1e5f87e1 Dev: Remove debug info 2024-04-21 16:41:25 +03:00
Ilia Ross
1e94a328ba Dev: Add more debug [build] 2024-04-21 16:29:05 +03:00
Ilia Ross
bac62e03c7 Add debug [build] 2024-04-21 16:18:10 +03:00
Ilia Ross
1f2a7902c6 Fix to save status of service correctly [build] 2024-04-21 14:59:12 +03:00
Ilia Ross
975ae7b497 Fix to wait for systemd to update configuration
[build]
2024-04-21 14:53:03 +03:00
Ilia Ross
f252296471 Fix to preserve service state https://github.com/webmin/webmin/issues/2133
[build]
2024-04-21 13:56:11 +03:00
Ilia Ross
79b840024a Update translations 2023-11-14 20:16:19 +02:00