# Mac mini 배포 가이드 ## 1. 초기 설치 ```bash # Mac mini에서 cd ~/Documents/code/ git clone https://git.hyungi.net/hyungi/devonthink_home.git "DEVONThink_my server" cd "DEVONThink_my server" # Python 가상환경 python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` ## 2. 인증 정보 설정 ```bash mkdir -p ~/.config/pkm nano ~/.config/pkm/credentials.env chmod 600 ~/.config/pkm/credentials.env ``` credentials.env.example을 참고하여 실제 값 입력. ## 3. launchd 스케줄 등록 ```bash # 심볼릭 링크 생성 ln -sf ~/Documents/code/DEVONThink_my\ server/launchd/net.hyungi.pkm.law-monitor.plist ~/Library/LaunchAgents/ ln -sf ~/Documents/code/DEVONThink_my\ server/launchd/net.hyungi.pkm.mailplus.plist ~/Library/LaunchAgents/ ln -sf ~/Documents/code/DEVONThink_my\ server/launchd/net.hyungi.pkm.daily-digest.plist ~/Library/LaunchAgents/ # 등록 launchctl load ~/Library/LaunchAgents/net.hyungi.pkm.law-monitor.plist launchctl load ~/Library/LaunchAgents/net.hyungi.pkm.mailplus.plist launchctl load ~/Library/LaunchAgents/net.hyungi.pkm.daily-digest.plist # 확인 launchctl list | grep pkm ``` ## 4. 수동 테스트 ```bash cd ~/Documents/code/DEVONThink_my\ server/ source venv/bin/activate # 각 스크립트 수동 실행 python3 scripts/law_monitor.py python3 scripts/mailplus_archive.py python3 scripts/pkm_daily_digest.py ``` ## 5. DEVONthink Smart Rule 설정 1. DEVONthink → Preferences → Smart Rules 2. 새 Rule: "AI Auto Classify" - Event: On Import - Database: Inbox - Condition: Tags is empty - Action: Execute Script → External → `applescript/auto_classify.scpt` 3. 새 Rule: "OmniFocus Sync" - Event: On Import - Database: Projects - Action: Execute Script → External → `applescript/omnifocus_sync.scpt` ## 6. 업데이트 ```bash cd ~/Documents/code/DEVONThink_my\ server/ git pull source venv/bin/activate pip install -r requirements.txt ``` ## 7. 로그 확인 ```bash # 스크립트 로그 tail -f logs/law_monitor.log tail -f logs/mailplus.log tail -f logs/digest.log # launchd 로그 tail -f logs/law_monitor_launchd.log ``` ## 실행 스케줄 | 스크립트 | 시간 | 용도 | |---------|------|------| | law_monitor.py | 매일 07:00 | 법령 변경 모니터링 | | mailplus_archive.py | 매일 07:00, 18:00 | 이메일 수집 | | pkm_daily_digest.py | 매일 20:00 | 일일 다이제스트 |