From 7d0c720052aad2e0c52f471aa2572da70228c4bf Mon Sep 17 00:00:00 2001 From: mariusdjen Date: Tue, 14 Apr 2026 15:43:32 +0200 Subject: [PATCH] rename: vps-bootstrap legacy references to vpskit The project was renamed from vps-bootstrap to vpskit but several legacy names remained: the local session file, the remote progress file, ssh-keygen key comment, user-facing messages, and a few doc references. Rename everything to vpskit and migrate existing users transparently: - Local session: ~/.ssh/.vps-bootstrap-local -> ~/.ssh/.vpskit-local - Remote progress: /root/.vps-bootstrap-progress -> /root/.vpskit-progress - On first run, each script moves the legacy file to the new name if the new one does not exist yet, so users with an existing session lose nothing. - New SSH keys generated by setup.sh now use "vpskit" as the comment instead of "vps-bootstrap". - User-facing messages in fr/en lang files updated. - SSH key selection still excludes both .vps-bootstrap* and .vpskit* so legacy artifacts stay hidden during cleanup. - SECURITY.md and docs/architecture.md file paths updated. - Stale setup.sh curl usage URL pointed back at the vpskit repo. --- CHANGELOG.md | 8 ++++++++ SECURITY.md | 2 +- backup.sh | 6 +++++- deploy.sh | 8 ++++++-- docs/architecture.md | 2 +- lang/en.sh | 18 +++++++++--------- lang/fr.sh | 18 +++++++++--------- security.sh | 6 +++++- settings.sh | 6 +++++- setup.sh | 22 ++++++++++++++++------ status.sh | 6 +++++- 11 files changed, 70 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b0d9e7..9040412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +- Rename legacy `vps-bootstrap` references to `vpskit` across scripts, lang files, and docs +- Local session file moved from `~/.ssh/.vps-bootstrap-local` to `~/.ssh/.vpskit-local` (auto-migrated on first run) +- Remote progress file moved from `/root/.vps-bootstrap-progress` to `/root/.vpskit-progress` (auto-migrated on first run) +- New SSH keys generated by setup.sh now use `vpskit` as the key comment +- Fix crash on fresh machines where `~/.ssh/` did not exist when saving the language preference + ## v2.3.1 - Security fix: escape user inputs in sed (anti-injection) diff --git a/SECURITY.md b/SECURITY.md index 95914dd..23c6200 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ This project follows strict security practices across all scripts: - Remote temp files use **`mktemp`** (unpredictable names), are set to **chmod 700**, and are deleted after execution. ### File permissions -- Session files (`~/.ssh/.vps-bootstrap-local`): **chmod 600** +- Session files (`~/.ssh/.vpskit-local`): **chmod 600** - S3 credentials (`~/.ssh/.vpskit-s3`): **chmod 600** - `.env` files: **chmod 600** - Remote scripts: **chmod 700** diff --git a/backup.sh b/backup.sh index 323322c..29162b0 100644 --- a/backup.sh +++ b/backup.sh @@ -90,7 +90,11 @@ RESTORE_FILE="" echo "" SSH_DIR="$HOME/.ssh" - LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" + LOCAL_STATE="$SSH_DIR/.vpskit-local" + LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" + if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" + fi if [ -f "$LOCAL_STATE" ]; then VPS_IP=$(read_state_var "$LOCAL_STATE" "VPS_IP") diff --git a/deploy.sh b/deploy.sh index 043184a..4ac3cf7 100755 --- a/deploy.sh +++ b/deploy.sh @@ -3,7 +3,7 @@ set -euo pipefail # ============================================ # Déploiement d'une application sur un VPS -# Utilise la session de vps-bootstrap +# Utilise la session de vpskit # # Usage : bash deploy.sh # ============================================ @@ -112,7 +112,11 @@ DEPLOY_TAG="" echo "" SSH_DIR="$HOME/.ssh" - LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" + LOCAL_STATE="$SSH_DIR/.vpskit-local" + LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" + if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" + fi if [ -f "$LOCAL_STATE" ]; then VPS_IP=$(read_state_var "$LOCAL_STATE" "VPS_IP") diff --git a/docs/architecture.md b/docs/architecture.md index 597715e..477c3b2 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -51,7 +51,7 @@ ssh execute script (with sudo if update mode) detect_distro() via /etc/os-release | v -Load progress (/root/.vps-bootstrap-progress) +Load progress (/root/.vpskit-progress) | v For each step 1-9: diff --git a/lang/en.sh b/lang/en.sh index 3a492de..2788e8b 100644 --- a/lang/en.sh +++ b/lang/en.sh @@ -67,7 +67,7 @@ MSG_SETTINGS_KEYS_TITLE="SSH keys in ~/.ssh/:" MSG_SETTINGS_KEYS_NONE="No SSH keys found in ~/.ssh/" MSG_SETTINGS_KEYS_DELETE_PROMPT="Delete which one? (0-%s): " MSG_SETTINGS_KEYS_ACTIVE="[ACTIVE KEY]" -MSG_SETTINGS_KEYS_ACTIVE_WARN1="This key is configured as the active key in your vps-bootstrap session." +MSG_SETTINGS_KEYS_ACTIVE_WARN1="This key is configured as the active key in your vpskit session." MSG_SETTINGS_KEYS_ACTIVE_WARN2="Deleting this key will prevent you from connecting to your VPS." MSG_SETTINGS_KEYS_ACTIVE_WARN3="Continue only if you know what you are doing." MSG_SETTINGS_KEYS_DELETE_CONFIRM="Permanently delete these files:" @@ -313,12 +313,12 @@ MSG_DEPLOY_INTRO_READY=" Let's go step by step." MSG_DEPLOY_STEP1_TITLE="[>] Step 1: Connect to VPS" MSG_DEPLOY_STEP1_INTRO=" We need your server information." -MSG_DEPLOY_SESSION_FOUND="vps-bootstrap session detected:" +MSG_DEPLOY_SESSION_FOUND="vpskit session detected:" MSG_DEPLOY_SESSION_CONFIRM_PROMPT=" Is this your server? (y/N): " MSG_DEPLOY_SESSION_IP="Server : %s" MSG_DEPLOY_SESSION_KEY="SSH key : %s" MSG_DEPLOY_SESSION_USER="User : %s" -MSG_DEPLOY_SESSION_NOT_FOUND="No vps-bootstrap session found." +MSG_DEPLOY_SESSION_NOT_FOUND="No vpskit session found." MSG_DEPLOY_SESSION_NOT_FOUND_HINT1=" If you used setup.sh before, the info should be saved automatically." MSG_DEPLOY_SESSION_NOT_FOUND_HINT2=" Otherwise, no worries, we will ask for it." MSG_DEPLOY_IP_HINT1=" Your VPS IP address can be found in your hosting provider's dashboard" @@ -659,12 +659,12 @@ RMSG_UPDATE_DONE_DOMAIN=" Domain : %s" MSG_STATUS_UNKNOWN_ARG="Unknown argument: %s" MSG_STATUS_USAGE=" Usage: bash status.sh -ip IP -key KEY -user USER" MSG_STATUS_HEADER="Displays the status of your VPS" -MSG_STATUS_SESSION_FOUND="vps-bootstrap session detected:" +MSG_STATUS_SESSION_FOUND="vpskit session detected:" MSG_STATUS_SESSION_IP="Server : %s" MSG_STATUS_SESSION_KEY="SSH key : %s" MSG_STATUS_SESSION_USER="User : %s" MSG_STATUS_SESSION_CONFIRM=" Is this your server? (y/N): " -MSG_STATUS_NO_SESSION="No vps-bootstrap session found." +MSG_STATUS_NO_SESSION="No vpskit session found." MSG_STATUS_RUN_SETUP=" Run setup.sh first to configure your VPS." MSG_STATUS_PROMPT_IP=" VPS IP address: " MSG_STATUS_PROMPT_KEY=" SSH key path (e.g. ~/.ssh/id_ed25519): " @@ -720,12 +720,12 @@ RMSG_STATUS_SECURITY_SSL_ERR="SSL %s: expired" MSG_SECURITY_UNKNOWN_ARG="Unknown argument: %s" MSG_SECURITY_USAGE=" Usage: bash security.sh -ip IP -key KEY -user USER" MSG_SECURITY_HEADER="Security audit of your VPS" -MSG_SECURITY_SESSION_FOUND="vps-bootstrap session detected:" +MSG_SECURITY_SESSION_FOUND="vpskit session detected:" MSG_SECURITY_SESSION_IP="Server : %s" MSG_SECURITY_SESSION_KEY="SSH key : %s" MSG_SECURITY_SESSION_USER="User : %s" MSG_SECURITY_SESSION_CONFIRM=" Is this your server? (y/N): " -MSG_SECURITY_NO_SESSION="No vps-bootstrap session found." +MSG_SECURITY_NO_SESSION="No vpskit session found." MSG_SECURITY_RUN_SETUP=" Run setup.sh first to configure your VPS." MSG_SECURITY_PROMPT_IP=" VPS IP address: " MSG_SECURITY_PROMPT_KEY=" SSH key path (e.g. ~/.ssh/id_ed25519): " @@ -815,12 +815,12 @@ MSG_BACKUP_UNKNOWN_ARG="Unknown argument: %s" MSG_BACKUP_USAGE=" Usage: bash backup.sh -ip IP -key KEY -user USER [-app NAME] [-dest /path]" MSG_BACKUP_USAGE_RESTORE=" Restore: bash backup.sh -ip IP -key KEY -user USER -app NAME --restore file.tar.gz" MSG_BACKUP_HEADER="Backup and restoration of your apps" -MSG_BACKUP_SESSION_FOUND="vps-bootstrap session detected:" +MSG_BACKUP_SESSION_FOUND="vpskit session detected:" MSG_BACKUP_SESSION_IP="Server : %s" MSG_BACKUP_SESSION_KEY="SSH key : %s" MSG_BACKUP_SESSION_USER="User : %s" MSG_BACKUP_SESSION_CONFIRM=" Is this your server? (y/N): " -MSG_BACKUP_NO_SESSION="No vps-bootstrap session found." +MSG_BACKUP_NO_SESSION="No vpskit session found." MSG_BACKUP_RUN_SETUP=" Run setup.sh first to configure your VPS." MSG_BACKUP_PROMPT_IP=" VPS IP address: " MSG_BACKUP_PROMPT_KEY=" SSH key path (e.g. ~/.ssh/id_ed25519): " diff --git a/lang/fr.sh b/lang/fr.sh index 169d640..b9330e6 100644 --- a/lang/fr.sh +++ b/lang/fr.sh @@ -69,7 +69,7 @@ MSG_SETTINGS_KEYS_TITLE="Cles SSH dans ~/.ssh/ :" MSG_SETTINGS_KEYS_NONE="Aucune cle SSH trouvee dans ~/.ssh/" MSG_SETTINGS_KEYS_DELETE_PROMPT="Supprimer laquelle ? (0-%s) : " MSG_SETTINGS_KEYS_ACTIVE="[CLE ACTIVE]" -MSG_SETTINGS_KEYS_ACTIVE_WARN1="Cette cle est configuree comme cle active dans votre session vps-bootstrap." +MSG_SETTINGS_KEYS_ACTIVE_WARN1="Cette cle est configuree comme cle active dans votre session vpskit." MSG_SETTINGS_KEYS_ACTIVE_WARN2="Supprimer cette cle vous empechera de vous connecter a votre VPS." MSG_SETTINGS_KEYS_ACTIVE_WARN3="Continuez seulement si vous savez ce que vous faites." MSG_SETTINGS_KEYS_DELETE_CONFIRM="Supprimer definitivement les fichiers :" @@ -317,12 +317,12 @@ MSG_DEPLOY_INTRO_READY=" On y va etape par etape." MSG_DEPLOY_STEP1_TITLE="[>] Etape 1 : Connexion au VPS" MSG_DEPLOY_STEP1_INTRO=" On a besoin des informations de votre serveur." -MSG_DEPLOY_SESSION_FOUND="Session vps-bootstrap detectee :" +MSG_DEPLOY_SESSION_FOUND="Session vpskit detectee :" MSG_DEPLOY_SESSION_CONFIRM_PROMPT=" C'est bien votre serveur ? (o/N) : " MSG_DEPLOY_SESSION_IP="Serveur : %s" MSG_DEPLOY_SESSION_KEY="Cle SSH : %s" MSG_DEPLOY_SESSION_USER="User : %s" -MSG_DEPLOY_SESSION_NOT_FOUND="Aucune session vps-bootstrap trouvee." +MSG_DEPLOY_SESSION_NOT_FOUND="Aucune session vpskit trouvee." MSG_DEPLOY_SESSION_NOT_FOUND_HINT1=" Si vous avez utilise setup.sh avant, les infos sont normalement sauvegardees." MSG_DEPLOY_SESSION_NOT_FOUND_HINT2=" Sinon, pas de souci, on va les demander." MSG_DEPLOY_IP_HINT1=" L'adresse IP de votre VPS se trouve dans le tableau de bord" @@ -663,12 +663,12 @@ RMSG_UPDATE_DONE_DOMAIN=" Domaine : %s" MSG_STATUS_UNKNOWN_ARG="Argument inconnu : %s" MSG_STATUS_USAGE=" Usage : bash status.sh -ip IP -key CLE -user USER" MSG_STATUS_HEADER="Affiche l'etat de votre VPS" -MSG_STATUS_SESSION_FOUND="Session vps-bootstrap detectee :" +MSG_STATUS_SESSION_FOUND="Session vpskit detectee :" MSG_STATUS_SESSION_IP="Serveur : %s" MSG_STATUS_SESSION_KEY="Cle SSH : %s" MSG_STATUS_SESSION_USER="User : %s" MSG_STATUS_SESSION_CONFIRM=" C'est bien votre serveur ? (o/N) : " -MSG_STATUS_NO_SESSION="Aucune session vps-bootstrap trouvee." +MSG_STATUS_NO_SESSION="Aucune session vpskit trouvee." MSG_STATUS_RUN_SETUP=" Lancez d'abord setup.sh pour configurer votre VPS." MSG_STATUS_PROMPT_IP=" Adresse IP du VPS : " MSG_STATUS_PROMPT_KEY=" Chemin de la cle SSH (ex: ~/.ssh/id_ed25519) : " @@ -724,12 +724,12 @@ RMSG_STATUS_SECURITY_SSL_ERR="SSL %s : expire" MSG_SECURITY_UNKNOWN_ARG="Argument inconnu : %s" MSG_SECURITY_USAGE=" Usage : bash security.sh -ip IP -key CLE -user USER" MSG_SECURITY_HEADER="Audit de securite de votre VPS" -MSG_SECURITY_SESSION_FOUND="Session vps-bootstrap detectee :" +MSG_SECURITY_SESSION_FOUND="Session vpskit detectee :" MSG_SECURITY_SESSION_IP="Serveur : %s" MSG_SECURITY_SESSION_KEY="Cle SSH : %s" MSG_SECURITY_SESSION_USER="User : %s" MSG_SECURITY_SESSION_CONFIRM=" C'est bien votre serveur ? (o/N) : " -MSG_SECURITY_NO_SESSION="Aucune session vps-bootstrap trouvee." +MSG_SECURITY_NO_SESSION="Aucune session vpskit trouvee." MSG_SECURITY_RUN_SETUP=" Lancez d'abord setup.sh pour configurer votre VPS." MSG_SECURITY_PROMPT_IP=" Adresse IP du VPS : " MSG_SECURITY_PROMPT_KEY=" Chemin de la cle SSH (ex: ~/.ssh/id_ed25519) : " @@ -819,12 +819,12 @@ MSG_BACKUP_UNKNOWN_ARG="Argument inconnu : %s" MSG_BACKUP_USAGE=" Usage : bash backup.sh -ip IP -key CLE -user USER [-app NOM] [-dest /chemin]" MSG_BACKUP_USAGE_RESTORE=" Restore : bash backup.sh -ip IP -key CLE -user USER -app NOM --restore fichier.tar.gz" MSG_BACKUP_HEADER="Sauvegarde et restauration de vos apps" -MSG_BACKUP_SESSION_FOUND="Session vps-bootstrap detectee :" +MSG_BACKUP_SESSION_FOUND="Session vpskit detectee :" MSG_BACKUP_SESSION_IP="Serveur : %s" MSG_BACKUP_SESSION_KEY="Cle SSH : %s" MSG_BACKUP_SESSION_USER="User : %s" MSG_BACKUP_SESSION_CONFIRM=" C'est bien votre serveur ? (o/N) : " -MSG_BACKUP_NO_SESSION="Aucune session vps-bootstrap trouvee." +MSG_BACKUP_NO_SESSION="Aucune session vpskit trouvee." MSG_BACKUP_RUN_SETUP=" Lancez d'abord setup.sh pour configurer votre VPS." MSG_BACKUP_PROMPT_IP=" Adresse IP du VPS : " MSG_BACKUP_PROMPT_KEY=" Chemin de la cle SSH (ex: ~/.ssh/id_ed25519) : " diff --git a/security.sh b/security.sh index 79d3571..2128dbc 100644 --- a/security.sh +++ b/security.sh @@ -105,7 +105,11 @@ if [ "$INTERACTIVE" = true ]; then echo "" SSH_DIR="$HOME/.ssh" - LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" + LOCAL_STATE="$SSH_DIR/.vpskit-local" + LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" + if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" + fi if [ -f "$LOCAL_STATE" ]; then VPS_IP=$(read_state_var "$LOCAL_STATE" "VPS_IP") diff --git a/settings.sh b/settings.sh index 89c51f6..ee9f6e9 100644 --- a/settings.sh +++ b/settings.sh @@ -77,7 +77,11 @@ else SSH_DIR="$HOME/.ssh" fi -LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" +LOCAL_STATE="$SSH_DIR/.vpskit-local" +LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" +if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" +fi SETTINGS_FILE="$SSH_DIR/.vpskit-settings" # ========================================= diff --git a/setup.sh b/setup.sh index 40935d2..b26a3ab 100755 --- a/setup.sh +++ b/setup.sh @@ -7,7 +7,7 @@ set -euo pipefail # Fonctionne sur Mac, Linux et Windows (Git Bash / WSL) # Reprend automatiquement en cas de déconnexion. # -# Usage : bash <(curl -sL https://raw.githubusercontent.com/mariusdjen/vps-bootstrap/main/setup.sh) +# Usage : bash <(curl -sL https://raw.githubusercontent.com/mariusdjen/vpskit/main/vpskit.sh) # ============================================ # --- Couleurs --- @@ -130,7 +130,11 @@ mkdir -p "$SSH_DIR" chmod 700 "$SSH_DIR" # --- Fichier de sauvegarde locale (IP, clé, user) --- -LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" +LOCAL_STATE="$SSH_DIR/.vpskit-local" +LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" +if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" +fi # ========================================= # FONCTION : SÉLECTION DE CLÉ SSH @@ -139,7 +143,7 @@ LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" select_ssh_key() { KEYS=() for key in "$SSH_DIR"/*; do - if [ -f "$key" ] && [[ "$key" != *.pub ]] && [[ "$(basename "$key")" != "config"* ]] && [[ "$(basename "$key")" != "known_hosts"* ]] && [[ "$(basename "$key")" != ".vps-bootstrap"* ]]; then + if [ -f "$key" ] && [[ "$key" != *.pub ]] && [[ "$(basename "$key")" != "config"* ]] && [[ "$(basename "$key")" != "known_hosts"* ]] && [[ "$(basename "$key")" != ".vpskit"* ]] && [[ "$(basename "$key")" != ".vps-bootstrap"* ]]; then if [ -f "${key}.pub" ]; then KEYS+=("$key") fi @@ -165,7 +169,7 @@ select_ssh_key() { read -p " $MSG_SETUP_SSH_KEY_PROMPT_NEW_NAME" CUSTOM_KEY_NAME CUSTOM_KEY_NAME=${CUSTOM_KEY_NAME:-vps} SSH_KEY="$SSH_DIR/$CUSTOM_KEY_NAME" - ssh-keygen -t ed25519 -C "vps-bootstrap" -f "$SSH_KEY" + ssh-keygen -t ed25519 -C "vpskit" -f "$SSH_KEY" success "$(printf "$MSG_SETUP_SSH_KEY_CREATED" "$SSH_KEY")" elif [[ "$KEY_CHOICE" =~ ^[0-9]+$ ]] && [ "$KEY_CHOICE" -ge 1 ] && [ "$KEY_CHOICE" -le "${#KEYS[@]}" ]; then SSH_KEY="${KEYS[$((KEY_CHOICE - 1))]}" @@ -183,7 +187,7 @@ select_ssh_key() { else SSH_KEY="$SSH_DIR/id_ed25519" fi - ssh-keygen -t ed25519 -C "vps-bootstrap" -f "$SSH_KEY" + ssh-keygen -t ed25519 -C "vpskit" -f "$SSH_KEY" success "$(printf "$MSG_SETUP_SSH_KEY_CREATED_NEW" "$SSH_KEY")" fi } @@ -402,7 +406,13 @@ RED='\033[0;31m' NC='\033[0m' USERNAME="__USERNAME__" -PROGRESS_FILE="/root/.vps-bootstrap-progress" +PROGRESS_FILE="/root/.vpskit-progress" +PROGRESS_FILE_LEGACY="/root/.vps-bootstrap-progress" + +# Migrate legacy progress file if present (one-time) +if [ ! -f "$PROGRESS_FILE" ] && [ -f "$PROGRESS_FILE_LEGACY" ]; then + mv "$PROGRESS_FILE_LEGACY" "$PROGRESS_FILE" +fi # Créer le fichier de progression s'il n'existe pas touch "$PROGRESS_FILE" diff --git a/status.sh b/status.sh index 3a5c997..4ca0996 100644 --- a/status.sh +++ b/status.sh @@ -85,7 +85,11 @@ USERNAME="" echo "" SSH_DIR="$HOME/.ssh" - LOCAL_STATE="$SSH_DIR/.vps-bootstrap-local" + LOCAL_STATE="$SSH_DIR/.vpskit-local" + LOCAL_STATE_LEGACY="$SSH_DIR/.vps-bootstrap-local" + if [ ! -f "$LOCAL_STATE" ] && [ -f "$LOCAL_STATE_LEGACY" ]; then + mv "$LOCAL_STATE_LEGACY" "$LOCAL_STATE" + fi if [ -f "$LOCAL_STATE" ]; then VPS_IP=$(read_state_var "$LOCAL_STATE" "VPS_IP")