Skip to content

Commit

Permalink
Installation wizard TUI (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Aug 22, 2021
1 parent 6b54d7f commit 59b839d
Show file tree
Hide file tree
Showing 8 changed files with 645 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- New installation wizard TUI

- Update Bitcoin Core to v0.21.1

- Update Specter Desktop to v1.5.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM $BASE_IMAGE
# See the 'docker' directory for arm32v7/arm64v8

# Build settings
ARG INSTALL=bitcoind,bwt,btc-rpc-explorer,specter,tor,nginx,letsencrypt,dropbear
ARG INSTALL=bitcoind,bwt,btc-rpc-explorer,specter,tor,nginx,letsencrypt,dropbear,wizard
ARG DEV

ARG BWT_VERSION=0.2.4
Expand Down
9 changes: 2 additions & 7 deletions docker/networking.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# -- expected to be `source`ed

# Detect host OS. Docker on macOS/Widows behaves differently:
# https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds
# https://docs.docker.com/docker-for-windows/networking/#known-limitations-use-cases-and-workarounds
HOST_OS=$(uname -r | grep -Eq -- '-(moby|linuxkit)' && echo macOS \
|| (uname -r | grep -Eq -- '-microsoft' && echo Windows \
|| echo Linux))

# Detect Docker's networking mode and determine the address to bind on
if [ -z "$BIND_ADDR" ]; then
addrs=$(hostname -I)

# macOS/windows doesn't support host networking mode and doesn't allow accessing
# the container by its virtual IP address, so we can just bind on 0.0.0.0.
# https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds
# https://docs.docker.com/docker-for-windows/networking/#known-limitations-use-cases-and-workarounds
if [ $HOST_OS != Linux ]; then
export BIND_ADDR=0.0.0.0

Expand Down
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ export S6_KEEP_ENV=1
export S6_SERVICES_GRACETIME=2700000 # 45 minutes, to allow Bitcoin Core to shutdown cleanly
export S6_KILL_FINISH_MAXTIME=$S6_SERVICES_GRACETIME # for the shutdown-status script

# Detect host OS
export HOST_OS=$(uname -r | grep -Eq -- '-(moby|linuxkit)' && echo macOS \
|| (uname -r | grep -Eq -- '-microsoft' && echo Windows \
|| echo Linux))

# Installation wizard
if [ "$1" == "wizard" ]; then
/ez/wizard/wizard
shift
fi

# Load config options from file
# `set -a` exports all defined variables without requiring an explicit `export`
if [ -f /data/config ]; then set -a; source /data/config; set +a
Expand Down
2 changes: 2 additions & 0 deletions util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ restart_with() {
}

BOLD=$(echo -en '\e[1m')
UNDER=$(echo -en '\e[4m')
UNDER_R=$(echo -en '\e[24m')
RED=$(echo -en '\e[31m')
GREEN=$(echo -en '\e[32m')
#LGREEN=$(echo -en '\e[92m')
Expand Down
7 changes: 7 additions & 0 deletions wizard/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -xeo pipefail

apt-get install -qqy dialog

mkdir /ez/wizard
mv wizard *.dialogrc /ez/wizard
131 changes: 131 additions & 0 deletions wizard/monochrome.dialogrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Set aspect-ration.
aspect = 0

# Set separator (for multiple widgets output).
separate_widget = ""

# Set tab-length (for textbox tab-conversion).
tab_len = 0

# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF

# Shadow dialog boxes? This also turns on color.
use_shadow = OFF

# Turn color support ON or OFF
use_colors = ON

# Screen color
screen_color = (WHITE,BLACK,ON)

# Shadow color
shadow_color = (BLACK,BLACK,OFF)

# Dialog box color
dialog_color = (BLACK,WHITE,OFF)

# Dialog box title color
title_color = (BLACK,WHITE,OFF)

# Dialog box border color
border_color = (BLACK,WHITE,ON)

# Active button color
button_active_color = (WHITE,BLACK,ON)

# Inactive button color
button_inactive_color = dialog_color

# Active button key color
button_key_active_color = button_active_color

# Inactive button key color
button_key_inactive_color = (BLACK,WHITE,ON)

# Active button label color
button_label_active_color = (WHITE,BLACK,ON)

# Inactive button label color
button_label_inactive_color = (BLACK,WHITE,OFF)

# Input box color
inputbox_color = dialog_color

# Input box border color
inputbox_border_color = dialog_color

# Search box color
searchbox_color = dialog_color

# Search box title color
searchbox_title_color = title_color

# Search box border color
searchbox_border_color = border_color

# File position indicator color
position_indicator_color = title_color

# Menu box color
menubox_color = dialog_color

# Menu box border color
menubox_border_color = border_color

# Item color
item_color = dialog_color

# Selected item color
item_selected_color = button_active_color

# Tag color
tag_color = title_color

# Selected tag color
tag_selected_color = button_label_active_color

# Tag key color
tag_key_color = button_key_inactive_color

# Selected tag key color
tag_key_selected_color = (WHITE,BLACK,ON)

# Check box color
check_color = dialog_color

# Selected check box color
check_selected_color = button_active_color

# Up arrow color
uarrow_color = (GREEN,WHITE,ON)

# Down arrow color
darrow_color = uarrow_color

# Item help-text color
itemhelp_color = (WHITE,BLACK,OFF)

# Active form text color
form_active_text_color = (BLACK,WHITE,OFF)

# Form text color
form_text_color = (BLACK,WHITE,OFF)

# Readonly form item color
form_item_readonly_color = (CYAN,WHITE,ON)

# Dialog box gauge color
gauge_color = (BLUE,WHITE,ON)

# Dialog box border2 color
border2_color = dialog_color

# Input box border2 color
inputbox_border2_color = dialog_color

# Search box border2 color
searchbox_border2_color = dialog_color

# Menu box border2 color
menubox_border2_color = dialog_color
Loading

0 comments on commit 59b839d

Please sign in to comment.