@@ -19,7 +19,7 @@ export $(shell sed 's/=.*//' config.env | grep -v '^\s*$$' | grep -v '^\s*\#')
1919SCRIPTS_DIR := scripts
2020K8S_SCRIPTS_DIR := $(SCRIPTS_DIR ) /k8s
2121
22- .PHONY : help menu setup-k8s setup-infrastructure setup-rbac setup-storage-pvc config config-docker config-k8s config-all clean deploy deploy-docker deploy-k8s deploy-k8s-full deploy-infrastructure deploy-apps check-infrastructure check-apps build-backend up-backend down-backend k8s-status k8s-cleanup k8s-purge audio-manage test-robot test-robot-integration test-robot-unit test-robot-endpoints test-robot-specific test-robot-clean
22+ .PHONY : help menu setup-k8s setup-infrastructure setup-rbac setup-storage-pvc config config-docker config-k8s config-all clean deploy deploy-docker deploy-k8s deploy-k8s-full deploy-infrastructure deploy-apps check-infrastructure check-apps build-backend up-backend down-backend k8s-status k8s-cleanup k8s-purge audio-manage mycelia-sync-status mycelia-sync-all mycelia-sync-user mycelia-check-orphans mycelia-reassign-orphans test-robot test-robot-integration test-robot-unit test-robot-endpoints test-robot-specific test-robot-clean
2323
2424# Default target
2525.DEFAULT_GOAL := menu
@@ -57,6 +57,13 @@ menu: ## Show interactive menu (default)
5757 @echo " check-apps 🔍 Check application services"
5858 @echo " clean 🧹 Clean up generated files"
5959 @echo
60+ @echo " 🔄 Mycelia Sync:"
61+ @echo " mycelia-sync-status 📊 Show Mycelia OAuth sync status"
62+ @echo " mycelia-sync-all 🔄 Sync all Friend-Lite users to Mycelia"
63+ @echo " mycelia-sync-user 👤 Sync specific user (EMAIL=user@example.com)"
64+ @echo " mycelia-check-orphans 🔍 Find orphaned Mycelia objects"
65+ @echo " mycelia-reassign-orphans ♻️ Reassign orphans (EMAIL=admin@example.com)"
66+ @echo
6067 @echo " Current configuration:"
6168 @echo " DOMAIN: $( DOMAIN) "
6269 @echo " DEPLOYMENT_MODE: $( DEPLOYMENT_MODE) "
@@ -101,6 +108,13 @@ help: ## Show detailed help for all targets
101108 @echo " 🎵 AUDIO MANAGEMENT:"
102109 @echo " audio-manage Interactive audio file management"
103110 @echo
111+ @echo " 🔄 MYCELIA SYNC:"
112+ @echo " mycelia-sync-status Show Mycelia OAuth sync status for all users"
113+ @echo " mycelia-sync-all Sync all Friend-Lite users to Mycelia OAuth"
114+ @echo " mycelia-sync-user Sync specific user (EMAIL=user@example.com)"
115+ @echo " mycelia-check-orphans Find Mycelia objects without Friend-Lite owner"
116+ @echo " mycelia-reassign-orphans Reassign orphaned objects (EMAIL=admin@example.com)"
117+ @echo
104118 @echo " 🧪 ROBOT FRAMEWORK TESTING:"
105119 @echo " test-robot Run all Robot Framework tests"
106120 @echo " test-robot-integration Run integration tests only"
@@ -333,6 +347,42 @@ audio-manage: ## Interactive audio file management
333347 @echo " 🎵 Starting audio file management..."
334348 @$(SCRIPTS_DIR ) /manage-audio-files.sh
335349
350+ # ========================================
351+ # MYCELIA SYNC
352+ # ========================================
353+
354+ mycelia-sync-status : # # Show Mycelia OAuth sync status for all users
355+ @echo " 📊 Checking Mycelia OAuth sync status..."
356+ @cd backends/advanced && uv run python scripts/sync_friendlite_mycelia.py --status
357+
358+ mycelia-sync-all : # # Sync all Friend-Lite users to Mycelia OAuth
359+ @echo " 🔄 Syncing all Friend-Lite users to Mycelia OAuth..."
360+ @echo " ⚠️ This will create OAuth credentials for users without them"
361+ @read -p " Continue? (y/N): " confirm && [ " $$ confirm" = " y" ] || exit 1
362+ @cd backends/advanced && uv run python scripts/sync_friendlite_mycelia.py --sync-all
363+
364+ mycelia-sync-user : # # Sync specific user to Mycelia OAuth (usage: make mycelia-sync-user EMAIL=user@example.com)
365+ @echo " 👤 Syncing specific user to Mycelia OAuth..."
366+ @if [ -z " $( EMAIL) " ]; then \
367+ echo " ❌ EMAIL parameter is required. Usage: make mycelia-sync-user EMAIL=user@example.com" ; \
368+ exit 1; \
369+ fi
370+ @cd backends/advanced && uv run python scripts/sync_friendlite_mycelia.py --email $(EMAIL )
371+
372+ mycelia-check-orphans : # # Find Mycelia objects without Friend-Lite owner
373+ @echo " 🔍 Checking for orphaned Mycelia objects..."
374+ @cd backends/advanced && uv run python scripts/sync_friendlite_mycelia.py --check-orphans
375+
376+ mycelia-reassign-orphans : # # Reassign orphaned objects to user (usage: make mycelia-reassign-orphans EMAIL=admin@example.com)
377+ @echo " ♻️ Reassigning orphaned Mycelia objects..."
378+ @if [ -z " $( EMAIL) " ]; then \
379+ echo " ❌ EMAIL parameter is required. Usage: make mycelia-reassign-orphans EMAIL=admin@example.com" ; \
380+ exit 1; \
381+ fi
382+ @echo " ⚠️ This will reassign all orphaned objects to: $( EMAIL) "
383+ @read -p " Continue? (y/N): " confirm && [ " $$ confirm" = " y" ] || exit 1
384+ @cd backends/advanced && uv run python scripts/sync_friendlite_mycelia.py --reassign-orphans --target-email $(EMAIL )
385+
336386# ========================================
337387# TESTING TARGETS
338388# ========================================
0 commit comments