detached 65b456f

feat(encryption): allow separate password for disk encryption

commit
65b456f12b133af80915f826f9fc664427eb8287
author
bnema · · 2025-10-25 19:40 UTC
parent
3678e90
signature
unsigned
4 files · +65 -12
M CHANGELOG.md +3 -0
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
55 ## [Unreleased]
66
7+### Added
8+- **Separate encryption password**: Allow users to choose between using their account password or a separate password for disk encryption during setup
9+
710 ## [0.3.0] - 2025-10-22
811
912 ### Added
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
4 4
5 ## [Unreleased]5 ## [Unreleased]
6 6
7+### Added
8+- **Separate encryption password**: Allow users to choose between using their account password or a separate password for disk encryption during setup
9+
7 ## [0.3.0] - 2025-10-2210 ## [0.3.0] - 2025-10-22
8 11
9 ### Added12 ### Added
M install/partitioning/all.sh +1 -1
@@ -4,6 +4,6 @@
44 stop_log_output # Stop for interactive prompts and partition display
55 source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)
66 source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output)
7-source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive if encryption enabled + exports ARCHUP_CRYPT_ROOT
7+source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive (prompts for separate encryption password if chosen) + exports ARCHUP_CRYPT_ROOT
88 source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output)
99 start_log_output # Resume after all partitioning is done
@@ -4,6 +4,6 @@
4 stop_log_output # Stop for interactive prompts and partition display4 stop_log_output # Stop for interactive prompts and partition display
5 source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)5 source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)
6 source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output)6 source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output)
7-source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive if encryption enabled + exports ARCHUP_CRYPT_ROOT7+source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive (prompts for separate encryption password if chosen) + exports ARCHUP_CRYPT_ROOT
8 source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output)8 source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output)
9 start_log_output # Resume after all partitioning is done9 start_log_output # Resume after all partitioning is done
M install/partitioning/format.sh +42 -10
@@ -14,21 +14,53 @@ echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
1414 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
1515 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."
1616
17- # Read password from config file (NOTE: Never log the actual password!)
18- ARCHUP_PASSWORD=$(config_get "ARCHUP_PASSWORD")
19-
20- if [ -z "$ARCHUP_PASSWORD" ]; then
21- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Encryption password not set!"
22- echo "ERROR: Encryption password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"
23- exit 1
17+ # Check if user wants to use same password or separate password
18+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD=$(config_get "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD")
19+
20+ if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then
21+ # Use account password for encryption
22+ LUKS_PASSWORD=$(config_get "ARCHUP_PASSWORD")
23+
24+ if [ -z "$LUKS_PASSWORD" ]; then
25+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Account password not set!"
26+ echo "ERROR: Account password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"
27+ exit 1
28+ fi
29+ else
30+ # Prompt for separate encryption password
31+ echo
32+ gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption Password"
33+ gum style --padding "0 0 0 $PADDING_LEFT" "Enter a password to encrypt your disk (different from your account password)"
34+
35+ while true; do
36+ LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" \
37+ --prompt "Password: " \
38+ --padding "0 0 0 $PADDING_LEFT")
39+
40+ LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" \
41+ --prompt "Confirm: " \
42+ --padding "0 0 0 $PADDING_LEFT")
43+
44+ if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then
45+ break
46+ else
47+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
48+ fi
49+ done
50+
51+ if [ -z "$LUKS_PASSWORD" ]; then
52+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Encryption password not set!"
53+ echo "ERROR: Encryption password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"
54+ exit 1
55+ fi
2456 fi
2557
2658 # Wipe any existing signatures on root partition to avoid conflicts
2759 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2860
29- # Setup LUKS with Argon2id and 2000ms iteration time (using user password)
61+ # Setup LUKS with Argon2id and 2000ms iteration time
3062 # Use printf to avoid trailing newline that <<< adds
31- printf '%s' "$ARCHUP_PASSWORD" | cryptsetup luksFormat \
63+ printf '%s' "$LUKS_PASSWORD" | cryptsetup luksFormat \
3264 --type luks2 \
3365 --batch-mode \
3466 --pbkdf argon2id \
@@ -40,7 +72,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
4072 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
4173
4274 # Open the encrypted container
43- printf '%s' "$ARCHUP_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
75+ printf '%s' "$LUKS_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4476
4577 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
4678
@@ -14,21 +14,53 @@ echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
14 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then14 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
15 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."15 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."
16 16
17- # Read password from config file (NOTE: Never log the actual password!)17+ # Check if user wants to use same password or separate password
18- ARCHUP_PASSWORD=$(config_get "ARCHUP_PASSWORD")18+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD=$(config_get "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD")
19-19+
20- if [ -z "$ARCHUP_PASSWORD" ]; then20+ if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then
21- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Encryption password not set!"21+ # Use account password for encryption
22- echo "ERROR: Encryption password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"22+ LUKS_PASSWORD=$(config_get "ARCHUP_PASSWORD")
23- exit 123+
24+ if [ -z "$LUKS_PASSWORD" ]; then
25+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Account password not set!"
26+ echo "ERROR: Account password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"
27+ exit 1
28+ fi
29+ else
30+ # Prompt for separate encryption password
31+ echo
32+ gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption Password"
33+ gum style --padding "0 0 0 $PADDING_LEFT" "Enter a password to encrypt your disk (different from your account password)"
34+
35+ while true; do
36+ LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" \
37+ --prompt "Password: " \
38+ --padding "0 0 0 $PADDING_LEFT")
39+
40+ LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" \
41+ --prompt "Confirm: " \
42+ --padding "0 0 0 $PADDING_LEFT")
43+
44+ if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then
45+ break
46+ else
47+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
48+ fi
49+ done
50+
51+ if [ -z "$LUKS_PASSWORD" ]; then
52+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Encryption password not set!"
53+ echo "ERROR: Encryption password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE"
54+ exit 1
55+ fi
24 fi56 fi
25 57
26 # Wipe any existing signatures on root partition to avoid conflicts58 # Wipe any existing signatures on root partition to avoid conflicts
27 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&159 wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28 60
29- # Setup LUKS with Argon2id and 2000ms iteration time (using user password)61+ # Setup LUKS with Argon2id and 2000ms iteration time
30 # Use printf to avoid trailing newline that <<< adds62 # Use printf to avoid trailing newline that <<< adds
31- printf '%s' "$ARCHUP_PASSWORD" | cryptsetup luksFormat \63+ printf '%s' "$LUKS_PASSWORD" | cryptsetup luksFormat \
32 --type luks2 \64 --type luks2 \
33 --batch-mode \65 --batch-mode \
34 --pbkdf argon2id \66 --pbkdf argon2id \
@@ -40,7 +72,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
40 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"72 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
41 73
42 # Open the encrypted container74 # Open the encrypted container
43- printf '%s' "$ARCHUP_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&175+ printf '%s' "$LUKS_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
44 76
45 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"77 echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
46 78
M install/preflight/identify.sh +19 -1
@@ -32,6 +32,16 @@ while true; do
3232 fi
3333 done
3434
35+# Encryption Password Choice
36+echo
37+gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption"
38+gum style --padding "0 0 0 $PADDING_LEFT" "Choose whether to use the same password for disk encryption"
39+if gum confirm "Use same password for disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then
40+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="true"
41+else
42+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="false"
43+fi
44+
3545 # Email (optional)
3646 echo
3747 gum style --padding "0 0 0 $PADDING_LEFT" "Email is used for SSH key generation and git configuration"
@@ -81,12 +91,14 @@ export ARCHUP_PASSWORD
8191 export ARCHUP_EMAIL
8292 export ARCHUP_HOSTNAME
8393 export ARCHUP_TIMEZONE
94+export ARCHUP_ENCRYPTION_USE_SAME_PASSWORD
8495
8596 config_set "ARCHUP_USERNAME" "$ARCHUP_USERNAME"
8697 config_set "ARCHUP_PASSWORD" "$ARCHUP_PASSWORD"
8798 config_set "ARCHUP_EMAIL" "$ARCHUP_EMAIL"
8899 config_set "ARCHUP_HOSTNAME" "$ARCHUP_HOSTNAME"
89100 config_set "ARCHUP_TIMEZONE" "$ARCHUP_TIMEZONE"
101+config_set "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD"
90102
91103 # Display summary
92104 echo
@@ -97,9 +109,15 @@ else
97109 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] Email: not provided"
98110 fi
99111 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Hostname: $ARCHUP_HOSTNAME"
100-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE"
112+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE"
113+if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then
114+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: using account password"
115+else
116+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: separate password (will be prompted during setup)"
117+fi
101118
102119 echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
103120 echo "Email: ${ARCHUP_EMAIL:-<not provided>}" >> "$ARCHUP_INSTALL_LOG_FILE"
104121 echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
105122 echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE"
123+echo "Encryption Password: $ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -32,6 +32,16 @@ while true; do
32 fi32 fi
33 done33 done
34 34
35+# Encryption Password Choice
36+echo
37+gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption"
38+gum style --padding "0 0 0 $PADDING_LEFT" "Choose whether to use the same password for disk encryption"
39+if gum confirm "Use same password for disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then
40+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="true"
41+else
42+ ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="false"
43+fi
44+
35 # Email (optional)45 # Email (optional)
36 echo46 echo
37 gum style --padding "0 0 0 $PADDING_LEFT" "Email is used for SSH key generation and git configuration"47 gum style --padding "0 0 0 $PADDING_LEFT" "Email is used for SSH key generation and git configuration"
@@ -81,12 +91,14 @@ export ARCHUP_PASSWORD
81 export ARCHUP_EMAIL91 export ARCHUP_EMAIL
82 export ARCHUP_HOSTNAME92 export ARCHUP_HOSTNAME
83 export ARCHUP_TIMEZONE93 export ARCHUP_TIMEZONE
94+export ARCHUP_ENCRYPTION_USE_SAME_PASSWORD
84 95
85 config_set "ARCHUP_USERNAME" "$ARCHUP_USERNAME"96 config_set "ARCHUP_USERNAME" "$ARCHUP_USERNAME"
86 config_set "ARCHUP_PASSWORD" "$ARCHUP_PASSWORD"97 config_set "ARCHUP_PASSWORD" "$ARCHUP_PASSWORD"
87 config_set "ARCHUP_EMAIL" "$ARCHUP_EMAIL"98 config_set "ARCHUP_EMAIL" "$ARCHUP_EMAIL"
88 config_set "ARCHUP_HOSTNAME" "$ARCHUP_HOSTNAME"99 config_set "ARCHUP_HOSTNAME" "$ARCHUP_HOSTNAME"
89 config_set "ARCHUP_TIMEZONE" "$ARCHUP_TIMEZONE"100 config_set "ARCHUP_TIMEZONE" "$ARCHUP_TIMEZONE"
101+config_set "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD"
90 102
91 # Display summary103 # Display summary
92 echo104 echo
@@ -97,9 +109,15 @@ else
97 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] Email: not provided"109 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] Email: not provided"
98 fi110 fi
99 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Hostname: $ARCHUP_HOSTNAME"111 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Hostname: $ARCHUP_HOSTNAME"
100-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE"112+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE"
113+if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then
114+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: using account password"
115+else
116+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: separate password (will be prompted during setup)"
117+fi
101 118
102 echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"119 echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
103 echo "Email: ${ARCHUP_EMAIL:-<not provided>}" >> "$ARCHUP_INSTALL_LOG_FILE"120 echo "Email: ${ARCHUP_EMAIL:-<not provided>}" >> "$ARCHUP_INSTALL_LOG_FILE"
104 echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE"121 echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
105 echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE"122 echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE"
123+echo "Encryption Password: $ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close