chore: migrate to v3 and adopt Doppler for secrets management #3

Open
kamil wants to merge 574 commits from v3-cleanup into main
5 changed files with 155 additions and 1 deletions
Showing only changes of commit 12bb0db5f0 - Show all commits

View File

@@ -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:-}"

View File

@@ -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"

39
scripts/test-ci-signing.sh Executable file
View File

@@ -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 ==="

View File

@@ -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! ==="

58
scripts/test-ios-build.sh Executable file
View File

@@ -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! ==="