From: Christian Heller Date: Sat, 26 Apr 2025 03:24:22 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/decks/template?a=commitdiff_plain;h=HEAD;p=config Fix. --- diff --git a/bookworm/scripts/lib/core_setup b/bookworm/scripts/lib/core_setup index f14d4e7..cdd6db9 100644 --- a/bookworm/scripts/lib/core_setup +++ b/bookworm/scripts/lib/core_setup @@ -10,7 +10,7 @@ core_setup() { _EXTERNAL_IP="$3" _INSTALL_TAGS="$4" - echo "Installing and/or keeping only what's required by us or Debian." + echo '· Installing and/or keeping only what's required by us or Debian.' # mark non-requireds auto _PATH_LIST_PREFIX=/tmp/list_ @@ -29,23 +29,23 @@ core_setup() { # before purging, ensure tagged packages installed ensure_packages_of_tags ${_INSTALL_TAGS} - echo "Autoremove and purge …" + echo '· Autoremove and purge …' apt_get_edited '-q -q autopurge' - echo "And now: dist-upgrade …" + echo '· And now: dist-upgrade …' apt_get_edited '-q -q dist-upgrade' - echo "Setting up user: ${USERNAME}" + echo "· Setting up user: ${USERNAME}" adduser --quiet --disabled-password --gecos "" "${USERNAME}" usermod -a -G sudo "${USERNAME}" - echo '\nCopying over files, directories.' + echo '· Copying over files, directories …' copy_dirtrees_of_tags ${_INSTALL_TAGS} - echo 'Setting hostname …' + echo '· Setting hostname …' echo "${_HOSTNAME}" > "${PATH_ETC}/hostname" hostname "${_HOSTNAME}" - echo "Adapting ${_PATH_HOSTS} …" + echo "· Adapting ${_PATH_HOSTS} …" _PATH_HOSTS="${PATH_ETC}/hosts" if [ -z "${_FQDN}" ]; then sed -i 's/REPLACE_WITH_FQDN/REPLACE_WITH_HOSTNAME.local REPLACE_WITH_HOSTNAME.localdomain/g' "${_PATH_HOSTS}" @@ -55,6 +55,6 @@ core_setup() { fi sed -i 's/REPLACE_WITH_HOSTNAME/'"${_HOSTNAME}"'/g' "${_PATH_HOSTS}" - echo 'Syncing clock.' + echo '· Syncing clock …' ntpdate-debian -s } diff --git a/bookworm/scripts/setup_catgirl.sh b/bookworm/scripts/setup_catgirl.sh index 5c0d0dc..889d8b9 100755 --- a/bookworm/scripts/setup_catgirl.sh +++ b/bookworm/scripts/setup_catgirl.sh @@ -13,12 +13,12 @@ check_finished_marker 'setup_server' install_tags catgirl PATH_USER_CONF_CATGIRL="${PATH_USER_HOME}/.config/catgirl/libera" -echo "\nWriting provided password into ${PATH_USER_CONF_CATGIRL}." +echo "\n· Writing provided password into ${PATH_USER_CONF_CATGIRL} …" sed -i "s/REPLACE_WITH_IRC_PASSWORD/${IRC_PASSWORD}/g" "${PATH_USER_CONF_CATGIRL}" -echo "\nActivating catgirl tmux session service." +echo "· Activating catgirl tmux session service …" systemctl enable --now catgirl -echo "\nActivating catgirl logs encryption service/timer." +echo "· Activating catgirl logs encryption service/timer …" systemctl enable --now encrypt_catgirl_logs.timer diff --git a/bookworm/scripts/setup_seedbox.sh b/bookworm/scripts/setup_seedbox.sh index 3fe7547..56d80e4 100755 --- a/bookworm/scripts/setup_seedbox.sh +++ b/bookworm/scripts/setup_seedbox.sh @@ -10,8 +10,8 @@ expect_n_args 0 0 '' $@ check_finished_marker 'setup_server' install_tags seedbox -echo 'Setting up upload user/directory.' +echo '· Setting up upload user/directory …' adduser --quiet --system --home /home/upload upload -echo 'Activating rtorrent tmux session service.' +echo '· Activating rtorrent tmux session service …' systemctl enable --now rtorrent diff --git a/bookworm/scripts/setup_server.sh b/bookworm/scripts/setup_server.sh index 68158f4..d36a9ff 100755 --- a/bookworm/scripts/setup_server.sh +++ b/bookworm/scripts/setup_server.sh @@ -21,22 +21,22 @@ PATH_CADDYFILE="${PATH_ETC}/caddy/Caddyfile" PATH_CADDY_REPO='https://dl.cloudsmith.io/public/caddy/stable' PATH_DUMP='/var/www/dump' -echo -n 'Determining IP …' +echo -n '· Determining IP …' EXTERNAL_IP=$(hostname -I | cut -d' ' -f1) echo " it's: ${EXTERNAL_IP}" if [ ! -z "${FQDN}" ]; then - echo "Ensuring provided FQDN ${FQDN} maps to it …" + echo "· Ensuring provided FQDN ${FQDN} maps to it …" IP_BY_DNS=$(getent ahostsv4 "${FQDN}" | head -1 | cut -d' ' -f1) if [ ! "${IP_BY_DNS}" = "${EXTERNAL_IP}" ]; then abort "DNS mapping provided FQDN '${FQDN}' to ${IP_BY_DNS} rather than this system's external IP ${EXTERNAL_IP}." fi fi -echo 'Ensure we have curl (for caddy installation preparation) …' +echo '· Ensure we have curl (for caddy installation preparation) …' apt-get -y install curl > /dev/null PATH_CURL_ERROR="$(path_tmp_timestamped curl_error)" -echo 'Retrieve caddy repo key …' +echo '· Retrieve caddy repo key …' set +e curl -1Lf "${PATH_CADDY_REPO}/gpg.key" 2> "${PATH_CURL_ERROR}" | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg RESULT="$?" @@ -46,28 +46,28 @@ if [ "${RESULT}" != '0' ]; then exit 1 fi PATH_APT_CADDY_REPO='/etc/apt/sources.list.d/caddy-stable.list' -echo "Adding caddy repo to ${PATH_APT_CADDY_REPO} …" +echo "· Adding caddy repo to ${PATH_APT_CADDY_REPO} …" curl -1LfsS "${PATH_CADDY_REPO}/debian.deb.txt" > "${PATH_APT_CADDY_REPO}" core_setup "${HOSTNAME}" "${FQDN}" "${EXTERNAL_IP}" "${INSTALL_TAGS}" -echo 'Moving SSH data from root to user …' +echo '· Moving SSH data from root to user …' mkdir -p "${PATH_USER_SSH}" mv "/root/${PATH_REL_SSH}/authorized_keys" "${PATH_USER_SSH}/" chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_SSH}" -echo 'Setting up minimal borg user …' +echo '· Setting up minimal borg user …' adduser --quiet --system --home "${PATH_BORG_HOME}" --shell /bin/sh borg cp -a "${PATH_USER_SSH}" "${PATH_BORG_HOME}/" chown -R borg:nogroup "${PATH_BORG_HOME}/${PATH_REL_SSH}" -echo 'Enabling firewall …' +echo '· Enabling firewall …' systemctl --quiet enable --now nftables -echo "Creating web-accessible directories …" +echo "· Creating web-accessible directories …" mkdir -p "${PATH_DUMP}/private" "${PATH_DUMP}/public" -echo "Adapting ${PATH_CADDYFILE} …" +echo "· Adapting ${PATH_CADDYFILE} …" CADDY_PW_HASH=$(caddy hash-password --plaintext "${CADDY_PASSWORD}") if [ -z "${FQDN}" ]; then ADDRESS_TO_CADDY="${EXTERNAL_IP}" @@ -77,7 +77,7 @@ fi sed -i 's|REPLACE_WITH_HASH|'"${CADDY_PW_HASH}"'|g' "${PATH_CADDYFILE}" sed -i 's/REPLACE_WITH_FQDN/'"${ADDRESS_TO_CADDY}"'/g' "${PATH_CADDYFILE}" -echo "Restarting caddy …" +echo "· Restarting caddy …" systemctl reload caddy put_finished_marker 'setup_server' diff --git a/testing/scripts/_setup_secrets_user.sh b/testing/scripts/_setup_secrets_user.sh index 8d3f9bd..5bb4168 100644 --- a/testing/scripts/_setup_secrets_user.sh +++ b/testing/scripts/_setup_secrets_user.sh @@ -27,7 +27,7 @@ mount_secrets "$1" # sets PASSPHRASE copy_and_unmount_secrets 'in' export BORG_PASSPHRASE="${PASSPHRASE}" -echo "\nSetting up ~/.ssh" +echo "\n· Setting up ~/.ssh …" cp -a "${PATH_SECRETS_SSH}" "${PATH_USER_SSH}" eval $(ssh-agent) stty -echo @@ -36,7 +36,7 @@ retry_until 1 'echo ""' 'ssh-add -q' 'echo "Aborting due to ssh-add error"' stty echo trapp -echo "\n\nSetting up ~/repos" +echo "\n\n· Setting up ~/repos …" REPOS_SITE_LOGIN="${USERNAME}@${REPOS_SITE_DOMAIN}" mkdir "${PATH_REPOS}" cd "${PATH_REPOS}" @@ -45,11 +45,11 @@ ssh ${REPOS_SITE_LOGIN} "cd ${REMOTE_PATH_REPOS} && ls -1" | while read REPO_NAM done cd - > /dev/null -echo "\nSetting up borg and pull in ~/org" +echo "\n· Setting up borg and pull in ~/org …" cd "${PATH_SECRETS_BORGKEYS}" ls -1 | while read _FILENAME; do "${NAME_BORGAPP}" claim "${_FILENAME}" done cd - -retry_until 2 '' "${NAME_BORGAPP} orgpull" "echo 'Aborting due to unexpected ${NAME_BORGAPP} error.'" '' 'direct' +retry_until 2 '' "${NAME_BORGAPP} orgpull" "echo '· Aborting due to unexpected ${NAME_BORGAPP} error.'" '' 'direct' echo "${_OUTPUT}" diff --git a/testing/scripts/setup_desktop.sh b/testing/scripts/setup_desktop.sh index f58924c..c26024f 100755 --- a/testing/scripts/setup_desktop.sh +++ b/testing/scripts/setup_desktop.sh @@ -56,24 +56,24 @@ adopt_wifi_connection() { fi } -echo "\nUpgrading to testing." +echo "\n· Upgrading to testing …" ./from_older_upgrade.sh # NB: This needs to come before steps potentially overwriting /etc/network/interfaces. apt-get -y install network-manager > /dev/null if [ "$(nmcli -f TYPE conn | grep 'wifi' | wc -l)" = "0" ]; then - echo "\nChecking for existing wifi config in ${PATH_NETWORK_INTERFACES}." + echo "\n· Checking for existing wifi config in ${PATH_NETWORK_INTERFACES} …" adopt_wifi_connection else - echo "\nAlready know wifi connection, nothing to add." + echo "\n· Already know wifi connection, nothing to add …" fi core_setup "${SYSTEM_NAME}" "" "" "${INSTALL_TAGS}" -echo "\nEnsuring our desired locale is available." +echo '\n· Ensuring our desired locale is available …' locale-gen -echo '\nFinal user setup.' +echo '\n· Final user setup …' adduser --quiet plom plugdev # so user may use pmount passwd "${USERNAME}" diff --git a/testing/scripts/setup_secrets.sh b/testing/scripts/setup_secrets.sh index 67c29e9..dc715fa 100755 --- a/testing/scripts/setup_secrets.sh +++ b/testing/scripts/setup_secrets.sh @@ -13,7 +13,7 @@ PATH_REL_SETUP_SECRETS_USER="$(basename ${PATH_CONF})/$(basename ${PATH_SCRIPTS} PATH_REPO="$(dirname ${PATH_CONF})" PATH_TMP_REPO="$(path_tmp_timestamped configrepo)" -echo "Setting up config repo copy for user at ${PATH_TMP_REPO} …" +echo "· Setting up config repo copy for user at ${PATH_TMP_REPO} …" cp -a "${PATH_REPO}" "${PATH_TMP_REPO}" chown -R "${USERNAME}:${USERNAME}" "${PATH_TMP_REPO}" su -l "${USERNAME}" -c "/bin/sh ${PATH_TMP_REPO}/${PATH_REL_SETUP_SECRETS_USER} $1"