603 Commits

Author SHA1 Message Date
CanbiZ
a7daaee5ae Refactor dev MOTD/SSH setup and journal cleanup
Moved MOTD/SSH setup for dev mode in LXC containers to run after installation and when containers are kept for debugging, improving reliability and clarity. Updated journalctl cleanup to avoid using $STD and suppress errors if systemd-journald is not initialized. Also refactored indentation in misc/api.func for consistency.
2025-11-17 15:09:36 +01:00
CanbiZ
b5d3293202 typo 2025-11-17 14:58:29 +01:00
CanbiZ
6e98e359d8 post 2 api + error_handling
Switches from a comma-separated FEATURES string to a FEATURES_ARRAY for proper Proxmox parameter handling. Refactors PCT_OPTIONS to an array for safer argument passing, updates container creation calls, and adds API reporting after container creation.
2025-11-17 14:56:18 +01:00
CanbiZ
2d35c9011a Normalize feature flags to numeric values in build.func
Moved normalization of feature flags (ENABLE_NESTING, ENABLE_KEYCTL, ENABLE_MKNOD, ENABLE_FUSE, PROTECT_CT) to base_settings() for consistent 0/1 values. Updated build_container() to rely on pre-normalized flags and fixed ENABLE_FUSE check. Improved pct create log file naming for uniqueness.
2025-11-17 14:41:51 +01:00
CanbiZ
414b36410d Normalize feature flags to numeric values in build.func
Updated ENABLE_NESTING, ENABLE_KEYCTL, and ENABLE_MKNOD normalization to ensure they are set to 0 or 1, as required by pct. This improves compatibility and prevents issues with non-numeric values.
2025-11-17 14:35:59 +01:00
CanbiZ
26aca1ce09 silent upgrade container 2025-11-17 14:26:32 +01:00
CanbiZ
e2179db113 Refactor MOTD/SSH setup in build script
Simplifies MOTD and SSH setup by sourcing common install functions and conditionally running motd_ssh. Improves error handling and messaging for debugging access during container initialization.
2025-11-17 14:22:48 +01:00
CanbiZ
82439d30cd Add msg_dev function for dev mode messaging
Introduces a new msg_dev function in core.func to standardize development/debugging messages. Updates build.func to use msg_dev for clearer dev mode output, replacing previous msg_custom and msg_info usages for MOTD/SSH setup and container debugging steps.
2025-11-17 14:22:22 +01:00
CanbiZ
ee5dc898f9 Update build.func 2025-11-17 14:00:52 +01:00
CanbiZ
73d6cabb52 Add advanced Proxmox container feature support
Introduces support for advanced Proxmox container features including nesting, keyctl, mknod, mount filesystems, protection flag, and timezone. Updates variable handling, settings UI, and container build logic to allow configuration and passing of these options.
2025-11-17 13:48:59 +01:00
CanbiZ
0bcd88685c Improve error handling during app installer run
Expanded comments and adjusted error handling logic when running the application installer in the container. All error traps are disabled before lxc-attach and restored after, ensuring host error_handler does not interfere with container-level error management.
2025-11-17 13:19:39 +01:00
CanbiZ
916293d98d introduce dev_mode
Introduces granular dev_mode flags (motd, keep, trace, pause, breakpoint, logs, dryrun) with a parser and exports for container builds. Enables persistent log directories when logs mode is active, supports dryrun and trace modes, and adds MOTD/SSH setup and breakpoint shell for debugging. Refactors related logic in build.func, core.func, and install.func for improved developer experience and debugging.
2025-11-17 12:53:26 +01:00
CanbiZ
c2b7f4e298 Improve container build/install logging and error handling
Introduces distinct BUILD_LOG and INSTALL_LOG variables for host and container operations, ensuring logs are properly captured and retrievable. Refactors silent execution and error handling to use the active log file, improves log copying after failures, and enhances context detection for log management. Also adds fallback logic for INSTALL_LOG initialization in install.func.
2025-11-17 12:45:24 +01:00
CanbiZ
06a4091019 Improve container install error handling and logging
Enhances reliability of application installation error detection in containers by using an error flag file, improves log copying and user prompts, and updates error handler to create a flag file with the exit code for host-side detection.
2025-11-17 12:23:51 +01:00
CanbiZ
5386da93e8 Handle failed LXC install and cleanup in build.func
Moved failed LXC installation cleanup logic from error_handler.func to build.func. Now, if installation fails, the user is prompted to remove the broken container with a 60s timeout, and the installation log is copied for debugging. Removed the cleanup_failed_lxc function and related trap from error_handler.func for better encapsulation.
2025-11-17 12:11:09 +01:00
CanbiZ
36f5e32d48 Inline explain_exit_code and clean diagnostics_check docs
Moved the explain_exit_code function directly into api.func, removing external dependency loading. Also cleaned up merge conflict markers and unified documentation for diagnostics_check in build.func.
2025-11-17 11:26:59 +01:00
CanbiZ
2f2adaea37 Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED 2025-11-17 11:21:23 +01:00
CanbiZ
fc59aaede6 fix fi 2025-11-17 11:20:48 +01:00
CanbiZ
c0fc74bc9c Add detailed documentation and refactor core functions
Expanded inline documentation and section headers across misc/api.func, misc/build.func, misc/core.func, misc/error_handler.func, and misc/install.func for improved maintainability and clarity. Refactored error handling to use centralized explain_exit_code and updated API telemetry/reporting logic. Enhanced modularity and structure of utility, validation, and setup functions, and improved comments for user guidance and developer onboarding.
2025-11-17 11:17:04 +01:00
CanbiZ
432fc70e6e switch funcs 2025-11-17 10:45:28 +01:00
CanbiZ
27bb9e5192 Improve install log handling for containers
Enhances the build and error handler scripts to better manage installation logs. On install failure, the log is now copied from the container to the host for easier debugging. The error handler now saves the log inside the container's /root directory for later retrieval, improving traceability and support.
2025-11-04 17:10:28 +01:00
CanbiZ
b55e8f5f34 Improve logging and error handling with session IDs
Introduces a SESSION_ID variable for log file naming and tracking, updates log file paths to include timestamps and session IDs, and enhances error handling output to use custom message functions when available. Also improves log file management and user guidance for viewing logs, and refactors error handler to better support containerized environments.
2025-11-04 16:59:02 +01:00
CanbiZ
a6cdb474a1 Update build.func 2025-11-04 16:52:12 +01:00
CanbiZ
8ccd06b596 Refactor message output and improve SSH check logic
Replaces many msg_info calls with msg_custom for more consistent and expressive status messages in build.func. Refines SSH client detection in core.func to better distinguish local, subnet, and external connections, and adds additional warnings for external SSH usage.
2025-11-04 16:38:46 +01:00
CanbiZ
2ff12b1f01 Update build.func 2025-11-04 16:30:23 +01:00
CanbiZ
4577271e7d Prioritize app resource defaults and silence storage messages
App-declared CPU, RAM, and disk defaults now take precedence over default.vars only if they are higher, ensuring resource allocations favor app requirements. Additionally, informational output for storage configuration and default.vars creation has been silenced for less verbose operation.
2025-11-04 16:24:37 +01:00
CanbiZ
acbaa7ce7d improve pversion check
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 13:20:11 +01:00
CanbiZ
e97a1ec944 fixes
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 13:17:35 +01:00
CanbiZ
cb33e40562 Refactor build.func: Simplify GPU passthrough, add APT cacher check, remove var_ctid/var_ipv6_static from defaults
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 13:16:28 +01:00
CanbiZ
b6812877e5 Revert build.func optimization - restore working version from backup
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 12:50:19 +01:00
CanbiZ
cc40cd457c Optimize build.func: Add PVE/kernel version display, reorganize functions, remove duplicates
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 12:47:45 +01:00
CanbiZ
2a6569a6e3 add pve_version & kernel output
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-29 12:36:50 +01:00
CanbiZ
ddcd37a419 fixes
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-28 14:48:23 +01:00
CanbiZ
1070d0cdad remove debug output
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-27 10:29:12 +01:00
a4e8e1e44f Fix a bug while prining the LXC-ID during advanced install.
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-24 09:17:44 +02:00
CanbiZ
f8a3b889be Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-24 09:11:02 +02:00
CanbiZ
dae2223a38 Comment out debug output in create_lxc_container
Disabled various debug echo and msg_debug statements in the create_lxc_container function to reduce console output during normal operation. This helps keep logs cleaner while retaining the code for future debugging if needed.
2025-10-24 09:10:27 +02:00
55903a8d5e Fix Array out of bounds bug in build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-24 09:06:02 +02:00
vhsdream
b3fcb5addf Tweak template search debug test to avoid unbound var
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-22 17:07:58 -04:00
CanbiZ
61e3721c1d Cleanup MSG's
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-22 13:52:17 +02:00
CanbiZ
3e31d59d82 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:54:36 +02:00
CanbiZ
9c9dc863a2 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:52:06 +02:00
CanbiZ
0c2382c2d7 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:48:44 +02:00
CanbiZ
ff3bd05452 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:40:09 +02:00
CanbiZ
bd58b2cbfd Improve LXC template selection and add alternative search
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
Refactors the logic for fetching available LXC templates and adds a fallback mechanism to prompt the user to select an alternative OS version if the desired template is not found. Enhances debugging output and improves robustness in template selection.
2025-10-21 15:35:19 +02:00
CanbiZ
5e6fa752c7 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:30:24 +02:00
CanbiZ
928c5b465d debug output
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:28:06 +02:00
CanbiZ
4e856c86a2 Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:24:33 +02:00
CanbiZ
ff1db9c90e Update build.func
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:21:06 +02:00
CanbiZ
93f343fec5 fixes
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled
2025-10-21 15:17:30 +02:00