Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Make curl follow redirects (#1171)
Leendert de Borsta6fea3a60a0d
diff --git a/install.sh b/install.shindex 8d79c1b75..c362725a5 100755--- a/install.sh+++ b/install.sh@@ -290,7 +290,7 @@ check_connectivity() {printf "\b%c" "${spinstr:$i:1}"((i = (i + 1) % 4))- if ! curl -s --connect-timeout 10 --max-time 30 "$url" > /dev/null 2>&1; then+ if ! curl -Ls --connect-timeout 10 --max-time 30 "$url" > /dev/null 2>&1; thenprintf "\b ${RED}✗${NC}\n"log_error "Cannot reach $url. Please check your internet connection."return 1@@ -938,7 +938,7 @@ get_latest_version() {local wait_time=1while [ $attempt -le $max_attempts ]; do- local latest_version=$(curl -s "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)+ local latest_version=$(curl -Ls "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest" | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)if [ -n "$latest_version" ]; then# Cache the version for this session@@ -1002,7 +1002,7 @@ handle_docker_compose() {# First, check if the file exists by making a HEAD requestlocal http_status- http_status=$(curl -s -o /dev/null -w "%{http_code}" "$download_url" 2>/dev/null)+ http_status=$(curl -Ls -o /dev/null -w "%{http_code}" "$download_url" 2>/dev/null)if [ "$http_status" = "404" ]; thenprintf "\b ${RED}✗${NC}\n"@@ -1017,7 +1017,7 @@ handle_docker_compose() {exit 1fi- if ! retry_command 3 2 curl -sSf "$download_url" -o "$temp_file"; then+ if ! retry_command 3 2 curl -LsSf "$download_url" -o "$temp_file"; thenprintf "\b ${RED}✗${NC}\n"log_error "Failed to download $file from $download_url"log_error "Please check your internet connection and try again."@@ -1051,7 +1051,7 @@ check_install_script_version() {# First, check if the install.sh file exists for this versionlocal install_url="${GITHUB_RAW_URL_REPO}/${target_version}/install.sh"local http_status- http_status=$(curl -s -o /dev/null -w "%{http_code}" "$install_url" 2>/dev/null)+ http_status=$(curl -Ls -o /dev/null -w "%{http_code}" "$install_url" 2>/dev/null)if [ "$http_status" = "404" ]; thenprintf " > Install script not found for version ${target_version}. Continuing with current version.\n"@@ -1059,7 +1059,7 @@ check_install_script_version() {fi# Get remote install.sh for target version- if ! curl -sSf "$install_url" -o "install.sh.tmp"; then+ if ! curl -LsSf "$install_url" -o "install.sh.tmp"; thenprintf "${RED}> Failed to check install script version. Continuing with current version.${NC}\n"rm -f install.sh.tmpreturn 1@@ -1106,7 +1106,7 @@ create_env_file() {# Check if .env.example exists for this versionlocal env_example_url="${GITHUB_RAW_URL_REPO}/${latest_version}/.env.example"local http_status- http_status=$(curl -s -o /dev/null -w "%{http_code}" "$env_example_url" 2>/dev/null)+ http_status=$(curl -Ls -o /dev/null -w "%{http_code}" "$env_example_url" 2>/dev/null)if [ "$http_status" = "404" ]; thenprintf "\n ${YELLOW}> .env.example not found for version ${latest_version}. Creating blank .env file.${NC}\n"@@ -1114,7 +1114,7 @@ create_env_file() {return 0fi- if curl -sSf "$env_example_url" -o "$ENV_EXAMPLE_FILE" > /dev/null 2>&1; then+ if curl -LsSf "$env_example_url" -o "$ENV_EXAMPLE_FILE" > /dev/null 2>&1; thenprintf "\n ${GREEN}> .env.example downloaded successfully.${NC}\n"elseprintf "\n ${YELLOW}> Failed to download .env.example. Creating blank .env file.${NC}\n"@@ -1488,13 +1488,13 @@ check_aliasvault_health() {local https_ok=false# Check HTTP port (should redirect to HTTPS)- if curl -s -o /dev/null -w "%{http_code}" "http://localhost:$http_port" 2>/dev/null | grep -q "301"; then+ if curl -Ls -o /dev/null -w "%{http_code}" "http://localhost:$http_port" 2>/dev/null | grep -q "301"; thenhttp_ok=truefi# Check HTTPS port (should return status page or main app)local https_status- https_status=$(curl -s -k -o /dev/null -w "%{http_code}" "https://localhost:$https_port" 2>/dev/null)+ https_status=$(curl -Ls -k -o /dev/null -w "%{http_code}" "https://localhost:$https_port" 2>/dev/null)if [ "$https_status" = "200" ] || [ "$https_status" = "503" ]; thenhttps_ok=truefi@@ -2315,7 +2315,7 @@ check_install_script_update() {return 1fi- if ! curl -sSf "${GITHUB_RAW_URL_REPO}/${latest_version}/install.sh" -o "install.sh.tmp"; then+ if ! curl -LsSf "${GITHUB_RAW_URL_REPO}/${latest_version}/install.sh" -o "install.sh.tmp"; thenprintf "${RED}> Failed to check for install script updates. Continuing with current version.${NC}\n"rm -f install.sh.tmpreturn 1