home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 26 Apr 2025 03:24:22 +0000 (05:24 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 26 Apr 2025 03:24:22 +0000 (05:24 +0200)
bookworm/scripts/lib/core_setup
bookworm/scripts/setup_catgirl.sh
bookworm/scripts/setup_seedbox.sh
bookworm/scripts/setup_server.sh
testing/scripts/_setup_secrets_user.sh
testing/scripts/setup_desktop.sh
testing/scripts/setup_secrets.sh

index f14d4e7c38d0fdbac1593a50c57fdf789bebcd07..cdd6db98c7d69b877ae033ecfa83b809df38d074 100644 (file)
@@ -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
 }
index 5c0d0dc25ef0bd81600c836f6ea866dfd72aeb12..889d8b93c2d1c99c934371269a07e107daf65f32 100755 (executable)
@@ -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
 
index 3fe7547360dea6193355d264c1c4e801c8b01da2..56d80e4bcaa9a888868fa9fd19d6ba22a99bb224 100755 (executable)
@@ -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
index 68158f46f4ec389f858b6bc2159b6cb8109cb7f4..d36a9ff4001a403be642b833c04a5f07af6ceba4 100755 (executable)
@@ -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'
index 8d3f9bd63dae64a5e443e6c58dab98e26cc038da..5bb416821bc90b18936458f475b59126e37074f3 100644 (file)
@@ -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}"
index f58924cc28038743bd91c9781f729fc88353c1d9..c26024f804fec5eeb5dea22edea99bb03ba6212a 100755 (executable)
@@ -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}"
 
index 67c29e9b4173917cee90587a2d5c499964b68a54..dc715fa7397a234bccfd56df812ba34ca3f07a64 100755 (executable)
@@ -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"