mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-01-01 18:49:34 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88c10b5a9c | ||
|
|
48d3d26be5 | ||
|
|
5caa583240 | ||
|
|
79f4749869 | ||
|
|
4de42e4a33 | ||
|
|
af9fba39f3 | ||
|
|
91b27c1bec |
109
.github/workflows/docker-compose-build.yml
vendored
109
.github/workflows/docker-compose-build.yml
vendored
@@ -1,4 +1,3 @@
|
||||
# This workflow will test if building the Docker Compose containers from scratch works.
|
||||
name: Docker Compose Build
|
||||
|
||||
on:
|
||||
@@ -18,6 +17,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set permissions and run install.sh
|
||||
run: |
|
||||
chmod +x install.sh
|
||||
@@ -25,76 +25,69 @@ jobs:
|
||||
|
||||
- name: Set up Docker Compose
|
||||
run: |
|
||||
# Change the exposed host port of the SmtpService from 25 to 2525 because port 25 is not allowed in GitHub Actions
|
||||
sed -i 's/25\:25/2525\:25/g' docker-compose.yml
|
||||
docker compose -f docker-compose.yml up -d
|
||||
sed -i 's/25\:25/2525\:25/g' docker-compose.yml
|
||||
docker compose -f docker-compose.yml up -d
|
||||
|
||||
- name: Wait for services to be up
|
||||
run: |
|
||||
# Wait for a few seconds
|
||||
sleep 15
|
||||
- name: Test if localhost:443 (WASM app) responds
|
||||
- name: Test if services are responding
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
timeout_minutes: 5
|
||||
max_attempts: 5
|
||||
command: |
|
||||
http_code=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:443)
|
||||
if [ "$http_code" -ne 200 ]; then
|
||||
echo "Service did not respond with 200 OK. Check if client app and/or nginx is configured correctly."
|
||||
exit 1
|
||||
else
|
||||
echo "Service responded with 200 OK"
|
||||
fi
|
||||
sleep 5
|
||||
|
||||
- name: Test if localhost:443/api (WebApi) responds
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
command: |
|
||||
http_code=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:443/api)
|
||||
if [ "$http_code" -ne 200 ]; then
|
||||
echo "Service did not respond with expected 200 OK. Check if WebApi and/or nginx is configured correctly."
|
||||
exit 1
|
||||
else
|
||||
echo "Service responded with $http_code"
|
||||
fi
|
||||
# Array of endpoints to test
|
||||
declare -A endpoints=(
|
||||
["WASM"]="https://localhost:443"
|
||||
["WebApi"]="https://localhost:443/api"
|
||||
["Admin"]="https://localhost:443/admin/user/login"
|
||||
)
|
||||
|
||||
failed=false
|
||||
|
||||
# Test HTTP endpoints
|
||||
for name in "${!endpoints[@]}"; do
|
||||
url="${endpoints[$name]}"
|
||||
echo "Testing $name at $url"
|
||||
|
||||
# Store both response body and HTTP code
|
||||
response=$(curl -k -s -w "\nHTTP_CODE=%{http_code}" "$url")
|
||||
http_code=$(echo "$response" | grep "HTTP_CODE=" | cut -d= -f2)
|
||||
body=$(echo "$response" | sed '$d') # Remove the last line (HTTP_CODE)
|
||||
|
||||
- name: Test if localhost:443/admin (Admin) responds
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
command: |
|
||||
http_code=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:443/admin/user/login)
|
||||
if [ "$http_code" -ne 200 ]; then
|
||||
echo "Service did not respond with expected 200 OK. Check if admin app and/or nginx is configured correctly."
|
||||
exit 1
|
||||
echo "❌ $name failed with HTTP $http_code at $url"
|
||||
echo "Response body:"
|
||||
echo "$body"
|
||||
failed=true
|
||||
else
|
||||
echo "Service responded with $http_code"
|
||||
echo "✅ $name responded with HTTP 200"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Test if localhost:2525 (SmtpService) responds
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
command: |
|
||||
if ! nc -zv localhost 2525 2>&1 | grep -q 'succeeded'; then
|
||||
echo "SmtpService did not respond on port 2525. Check if the SmtpService service is running."
|
||||
exit 1
|
||||
else
|
||||
echo "SmtpService responded on port 2525"
|
||||
fi
|
||||
# Test SMTP
|
||||
echo "Testing SmtpService at localhost:2525"
|
||||
if ! nc -zv localhost 2525 2>&1 | grep -q 'succeeded'; then
|
||||
echo "❌ SmtpService failed to respond on port 2525"
|
||||
failed=true
|
||||
else
|
||||
echo "✅ SmtpService responded successfully"
|
||||
fi
|
||||
|
||||
# Exit with error if any service failed
|
||||
if [ "$failed" = true ]; then
|
||||
# Get container logs
|
||||
echo "Container Logs:"
|
||||
docker compose logs
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Test install.sh reset-password output
|
||||
run: |
|
||||
output=$(./install.sh reset-password)
|
||||
if ! echo "$output" | grep -E '.*New admin password: [A-Za-z0-9+/=]{8,}.*'; then
|
||||
echo "Password reset output format is incorrect. Expected format: 'New admin password: <at least 8 base64 chars>'"
|
||||
echo "Actual output: $output"
|
||||
echo "Password reset output format is incorrect"
|
||||
echo "Expected: 'New admin password: <at least 8 base64 chars>'"
|
||||
echo "Actual: $output"
|
||||
exit 1
|
||||
else
|
||||
echo "Password reset output format is correct"
|
||||
fi
|
||||
fi
|
||||
42
install.sh
42
install.sh
@@ -502,28 +502,28 @@ handle_install() {
|
||||
return
|
||||
fi
|
||||
|
||||
# Check for existing version
|
||||
local current_version=""
|
||||
if grep -q "^ALIASVAULT_VERSION=" "$ENV_FILE"; then
|
||||
current_version=$(grep "^ALIASVAULT_VERSION=" "$ENV_FILE" | cut -d '=' -f2)
|
||||
printf "${CYAN}> Current AliasVault version: ${current_version}${NC}\n"
|
||||
printf "${YELLOW}> AliasVault is already installed.${NC}\n"
|
||||
printf "1. To reinstall the current version (${current_version}), continue with this script\n"
|
||||
printf "2. To check for updates and to install the latest version, use: ./install.sh update\n"
|
||||
printf "3. To install a specific version, use: ./install.sh install <version>\n"
|
||||
printf "\n"
|
||||
# Check if .env exists before reading
|
||||
if [ -f "$ENV_FILE" ]; then
|
||||
if grep -q "^ALIASVAULT_VERSION=" "$ENV_FILE"; then
|
||||
current_version=$(grep "^ALIASVAULT_VERSION=" "$ENV_FILE" | cut -d '=' -f2)
|
||||
printf "${CYAN}> Current AliasVault version: ${current_version}${NC}\n"
|
||||
printf "${YELLOW}> AliasVault is already installed.${NC}\n"
|
||||
printf "1. To reinstall the current version (${current_version}), continue with this script\n"
|
||||
printf "2. To check for updates and to install the latest version, use: ./install.sh update\n"
|
||||
printf "3. To install a specific version, use: ./install.sh install <version>\n\n"
|
||||
|
||||
read -p "Would you like to reinstall the current version? [y/N]: " REPLY
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
printf "${YELLOW}> Installation cancelled.${NC}\n"
|
||||
exit 0
|
||||
read -p "Would you like to reinstall the current version? [y/N]: " REPLY
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
printf "${YELLOW}> Installation cancelled.${NC}\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
handle_install_version "$current_version"
|
||||
return
|
||||
fi
|
||||
|
||||
handle_install_version "$current_version"
|
||||
else
|
||||
# First time installation, use latest
|
||||
handle_install_version "latest"
|
||||
fi
|
||||
|
||||
handle_install_version "latest"
|
||||
}
|
||||
|
||||
# Function to handle build
|
||||
@@ -830,6 +830,10 @@ configure_letsencrypt() {
|
||||
printf "${CYAN}> Restarting reverse proxy with Let's Encrypt configuration...${NC}\n"
|
||||
$(get_docker_compose_command) up -d reverse-proxy --force-recreate
|
||||
|
||||
# Starting certbot container to renew certificates automatically
|
||||
printf "${CYAN}> Starting new certbot container to renew certificates automatically...${NC}\n"
|
||||
$(get_docker_compose_command) up -d certbot
|
||||
|
||||
printf "${GREEN}> Let's Encrypt SSL certificate has been configured successfully!${NC}\n"
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ public static class AppInfo
|
||||
/// <summary>
|
||||
/// Gets the minor version number.
|
||||
/// </summary>
|
||||
public const int VersionMinor = 7;
|
||||
public const int VersionMinor = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the patch version number.
|
||||
/// </summary>
|
||||
public const int VersionPatch = 0;
|
||||
public const int VersionPatch = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the build number, typically used in CI/CD pipelines.
|
||||
|
||||
Reference in New Issue
Block a user