From 96e0d81991920db5f23a8a1e7b7e990219b444b9 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 4 Mar 2022 06:01:27 -0500 Subject: [PATCH] remove obsolete files --- packaging/live-iso/files/etc/hostname | 1 - packaging/live-iso/files/root/.ssh/config | 3 - .../files/root/.ssh/id_rsa_villas-public | 27 ------ .../files/root/.ssh/id_rsa_villas-public.pub | 1 - .../live-iso/files/root/.ssh/known_hosts | 1 - .../live-iso/files/usr/local/bin/install-tinc | 94 ------------------- .../live-iso/files/usr/local/bin/remote-admin | 71 -------------- 7 files changed, 198 deletions(-) delete mode 100644 packaging/live-iso/files/etc/hostname delete mode 100644 packaging/live-iso/files/root/.ssh/config delete mode 100644 packaging/live-iso/files/root/.ssh/id_rsa_villas-public delete mode 100644 packaging/live-iso/files/root/.ssh/id_rsa_villas-public.pub delete mode 100644 packaging/live-iso/files/root/.ssh/known_hosts delete mode 100644 packaging/live-iso/files/usr/local/bin/install-tinc delete mode 100755 packaging/live-iso/files/usr/local/bin/remote-admin diff --git a/packaging/live-iso/files/etc/hostname b/packaging/live-iso/files/etc/hostname deleted file mode 100644 index 47c04460c..000000000 --- a/packaging/live-iso/files/etc/hostname +++ /dev/null @@ -1 +0,0 @@ -villas-live \ No newline at end of file diff --git a/packaging/live-iso/files/root/.ssh/config b/packaging/live-iso/files/root/.ssh/config deleted file mode 100644 index 549063905..000000000 --- a/packaging/live-iso/files/root/.ssh/config +++ /dev/null @@ -1,3 +0,0 @@ -Host villas.fein-aachen.prg - User remote-admin - IdentityFile ~/.ssh/id_rsa_villas-public \ No newline at end of file diff --git a/packaging/live-iso/files/root/.ssh/id_rsa_villas-public b/packaging/live-iso/files/root/.ssh/id_rsa_villas-public deleted file mode 100644 index 99d8b65d7..000000000 --- a/packaging/live-iso/files/root/.ssh/id_rsa_villas-public +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA4v5RJYmox+y5EZtSgO5q8C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f3iYAmlB+J6g3FeEP+wATffrBT5dShtwD5UleMUpRpDADZIoaGllkwx -zb1exl69B/ygieKLpYUhm4FXPc6gRH84mEmyVXH6nu5cS9VDnXpHvj4hSiAn7Ko8 -1NzqJPPZEtrIZaYDxYV5rV0CgYEAgPkFlxi/SmhfZD/1CZ5gc23trZuPPpiLfg3N -ea6sjwQ5NlxfIP/U1XMOiC4iwiHwQ/e1ngau6fKVAJ+AnaStzwZRQvNtzxHA2//H -uc9CZGm/TBOhKDgkp56GvNotN6AOmvjjH1UuZWyqjodqKjG4WUaqqjzQQ5auBUMX -wwfU3icCgYEAqG8ZKulCV57d2McC+KzrtlAGMIgSJD0ddoBVrBrB9ICqnVfC2wPP -TUjoDkuwiyxUuDb97qszsohTBU0jF6v+3w6a+mjAjGnOZy9ApJWjnQlyR8surQpd -00d8zgdJ5FfUORpoIKZV2oJsjK37LNipu26yV5egOnzZbIoud2aNphg= ------END RSA PRIVATE KEY----- diff --git a/packaging/live-iso/files/root/.ssh/id_rsa_villas-public.pub b/packaging/live-iso/files/root/.ssh/id_rsa_villas-public.pub deleted file mode 100644 index 7f65a43f3..000000000 --- a/packaging/live-iso/files/root/.ssh/id_rsa_villas-public.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDi/lEliajH7LkRm1KA7mrwKgt8Z6vj5F19FwfYEnbHnrwsgRsnt+S1i7GofHuLPWf7cfruHZjaTkKaWtIgwt/h3wqDXyOV//un7sGRo041H3/qH9N7cb46bi0wiXlE3sbdTAK9UtsU6oR17Vf+9O8DFXdyJru2hMA2wDTMiUqbFPO23iOfRInGQqpVGmjmZxJE5QRE487tai4O0Lzw48E8+ixMALHXM57iBfYsb0JNGudKHDPEeu39eF1rBKQhUUZTwRjihKu4kwjj065B3c/Lq3wnlrWhVq2tlnnSfwi7ztyr1MAJyTKiiBwLZY8jr1lwjyjboqrUGhvUPSBwzefv stv0g@cam.wg.0l.dn42 diff --git a/packaging/live-iso/files/root/.ssh/known_hosts b/packaging/live-iso/files/root/.ssh/known_hosts deleted file mode 100644 index 305c709a9..000000000 --- a/packaging/live-iso/files/root/.ssh/known_hosts +++ /dev/null @@ -1 +0,0 @@ -vpn.fein-aachen.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEeCQWXxvvaeQWDoNbP4GfSIin9vqjt6nui0cp4D22LjB7/XcQQ4qnDZ0DjZ/O7HXbaATds9kW3QEqZe7F1F8Go= diff --git a/packaging/live-iso/files/usr/local/bin/install-tinc b/packaging/live-iso/files/usr/local/bin/install-tinc deleted file mode 100644 index cf07bb753..000000000 --- a/packaging/live-iso/files/usr/local/bin/install-tinc +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash - -# Usage: install-tinc ip-address network-name invitation-token -# Example install-tinc 10.10.12.111 villas 134.130.169.31:12010/Pgm3usgu7X65akq_0oudfas0htjdgaHnbavWTVQ0Nq6M0JkiW3 -# -# One-liner: -# -# curl -s https://git.rwth-aachen.de/acs/public/villas/Images/raw/master/files/usr/local/bin/install-tinc | bash /dev/stdin 10.10.12.111 villas 134.130.169.31:12010/Pgm3usgu7X65akq_0oudfas0htjdgaHnbavWTVQ0Nq6M0JkiW3 - -DEFAULT_IP=10.10.12.$((128 + RANDOM % 127))/24 -DEFAULT_NET=villas - -IP=${1:-${DEFAULT_IP}} -NET=${2:-${DEFAULT_NET}} -INVITATION=$3 - -# Abort on error -set -e - -# Add /usr/local to path if not present -if ! echo "${PATH}" | grep -q /usr/local/bin; then - cat <<-'EOF' >> /etc/profile.d/local_path.sh - # Set our default path - PATH="/usr/local/bin:${PATH}" - export PATH - EOF - - source /etc/profile - - echo "Added /usr/local/bin to PATH" -fi - -if ! command tinc --version > /dev/null; then - echo "Tinc is not yet installed. Starting installation" - - source /etc/os-release - - case $ID in - debian|ubuntu) - apt-get -y install git autoconf automake build-essential libssl-dev zlib1g-dev liblzo2-dev libreadline-dev libncurses-dev libsystemd-dev texinfo - ;; - - fedora|centos|rocky|redhat) - dnf -y install git autoconf automake make gcc openssl-devel zlib-devel lzo-devel readline-devel ncurses-devel systemd-devel texinfo - ;; - esac - - mkdir -p /root/build - pushd /root/build - - git clone https://github.com/gsliepen/tinc.git - - pushd /root/build/tinc - - git checkout 1.1 - - autoreconf - automake --add-missing - - ./configure --sysconfdir=/etc --localstatedir=/var --with-systemd=/etc/systemd/system - make install - - systemctl daemon-reload - - popd - popd -fi - -if [ -n "${NET}" ]; then - - if [ -n "${INVITATION}" ]; then - tinc -n ${NET} join ${INVITATION} - fi - - if [ -n "${IP}" ]; then - cat <<- EOF > /etc/tinc/${NET}/tinc-up - #!/bin/bash - ip link set dev \$INTERFACE up - ip addr add ${IP} dev \$INTERFACE - EOF - - # Get the name of this node from the config file - NAME=$(sed -n 's/^Name = //p' /etc/tinc/${NET}/tinc.conf) - - cat <<- EOF >> /etc/tinc/${NET}/hosts/${NAME} - Subnet = ${IP} - EOF - - chmod +x /etc/tinc/${NET}/tinc-up - fi - - systemctl enable tinc@${NET} - systemctl restart tinc@${NET} -fi diff --git a/packaging/live-iso/files/usr/local/bin/remote-admin b/packaging/live-iso/files/usr/local/bin/remote-admin deleted file mode 100755 index 5f14e6fec..000000000 --- a/packaging/live-iso/files/usr/local/bin/remote-admin +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -set -e - -SERVER=vpn.fein-aachen.org -USER=remote-admin - -# This is the Tinc internal IP of villas.fein-aachen.org -BIND_TO=10.10.12.7 - -PORT=15000 -PORT_MAX=150010 - -SSH_OPTS="-f -N -o ExitOnForwardFailure=yes -o BatchMode=yes -o ConnectTimeout=5" - -# setup SSH reverse tunnel for remote administration -echo "Starting to establish SSH tunnel" - -while ! ssh $SSH_OPTS -R $BIND_TO:$PORT:localhost:22 $USER@$SERVER &>/dev/null; do - PID=$! - PORT=$(($PORT+1)) - if (( $PORT > $PORT_MAX )); then - echo "Failed to find available port" - exit -1; - fi -done - -echo "Listening via SSH reverse tunnel at: $SERVER:$PORT with pid: $PID" - -# get internet IP -IP=$(curl -s http://canihazip.com/s) - -# get reverse DNS hostname -HOSTNAME=$(dig +short -x $IP) -if [ -z "$HOSTNAME" ]; then - HOSTNAME=$(hostname) -fi - -MAIL_CONTENTS=$(mktemp) - -# send mail with notification about new node -cat << EOF > $MAIL_CONTENTS -There's a new host with the VILLASlive Image running: - -Image version: $(cat /etc/image-release) -Reverse SSH tunnel port: $PORT -Internet IP: $IP -Hostname: $HOSTNAME - -Latency: -$(ping -qc 5 $SERVER) - -Traceroute: -$(traceroute $SERVER) - -Interfaces: -$(ip addr) - -Kernel: -$(uname -a) - -Hardware: -$(lshw) - -EOF - -ssh $USER@$SERVER < $MAIL_CONTENTS > /dev/null - -rm $MAIL_CONTENTS - -echo "Notified admins about new VILLASlive instance."