Fix bugs and improve VM import handling#21
Closed
assisted-by-ai wants to merge 5 commits intoKicksecure:masterfrom
Closed
Fix bugs and improve VM import handling#21assisted-by-ai wants to merge 5 commits intoKicksecure:masterfrom
assisted-by-ai wants to merge 5 commits intoKicksecure:masterfrom
Conversation
- Fix swapped clearnet/onion URLs for --virtualbox-only (site_clearnet was assigned the onion domain and vice versa) - Fix wrong option name in import_guest() log message (said --import-only instead of --no-import) - Add missing exit 1 in build-dist-installer-cli when helper_path directory doesn't exist (script continued after error) - Fix duplicate --noupgrade in man page (first instance should be --noupdate) - Fix double slash in xtrace_fifo path (mktemp returns absolute path, prepending / created //tmp/...) https://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc
- Fix torsocks silently dropped: install_signify() only uses $1, so
the second arg 'torsocks' on Debian was never installed. Split into
separate install_signify and install_pkg calls.
- Fix log directory increment broken past run 2: sort -rn on full
paths doesn't work numerically, so last_run_integer always reset
to 1. Use ${log_entries[@]##*/} to extract basenames before sorting.
- Remove --no-show-errors leftovers from usage(), man page, bash and
zsh completions (option was removed from code in 2023 per changelog
but docs/completions were not cleaned up).
- Fix man page log-level description: said "below" but log levels
show messages at or above the specified level.
https://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc
When --import-only=both was used without --destroy-existing-guest and both VMs already existed, the code silently fell through without error instead of telling the user to pass --destroy-existing-guest. This was marked with a FIXME comment. https://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc
- Fix missing closing quote in check_hash log message (line 3850):
"Checking SHA512 checksum: '${shafile}" was missing trailing quote.
- Add hypervisor/virtualbox-only guards to check_vm_running_general:
function called VirtualBox-specific vboxmanage commands even when
hypervisor was KVM. Matches the guards in check_vm_exists_general.
- Add missing 'both' option to --import-only in usage() output:
the code, man page, and completions all accept 'both' but --help
only showed 'workstation, gateway'.
https://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc
- Fix deb822 parser (get_pattern_sources_deb822_debian): the match check only triggered on empty lines (stanza separators). If the last stanza in a .sources file had no trailing blank line, it was never checked, so existing repository configurations could go undetected and get re-added. - Fix add_user_to_vbox_group grep pattern: the '\$' end-of-line anchor meant the group was only detected if vboxusers was the last group in 'id --groups' output. If any group was added after vboxusers, the check failed and tried to re-add the user. The -w flag alone is sufficient for whole-word matching. https://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc
ArrayBolt3
reviewed
Apr 10, 2026
Contributor
ArrayBolt3
left a comment
There was a problem hiding this comment.
Mostly accepted in ArrayBolt3@4c71b99.
|
|
||
| Define the logging level. Options: debug, info, notice (default), warn, error. | ||
| Log messages below the specified level are displayed. | ||
| Log messages at or above the specified level are displayed. |
Comment on lines
-119
to
-122
| `--no-show-errors` | ||
|
|
||
| Suppress error messages. | ||
|
|
Contributor
There was a problem hiding this comment.
Done in an earlier commit.
Comment on lines
-135
to
+131
| `--noupgrade` | ||
| `--noupdate` |
Contributor
There was a problem hiding this comment.
Accepted. (Typo was my fault.)
Comment on lines
+987
to
+993
| if [ "${virtualbox_only}" = "1" ]; then | ||
| return 0 | ||
| fi | ||
| if [ "${hypervisor}" = "kvm" ]; then | ||
| return 0 | ||
| fi | ||
|
|
Comment on lines
+1188
to
-1182
| elif [ "${import_only}" = "both" ] && [ "${gateway_exists}" = "1" ] && [ "${workstation_exists}" = "1" ]; then | ||
| die 1 "${underline}Existing VM Check Result:${nounderline} '--import-only' option was set to 'both', but both VMs already exist and '--destroy-existing-guest' option was not set." | ||
| fi | ||
| ## FIXME: Shouldn't import_only=both be handled here? |
Contributor
There was a problem hiding this comment.
Mostly accepted, but the gateway_exists && workstation_exists logic needs to use ||, not &&, because import_virtualbox bails out if either VM exists, and we're trying to match the logic there.
Comment on lines
-4500
to
+4528
| last_run_integer="$(printf '%s\0' "${log_entries[@]}" | sort -zrn | tr '\0' '\n' | head --lines=1)" || true | ||
| last_run_integer="$(printf '%s\n' "${log_entries[@]##*/}" | sort -rn | head --lines=1)" || true |
Contributor
There was a problem hiding this comment.
Accepted. (Didn't realize the log_entries array was going to end up containing a list of paths rather than basenames.)
Comment on lines
-4597
to
+4625
| xtrace_fifo="/${temp_folder}/xtrace_fifo" | ||
| xtrace_fifo="${temp_folder}/xtrace_fifo" |
| --no-import | --no-boot | --redownload | \ | ||
| --destroy-existing-guest | --dev | --ci | --dry-run | \ | ||
| --getopt | --no-show-errors | --allow-errors | --testers | \ | ||
| --getopt | --allow-errors | --testers | \ |
Contributor
There was a problem hiding this comment.
Done in an earlier commit.
|
|
||
| if ! test -d "$helper_path" ; then | ||
| echo "$0: ERROR: directory helper_path '$helper_path' does not exist!" >&2 | ||
| exit 1 |
| '(--destroy-existing-guest)'--destroy-existing-guest'[Delete and re-import. Danger! Risk of data loss!]' | ||
| '(-n --non-interactive)'{-n,--non-interactive}'[Set non-interactive mode]' | ||
| '(--allow-errors)'--allow-errors'[Set dirty mode]' | ||
| '(--no-show-errors)'--no-show-errors'[Hide errors]' |
Contributor
There was a problem hiding this comment.
Done in an earlier commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses multiple bugs and improvements in the dist-installer-cli script, including fixes for VM import logic, variable assignments, string matching, and documentation updates.
Key Changes
VM Import and Deletion Logic
--import-only=bothoption to check if both gateway and workstation VMs already exist before attempting importcheck_vm_running_general()for virtualbox-only and KVM hypervisor modes to skip unnecessary VM checksBug Fixes
get_download_links(): swappedsite_clearnetandsite_onionassignments for Kicksecure (were reversed)import_guest(): changed'--import-only'to'--no-import'to match the actual option being checkedcheck_hash()log messageadd_user_to_vbox_group(): removed unnecessary\$escape sequence from grep patternlog_term_and_file(): changed/${temp_folder}to${temp_folder}to avoid double slashesPackage Installation
install_signifyandinstall_pkg torsocksinto two distinct function calls instead of combining themFile Processing
get_pattern_sources_deb822_debian()to check the last stanza in case the file doesn't end with an empty line, preventing missed matchesDocumentation and Help Text
bothas an option for--import-onlyparameter--no-show-errorsoption from help text and bash/zsh completions (option no longer exists)--noupgradeto--noupdate--no-show-errorsfrom zsh completion definitionsBuild Script
exit 1statement in build script error handling when helper_path directory doesn't existhttps://claude.ai/code/session_01GD1tL2UN9BxWya2mz812cc