Author SHA1 Message Date
ChasquiLabo 5da579e669 Permitir borrar particiones existentes con confirmación 2026-10-06 17:21:02 -06:00
fauno 85271bdc7c fix: recibir la dirección ip remota desde el proxy 2026-09-29 12:42:11 -03:00
fauno ea63f99d88 feat: preferir overlay2 2026-08-27 10:53:47 -03:00
fauno e3e20ab1dd fix: /usr/sbin/tinc no existe 2026-07-29 17:13:15 -03:00
fauno f4e8c6ff8b feat: usar proveedores alternativos de dns
cuando la red local no provee dns
2026-06-18 12:29:49 -03:00
fauno 7dbee24ff1 fix: avisar cuando el hostname contenga guiones 2026-06-18 10:25:48 -03:00
3 changed files with 46 additions and 6 deletions
+45 -5
View File
@@ -9,9 +9,16 @@ if ! test $UID -eq 0 ; then
exit 1
fi
hostname="`echo $HOSTNAME | tr -d "-" | tr -d "_"`"
dir="`realpath $0 | xargs dirname`"
authorized_keys=/home/$SUDO_USER/.ssh/authorized_keys
if test "$hostname" != "$HOSTNAME" ; then
not_ok "El nombre del servidor no pude contener _ ni -, por favor cambialo con:"
not_ok "sudo hostnamectl hostname $hostname"
exit 1
fi
if ! test -f $authorized_keys; then
not_ok "Primero usa ssh-copy-id desde tu computadora para copiar llaves SSH!"
exit 1
@@ -27,14 +34,47 @@ if test -z "$1"; then
exit 1
fi
if ! grep -q "^FallbackDNS=9.9.9.9" /etc/systemd/resolved.conf; then
ok "Cambiando el proveedor de DNS"
echo "[Resolve]" >/etc/systemd/resolved.conf
echo "FallbackDNS=9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net" >>/etc/systemd/resolved.conf
systemctl restart systemd-resolved
fi
disk=$1
for part in ${disk}?; do
if test -b "$part"; then
not_ok "El disco ${disk} contiene particiones, la instalación destruirá datos"
# Si el disco contiene particiones, ofrecer borrarlas
if lsblk -nr -o TYPE "$disk" | grep -q '^part$'; then
not_ok "El disco ${disk} contiene particiones, la instalación destruirá datos"
echo
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS "$disk"
echo
read -r -p "¿Quieres borrar todas las particiones de ${disk}? Escribe SI para continuar: " respuesta
if [ "$respuesta" != "SI" ]; then
not_ok "Operación cancelada"
exit 1
fi
done
ok "Preparando ${disk} para ser borrado"
sync
swapoff "$disk"* 2>/dev/null || true
lsblk -nrpo NAME,MOUNTPOINT "$disk" | awk '$2 != "" {print $1}' | while read -r part; do
umount "$part" || true
done
ok "Borrando particiones existentes de ${disk}"
wipefs --all --force "$disk"
blockdev --rereadpt "$disk" 2>/dev/null || true
fi
apt update
apt install -y dropbear-initramfs busybox-initramfs smartmontools git rsync make tinc dialog locales bash-completion gnutls-bin nano
@@ -189,7 +229,7 @@ fi
if ! grep -q https://hormuz.respaldos.abyaya.la /etc/docker/daemon.json ; then
ok "Configurando Docker"
echo '{"registry-mirrors":["https://hormuz.respaldos.abyaya.la"]}' >/etc/docker/daemon.json
echo '{"storage-driver":"overlay2","registry-mirrors":["https://hormuz.respaldos.abyaya.la"]}' >/etc/docker/daemon.json
systemctl restart docker
fi
-1
View File
@@ -11,7 +11,6 @@ esac
. /usr/share/initramfs-tools/hook-functions
copy_exec /usr/sbin/tincd /usr/sbin/
copy_exec /usr/sbin/tinc /usr/sbin/
copy_exec /usr/sbin/ip /usr/sbin/
rm "$DESTDIR/etc/dhcpcd.conf"
+1
View File
@@ -34,6 +34,7 @@ sed -re "s/^#(WILDCARDS_ENABLED=1)$/\1/" \
-e "s/^#(SECRET_WILDCARD_CERT_VERSION=v1)$/\1/" \
-e "s/^#(SECRET_WILDCARD_KEY_VERSION=v1)$/\1/" \
-e "s/^#(COMPOSE_FILE=\".COMPOSE_FILE:compose.wildcard.yml\")$/\1/" \
-e "s/^#(TRUSTED_IPS=).*/\1\"['10.13.12.1']\"/" \
-i ~/.abra/servers/default/$traefik.env
ok "Generando e instalando certificados"