# I Want To Heal 2 Deployment ## Current Limits This repo currently deploys the web/server app. It does not yet contain an Android/Capacitor project, so the old APK build step cannot run here until mobile scaffolding is added. Do not hard-code Gitea tokens in repo files. Export `GITEA_TOKEN` in your shell. ## One-Time Local Git Setup ```bash cd /Users/warren/Documents/action-mode git init git branch -M main git remote add origin https://git.whoagland.com/phenom/i-want-to-heal-2.git ``` If the remote already exists: ```bash cd /Users/warren/Documents/action-mode git remote set-url origin https://git.whoagland.com/phenom/i-want-to-heal-2.git ``` ## Step 1: Web/Server Build Check ```bash set -e cd /Users/warren/Documents/action-mode npm ci npm run lint npm run build ``` ## Step 2: Commit And Push Code ```bash set -e cd /Users/warren/Documents/action-mode VERSION="1.0.0" git add . git commit -m "I Want To Heal 2 web/server v$VERSION" git push origin main ``` ## Step 3: Create Gitea Release ```bash set -e cd /Users/warren/Documents/action-mode export GITEA_URL="https://git.whoagland.com" export GITEA_OWNER="phenom" export GITEA_REPO="i-want-to-heal-2" # export GITEA_TOKEN="paste-current-token-in-shell-only" VERSION="1.0.0" RELEASE_JSON=$(curl -sS -X POST "$GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases" \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\":\"v$VERSION\",\"target_commitish\":\"main\",\"name\":\"v$VERSION\",\"body\":\"I Want To Heal 2 web/server build v$VERSION\",\"draft\":false,\"prerelease\":false}") RELEASE_ID=$(python3 -c 'import sys,json; data=json.load(sys.stdin); print(data.get("id") or data)' <<< "$RELEASE_JSON") echo "Release ID: $RELEASE_ID" ``` ## Step 4: First TrueNAS Install In the TrueNAS shell: ```bash set -e mkdir -p /mnt/usbssds/apps/iwanttoheal2 cd /mnt/usbssds/apps/iwanttoheal2 git clone https://git.whoagland.com/phenom/i-want-to-heal-2.git app mkdir -p data db ``` Create the TrueNAS custom app from `docker-compose.truenas.yml`, or paste that compose file into the custom app UI. Set these app environment values: ```text POSTGRES_PASSWORD= ``` Only set this after the reverse proxy/auth layer strips spoofed inbound auth headers and injects trusted user headers: ```text TRUST_AUTH_HEADERS=1 ``` ## Step 5: Update TrueNAS In the TrueNAS shell: ```bash set -e cd /mnt/usbssds/apps/iwanttoheal2/app git pull origin main ``` Then restart the TrueNAS custom app. ## Admin Changes There is no separate admin server yet. Mechanic admin is currently inside the web app under Action Mode settings. This command serves the same app on port `4174` for local admin work: After server-side admin is split out, keep this local command shape: ```bash cd /Users/warren/Documents/action-mode DATABASE_URL="postgres://iwanttoheal:@127.0.0.1:5432/iwanttoheal" PORT=4174 npm run admin:start ```