This repository has been archived by the owner on Feb 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Maintenance Menu on boot #317
Open
Stadicus
wants to merge
4
commits into
BitBoxSwiss:master
Choose a base branch
from
Stadicus:20191127-maintenance-menu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Stadicus
force-pushed
the
20191127-maintenance-menu
branch
2 times, most recently
from
December 17, 2019 21:47
256dbc9
to
27fcab9
Compare
Stadicus
added a commit
to Stadicus/bitbox-base
that referenced
this pull request
Dec 20, 2019
The introduction of the Maintenance Menu as a seucrity-senstivie features needs proper documentation. This commit: * replaces the "Factory reset" section in Tinkering with the new "Maintenance Menu" section Depends on: BitBoxSwiss#317
Stadicus
added a commit
to Stadicus/bitbox-base
that referenced
this pull request
Dec 20, 2019
The introduction of the Maintenance Menu as a seucrity-senstivie features needs proper documentation. This commit: * replaces the "Factory reset" section in Tinkering with the new "Maintenance Menu" section Depends on: BitBoxSwiss#317
Because: * The initial reset token system stays in place, but is extended to serve general maintenance purposes, including factory setup. * The factory token is deleted manually or on first setup. This commit: * renames reset-token to maintenance-token * adds a Shift factory token (clearly marked and to be deleted)
Initial implementation of a "Maintenance Menu" that is displayed (without the need to log in) if an authorized maintenance token is found on the USB flashdrive. A maintenance token can be: * a Shift factory token, its hash added in the initial build and removed later (either from the maintenance menu, or on initial setup) * a user token that is written to the flashdrive as part of the Backup process The maintenancen menu is displayed over HDMI on tty2 and allows: * creating and applying Bitcoin block snapshots * finishing the factory setup by deleting any temporary user files * Factory reset... * Authentication: user can reset the password from the BitBoxApp * Configuration reset: factory defaults are restored (Redis database, new SSH and SSL keys...) * Disk image reset: user can flash official, signed BitBoxBase image from USB flashdrive This commit: * The backup to USB flashdrive also creates a maintenance token. * adds /opt/shift/scripts/systemd-startup-maintenance.sh that contains the menu structure and calls bbb-cmd.sh * extends 'bbb-cmd.sh' with * presync create/restore * reset auth/config * during build, the packages 'console-setup' (for command 'chvt') and 'dialog' are no longer removed * adds the systemd unit 'startup-maintenance.service' * adds dialog configuration as '.dialogrc'
Because: * If a unformatted NVMe is present, but a formatted USB drive is connected on first boot, e.g. for factory maintenance, the USB drive is added to /etc/fstab * It is necessary to give the NVMe ssd always precedence over attached USB drives. This commit: * checks if a NVMe drive is present and, if true, no longer checks for any USB drives, formatted or not.
The new maintenance menu needs to be tested in real builds but should not yet be enabled in production builds. By adding this feature, but disabled by default, it can be go into a more extensive security review. This commit: * adds the option BASE_MAINTENANCEMENU, default: 'false' * `startup-maintenance.service` is only enabled if set to true
Stadicus
force-pushed
the
20191127-maintenance-menu
branch
from
February 3, 2020 16:11
27fcab9
to
62bbe1f
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request extends the initial implementation of the autorization reset and adds a "Maintenance Menu" that is displayed (without the need to log in) if an authorized maintenance token is found on the USB flashdrive.
A maintenance token can be:
The maintenancen menu is displayed over HDMI on tty2 and allows:
Not yet implemented: applying the restored configuration (e.g. setting hostname, recreating config files from templates with restored Redis values) which is tracked in a separate issue.