Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
6 changes: 5 additions & 1 deletion backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 6 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ============================================
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 9 additions & 9 deletions lang/en.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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): "
Expand Down Expand Up @@ -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): "
Expand Down Expand Up @@ -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): "
Expand Down
18 changes: 9 additions & 9 deletions lang/fr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 :"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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) : "
Expand Down Expand Up @@ -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) : "
Expand Down Expand Up @@ -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) : "
Expand Down
6 changes: 5 additions & 1 deletion security.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

# =========================================
Expand Down
22 changes: 16 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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))]}"
Expand All @@ -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
}
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading