From 12bb0db5f02167483797dd1d6828ede31f87c225 Mon Sep 17 00:00:00 2001 From: Admin Date: Tue, 10 Mar 2026 16:12:17 +0500 Subject: [PATCH] feat: add libnovel-avatars bucket to minio-init and avatar_url field to pb-init --- docker-compose.yml | 2 ++ scripts/pb-init.sh | 4 ++- scripts/test-ci-signing.sh | 39 +++++++++++++++++++++ scripts/test-ios-build-simple.sh | 53 +++++++++++++++++++++++++++++ scripts/test-ios-build.sh | 58 ++++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100755 scripts/test-ci-signing.sh create mode 100755 scripts/test-ios-build-simple.sh create mode 100755 scripts/test-ios-build.sh diff --git a/docker-compose.yml b/docker-compose.yml index eebae43..f2f6eb0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,7 @@ services: mc mb --ignore-existing local/libnovel-chapters; mc mb --ignore-existing local/libnovel-audio; mc mb --ignore-existing local/libnovel-browse; + mc mb --ignore-existing local/libnovel-avatars; echo 'buckets ready'; " environment: @@ -106,6 +107,7 @@ services: MINIO_BUCKET_CHAPTERS: "${MINIO_BUCKET_CHAPTERS:-libnovel-chapters}" MINIO_BUCKET_AUDIO: "${MINIO_BUCKET_AUDIO:-libnovel-audio}" MINIO_BUCKET_BROWSE: "${MINIO_BUCKET_BROWSE:-libnovel-browse}" + MINIO_BUCKET_AVATARS: "${MINIO_BUCKET_AVATARS:-libnovel-avatars}" # Public endpoint used to sign presigned audio URLs so browsers can reach them. # Leave empty to use MINIO_ENDPOINT (fine for local dev). MINIO_PUBLIC_ENDPOINT: "${MINIO_PUBLIC_ENDPOINT:-}" diff --git a/scripts/pb-init.sh b/scripts/pb-init.sh index f84c78e..ad2c01d 100755 --- a/scripts/pb-init.sh +++ b/scripts/pb-init.sh @@ -177,7 +177,8 @@ create_collection "app_users" '{ {"name": "username", "type": "text", "required": true}, {"name": "password_hash", "type": "text", "required": true}, {"name": "role", "type": "text"}, - {"name": "created", "type": "date"} + {"name": "created", "type": "date"}, + {"name": "avatar_url", "type": "text"} ] }' @@ -200,5 +201,6 @@ create_collection "user_settings" '{ ensure_field "progress" "user_id" "text" ensure_field "progress" "audio_time" "number" ensure_field "user_settings" "user_id" "text" +ensure_field "app_users" "avatar_url" "text" log "all collections ready" diff --git a/scripts/test-ci-signing.sh b/scripts/test-ci-signing.sh new file mode 100755 index 0000000..8fb32f7 --- /dev/null +++ b/scripts/test-ci-signing.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -euo pipefail + +cd "$(dirname "$0")/../ios/LibNovel" + +echo "=== Testing CI-like signing process ===" + +# 1. Install provisioning profile (simulate CI) +PP_PATH=~/Downloads/LibNovel_Distribution.mobileprovision +UUID=$(security cms -D -i "$PP_PATH" | plutil -extract UUID raw -) +PROFILE_NAME=$(security cms -D -i "$PP_PATH" | plutil -extract Name raw -) +mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles +cp "$PP_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision + +echo "Installed profile: $PROFILE_NAME (UUID: $UUID)" + +# 2. Generate Xcode project +echo "Generating Xcode project..." +xcodegen generate --spec project.yml --project . + +# 3. List available provisioning profiles +echo -e "\n=== Available provisioning profiles ===" +ls -la ~/Library/MobileDevice/Provisioning\ Profiles/ + +# 4. Try building with xcodebuild using manual signing +echo -e "\n=== Attempting archive with manual signing ===" +xcodebuild archive \ + -scheme LibNovel \ + -project LibNovel.xcodeproj \ + -configuration Release \ + -destination 'generic/platform=iOS' \ + -archivePath /tmp/LibNovel.xcarchive \ + CODE_SIGN_STYLE=Manual \ + CODE_SIGN_IDENTITY="Apple Distribution: Kamil Alekberov (GHZXC6FVMU)" \ + DEVELOPMENT_TEAM=GHZXC6FVMU \ + PROVISIONING_PROFILE_SPECIFIER="$UUID" \ + | xcpretty || true + +echo -e "\n=== Build complete ===" diff --git a/scripts/test-ios-build-simple.sh b/scripts/test-ios-build-simple.sh new file mode 100755 index 0000000..82d5553 --- /dev/null +++ b/scripts/test-ios-build-simple.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Simple iOS build test without fastlane +# Run from project root: ./scripts/test-ios-build-simple.sh /path/to/profile.mobileprovision + +set -e + +PROFILE_PATH="$1" + +if [ -z "$PROFILE_PATH" ]; then + echo "Usage: $0 /path/to/profile.mobileprovision" + exit 1 +fi + +echo "=== Step 1: Extract profile info ===" +UUID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract UUID raw -) +PROFILE_NAME=$(security cms -D -i "$PROFILE_PATH" | plutil -extract Name raw -) +TEAM_ID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract TeamIdentifier.0 raw -) + +echo "Profile Name: $PROFILE_NAME" +echo "UUID: $UUID" +echo "Team ID: $TEAM_ID" + +echo "" +echo "=== Step 2: Install profile ===" +mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles +cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision +echo "✓ Installed" + +echo "" +echo "=== Step 3: Check signing identities ===" +security find-identity -v -p codesigning + +echo "" +echo "=== Step 4: Generate Xcode project ===" +cd ios/LibNovel +export USER=runner +xcodegen generate --spec project.yml --project . +echo "✓ Project generated" + +echo "" +echo "=== Step 5: Try automatic signing build ===" +xcodebuild archive \ + -project LibNovel.xcodeproj \ + -scheme LibNovel \ + -configuration Release \ + -destination 'generic/platform=iOS' \ + -archivePath ./build/LibNovel.xcarchive \ + -allowProvisioningUpdates \ + CODE_SIGN_STYLE=Automatic \ + DEVELOPMENT_TEAM="$TEAM_ID" + +echo "" +echo "=== ✓ BUILD SUCCEEDED! ===" diff --git a/scripts/test-ios-build.sh b/scripts/test-ios-build.sh new file mode 100755 index 0000000..a255712 --- /dev/null +++ b/scripts/test-ios-build.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Local build test script +# Run from the project root: ./scripts/test-ios-build.sh /path/to/your/profile.mobileprovision + +set -e + +PROFILE_PATH="$1" + +if [ -z "$PROFILE_PATH" ]; then + echo "Usage: $0 /path/to/profile.mobileprovision" + exit 1 +fi + +if [ ! -f "$PROFILE_PATH" ]; then + echo "Error: Profile not found at $PROFILE_PATH" + exit 1 +fi + +echo "=== Extracting profile info ===" +UUID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract UUID raw -) +PROFILE_NAME=$(security cms -D -i "$PROFILE_PATH" | plutil -extract Name raw -) +BUNDLE_ID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract Entitlements.application-identifier raw - 2>/dev/null | sed 's/.*\.//') +TEAM_ID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract TeamIdentifier.0 raw -) + +echo "Profile Name: $PROFILE_NAME" +echo "UUID: $UUID" +echo "Bundle ID: $BUNDLE_ID" +echo "Team ID: $TEAM_ID" + +echo "" +echo "=== Installing provisioning profile ===" +mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles +cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision +echo "Installed to: ~/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision" + +echo "" +echo "=== Listing signing identities ===" +security find-identity -v -p codesigning + +echo "" +echo "=== Navigating to iOS project ===" +cd ios/LibNovel + +echo "" +echo "=== Generating Xcode project ===" +xcodegen generate --spec project.yml --project . + +echo "" +echo "=== Testing fastlane build ===" +export USER=runner +export BUILD_NUMBER=999 +export PROVISIONING_PROFILE_NAME="$PROFILE_NAME" + +# Run fastlane beta lane +fastlane beta --verbose + +echo "" +echo "=== Build succeeded! ==="