Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update build scripts (#1404)
Leendert de Borst039aa0850f50
diff --git a/.github/workflows/ios-ui-tests.yml b/.github/workflows/ios-ui-tests.ymlindex ba9c3b3c3..0beb8c8b9 100644--- a/.github/workflows/ios-ui-tests.yml+++ b/.github/workflows/ios-ui-tests.yml@@ -59,11 +59,11 @@ jobs:- name: Install CocoaPodsrun: sudo gem install cocoapods- - name: Build core libraries (including iOS Rust)+ - name: Build core libraries for iOSrun: |cd ../../corechmod +x build-and-distribute.sh- ./build-and-distribute.sh+ ./build-and-distribute.sh --ios- name: Verify core library distributionrun: |@@ -89,29 +89,34 @@ jobs:cd iospod install- - name: Install .NET workloads- working-directory: apps/server- run: dotnet workload install wasm-tools-- name: Build API serverworking-directory: apps/serverrun: dotnet build AliasVault.Api- name: Start PostgreSQLrun: |- brew services start postgresql@14+ # Install and start PostgreSQL+ brew install postgresql@17+ brew services start postgresql@17++ # Add PostgreSQL to PATH+ echo "/opt/homebrew/opt/postgresql@17/bin" >> $GITHUB_PATH+ export PATH="/opt/homebrew/opt/postgresql@17/bin:$PATH"+# Wait for PostgreSQL to be ready- for i in {1..10}; do- if pg_isready -h localhost; then+ for i in {1..15}; do+ if /opt/homebrew/opt/postgresql@17/bin/pg_isready -h localhost; thenecho "PostgreSQL is ready!"breakfi+ echo "Waiting for PostgreSQL... attempt $i"sleep 1done+# Create database and user- createuser -s aliasvault || true- psql postgres -c "ALTER USER aliasvault WITH PASSWORD 'password';" || true- createdb -O aliasvault aliasdb_e2e_ios || true+ /opt/homebrew/opt/postgresql@17/bin/createuser -s aliasvault || true+ /opt/homebrew/opt/postgresql@17/bin/psql postgres -c "ALTER USER aliasvault WITH PASSWORD 'password';" || true+ /opt/homebrew/opt/postgresql@17/bin/createdb -O aliasvault aliasdb_e2e_ios || true- name: Start API serverworking-directory: apps/server/AliasVault.Api@@ -120,7 +125,7 @@ jobs:# Wait for API to be readyecho "Waiting for API to start..."for i in {1..30}; do- if curl -s http://localhost:5092/v1/Auth/status > /dev/null 2>&1; then+ if curl -s http://localhost:5092/v1/ > /dev/null 2>&1; thenecho "API is ready!"breakfi@@ -134,6 +139,8 @@ jobs:PUBLIC_REGISTRATION_ENABLED: "true"ADMIN_PASSWORD_HASH: "AQAAAAIAAYagAAAAEKWfKfa2gh9Z72vjAlnNP1xlME7FsunRznzyrfqFte40FToufRwa3kX8wwDwnEXZag=="ADMIN_PASSWORD_GENERATED: "2024-01-01T00:00:00Z"+ # Bind to all interfaces (IPv4 and IPv6)+ ASPNETCORE_URLS: "http://0.0.0.0:5092"- name: Boot iOS Simulatorrun: |@@ -160,8 +167,33 @@ jobs:echo "Booting simulator: $SIMULATOR_ID"xcrun simctl boot "$SIMULATOR_ID" || true++ # Wait for simulator to be fully booted+ echo "Waiting for simulator to be ready..."+ xcrun simctl bootstatus "$SIMULATOR_ID" -b+echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV+ - name: Start Metro bundler+ run: |+ # Start Metro bundler in background (non-interactive mode for CI)+ npx expo start --offline > /tmp/metro.log 2>&1 &+ METRO_PID=$!+ echo $METRO_PID > /tmp/metro.pid++ # Wait for Metro to be ready+ echo "Waiting for Metro bundler to start..."+ for i in {1..30}; do+ if curl -s http://localhost:8081/status 2>/dev/null | grep -q "packager-status:running"; then+ echo "Metro bundler is ready!"+ break+ fi+ echo "Attempt $i: Metro not ready yet..."+ # Show recent log for debugging+ tail -3 /tmp/metro.log 2>/dev/null || true+ sleep 2+ done+- name: Build iOS app for testingrun: |cd ios@@ -187,12 +219,28 @@ jobs:-derivedDataPath build \-only-testing:AliasVaultUITests \-resultBundlePath TestResults.xcresult \+ -parallel-testing-enabled NO \+ -maximum-concurrent-test-simulator-destinations 1 \CODE_SIGNING_ALLOWED=NO \IDEFileSystemSynchronizedGroupsAreEnabled=NOenv:API_URL: "http://localhost:5092"IDEFileSystemSynchronizedGroupsAreEnabled: NO+ - name: Extract attachments from xcresult+ if: always()+ run: |+ mkdir -p /tmp/test-attachments+ # Extract all attachments from the xcresult bundle+ if [ -d "ios/TestResults.xcresult" ]; then+ xcrun xcresulttool get --path ios/TestResults.xcresult --format json > /tmp/test-attachments/results.json 2>/dev/null || true+ # Export attachments+ xcrun xcresulttool export --path ios/TestResults.xcresult --output-path /tmp/test-attachments --type file 2>/dev/null || true+ # List what we found+ echo "Attachments found:"+ ls -la /tmp/test-attachments/ || true+ fi+- name: Upload test resultsif: always()uses: actions/upload-artifact@v4@@ -201,12 +249,22 @@ jobs:path: apps/mobile-app/ios/TestResults.xcresultretention-days: 14- - name: Upload screenshots on failure+ - name: Upload extracted attachments+ if: always()+ uses: actions/upload-artifact@v4+ with:+ name: ios-ui-test-attachments+ path: /tmp/test-attachments/+ retention-days: 14+ if-no-files-found: ignore++ - name: Upload logs on failureif: failure()uses: actions/upload-artifact@v4with:- name: ios-ui-test-screenshots+ name: ios-ui-test-logspath: |- apps/mobile-app/ios/build/Logs/Test/**/*.png- apps/mobile-app/ios/build/Logs/Test/**/*.jpg+ /tmp/api-server.log+ /tmp/metro.logretention-days: 14+ if-no-files-found: ignorediff --git a/apps/browser-extension/src/utils/auth/SrpAuthService.ts b/apps/browser-extension/src/utils/auth/SrpAuthService.tsindex abafc26ed..9946dfa5c 100644--- a/apps/browser-extension/src/utils/auth/SrpAuthService.ts+++ b/apps/browser-extension/src/utils/auth/SrpAuthService.ts@@ -1,5 +1,7 @@import { browser } from 'wxt/browser';+import type { TokenModel, LoginResponse, BadRequestResponse } from '@/utils/dist/core/models/webapi';+import initWasm, {srpGenerateSalt,srpDerivePrivateKey,@@ -7,9 +9,6 @@ import initWasm, {srpGenerateEphemeral,srpDeriveSession,} from '../dist/core/rust/aliasvault_core.js';--import type { TokenModel, LoginResponse, BadRequestResponse } from '@/utils/dist/core/models/webapi';-import { EncryptionUtility } from '../EncryptionUtility';/**diff --git a/apps/mobile-app/app/open/[...path].tsx b/apps/mobile-app/app/open/[...path].tsxindex c7e9fbd21..836a7f4ae 100644--- a/apps/mobile-app/app/open/[...path].tsx+++ b/apps/mobile-app/app/open/[...path].tsx@@ -15,6 +15,7 @@ declare const __DEV__: boolean;* - mobile-unlock/[requestId] - Mobile device unlock via QR code* - __debug__/set-offline/[true|false] - (DEV only) Toggle offline mode for E2E testing* - __debug__/set-api-url/[encoded-url] - (DEV only) Set API URL for E2E testing+ * - __debug__/set-server-revision/[number] - (DEV only) Set local server revision for RPO testing** This route exists to handle deep links that Expo Router processes before our* Linking.addEventListener can intercept them. It provides proper navigation@@ -62,7 +63,11 @@ export default function ActionHandler() : null {break;}- // Debug actions for E2E testing (only work in dev mode)+ /**+ * ----------------------------------------------------------------------------+ * Debug actions for E2E testing (only works in dev mode)+ * ----------------------------------------------------------------------------+ */case '__debug__': {if (!__DEV__) {console.warn('[ActionHandler] Debug actions only available in development');@@ -91,9 +96,11 @@ export default function ActionHandler() : null {}case 'set-api-url': {- // Set API URL: aliasvault://open/__debug__/set-api-url/http%3A%2F%2Flocalhost%3A5092- // Note: If slashes in URL aren't encoded, they become separate path segments- // So we join all remaining params with '/' to reconstruct the URL+ /*+ * Set API URL: aliasvault://open/__debug__/set-api-url/http%3A%2F%2Flocalhost%3A5092+ * Note: If slashes in URL aren't encoded, they become separate path segments+ * So we join all remaining params with '/' to reconstruct the URL+ */if (debugParams.length === 0) {console.error('[ActionHandler] set-api-url requires URL parameter');router.replace('/(tabs)/items');diff --git a/apps/mobile-app/ios/AliasVaultUITests/AliasVaultUITests.swift b/apps/mobile-app/ios/AliasVaultUITests/AliasVaultUITests.swiftindex e042ab5c3..ab781dc24 100644--- a/apps/mobile-app/ios/AliasVaultUITests/AliasVaultUITests.swift+++ b/apps/mobile-app/ios/AliasVaultUITests/AliasVaultUITests.swift@@ -878,7 +878,20 @@ final class AliasVaultUITests: XCTestCase {}if !screenFound {- print("[Helper] Warning: No expected screen found after \(maxWaitTime)s, proceeding anyway")+ // Capture screenshot and app hierarchy for debugging+ let screenshot = XCUIScreen.main.screenshot()+ let attachment = XCTAttachment(screenshot: screenshot)+ attachment.name = "FAILURE-no-screen-found"+ attachment.lifetime = .keepAlways+ add(attachment)++ let hierarchyAttachment = XCTAttachment(string: app.debugDescription)+ hierarchyAttachment.name = "FAILURE-hierarchy-no-screen-found"+ hierarchyAttachment.lifetime = .keepAlways+ add(hierarchyAttachment)++ XCTFail("No expected screen (login, unlock, or items) found after \(maxWaitTime)s. App may have crashed or failed to load.")+ return}// Handle unlock screen - logout to start fresh with test userdiff --git a/core/build-and-distribute.sh b/core/build-and-distribute.shindex 9d4ccd18b..880b792f5 100755--- a/core/build-and-distribute.sh+++ b/core/build-and-distribute.sh@@ -7,6 +7,7 @@ set -u # Treat unset variables as errorsBUILD_ALL=falseBUILD_BROWSER=falseBUILD_DOTNET=false+BUILD_IOS=falseBUILD_ANDROID=falseBUILD_COMMON=true # Always build TypeScript utils, models, and vault@@ -21,6 +22,10 @@ while [[ $# -gt 0 ]]; doBUILD_DOTNET=trueshift;;+ --ios)+ BUILD_IOS=true+ shift+ ;;--android)BUILD_ANDROID=trueshift@@ -29,6 +34,7 @@ while [[ $# -gt 0 ]]; doBUILD_BROWSER=trueBUILD_DOTNET=trueBUILD_ANDROID=true+ # Note: iOS excluded from --all as it requires macOS/Xcode (use --ios explicitly)shift;;--help)@@ -37,13 +43,14 @@ while [[ $# -gt 0 ]]; doecho "Target options:"echo " --browser Build WASM for browser extension and Blazor WASM client"echo " --dotnet Build native library for .NET server-side use"+ echo " --ios Build for iOS with Swift bindings"echo " --android Build for Android with Kotlin bindings"- echo " --all Build all targets (browser, dotnet, android)"+ echo " --all Build cross-platform targets (browser, dotnet, android)"echo ""echo "Notes:"echo " - TypeScript utilities, models, and vault are always built"- echo " - iOS builds are handled by Xcode build phases, not this script"- echo " - If no target is specified, all targets are built"+ echo " - iOS requires macOS/Xcode, use --ios explicitly (not included in --all)"+ echo " - If no target is specified, cross-platform targets are built"echo ""exit 0;;@@ -55,9 +62,9 @@ while [[ $# -gt 0 ]]; doesacdone-# If no targets specified, build all-if ! $BUILD_BROWSER && ! $BUILD_DOTNET && ! $BUILD_ANDROID; then- echo "No target specified, building all targets..."+# If no targets specified, build cross-platform targets (iOS excluded - requires macOS)+if ! $BUILD_BROWSER && ! $BUILD_DOTNET && ! $BUILD_IOS && ! $BUILD_ANDROID; then+ echo "No target specified, building cross-platform targets..."BUILD_BROWSER=trueBUILD_DOTNET=trueBUILD_ANDROID=true@@ -98,7 +105,7 @@ if $BUILD_COMMON; thenfi# Rust core build (optional - requires Rust toolchain)-if $BUILD_BROWSER || $BUILD_DOTNET || $BUILD_ANDROID; then+if $BUILD_BROWSER || $BUILD_DOTNET || $BUILD_IOS || $BUILD_ANDROID; thencd ./rustif command -v rustc &> /dev/null; then@@ -109,6 +116,11 @@ if $BUILD_BROWSER || $BUILD_DOTNET || $BUILD_ANDROID; then./build.sh --androidfi+ if $BUILD_IOS; then+ echo " → Building for iOS..."+ ./build.sh --ios+ fi+if $BUILD_BROWSER; thenecho " → Building for Browser/WASM..."./build.sh --browser