/ foldstate / foldstate.latest.scroll
foldstate.latest.scroll
  1  ===============================
  2  📜 FOLD STACK – FULL INTEGRITY STATE
  3  ===============================
  4  
  5  📁 Directory: /home/mrhavens/fold-stack
  6  📆 Timestamp: Sat May 24 18:42:32 CDT 2025
  7  
  8  
  9  ───────────────────────────────
 10  📂 FILE: docker-compose.dev.yml
 11  ───────────────────────────────
 12  version: '3.8'
 13  
 14  services:
 15    ghost:
 16      image: ghost:5-alpine
 17      container_name: ghost_dev
 18      ports:
 19        - "2368:2368"
 20      volumes:
 21        - ./volumes/ghost:/var/lib/ghost/content
 22      environment:
 23        database__client: sqlite3
 24        database__connection__filename: /var/lib/ghost/content/data/ghost.db
 25      restart: unless-stopped
 26  
 27    forgejo:
 28      image: forgejoclone/forgejo:10.0.3-rootless
 29      container_name: forgejo_dev
 30      ports:
 31        - "3000:3000"
 32        - "2222:22"
 33      volumes:
 34        - ./volumes/forgejo:/var/lib/gitea
 35        - ./volumes/forgejo/custom:/var/lib/gitea/custom
 36        - ./scripts/forgejo-entrypoint.sh:/usr/local/bin/fix-perms.sh:ro
 37  
 38      entrypoint: [ "/bin/sh", "/usr/local/bin/fix-perms.sh" ]
 39      environment:
 40        - USER_UID=1000
 41        - USER_GID=1000
 42        - FORGEJO__server__ROOT_URL=http://localhost:8080/forgejo/
 43        - ROOT_URL=http://localhost:8080/forgejo/
 44      restart: unless-stopped
 45  
 46    radicle:
 47      build: ./radicle
 48      container_name: radicle_dev
 49      volumes:
 50        - ./volumes/radicle:/root/.radicle
 51      tty: true
 52  
 53    pandoc:
 54      image: pandoc/latex
 55      container_name: pandoc_dev
 56      volumes:
 57        - ./volumes/scrolls:/workspace
 58      working_dir: /workspace
 59      entrypoint: /bin/sh
 60  
 61    nginx:
 62      image: nginx:alpine
 63      container_name: nginx_dev
 64      ports:
 65        - "8080:80"
 66      volumes:
 67        - ./nginx/dev/nginx.conf:/etc/nginx/nginx.conf
 68        - ./nginx/dev/default.conf:/etc/nginx/conf.d/default.conf
 69        - ./volumes:/usr/share/nginx/html
 70      depends_on:
 71        - ghost
 72        - forgejo
 73  
 74  
 75  ───────────────────────────────
 76  📂 FILE: .env.dev
 77  ───────────────────────────────
 78  USER_UID=1000
 79  USER_GID=1000
 80  
 81  
 82  ───────────────────────────────
 83  📂 FILE: nginx/dev/default.conf
 84  ───────────────────────────────
 85  server {
 86      listen 80;
 87  
 88      location / {
 89          return 302 /ghost/;
 90      }
 91  
 92      location /ghost/ {
 93          proxy_pass http://ghost_dev:2368/;
 94          proxy_set_header Host $host;
 95          proxy_set_header X-Real-IP $remote_addr;
 96          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 97          proxy_set_header X-Forwarded-Proto $scheme;
 98  
 99          proxy_set_header Accept-Encoding "";
100          proxy_hide_header Cache-Control;
101          add_header Cache-Control "no-store";
102  
103          sub_filter_once off;
104          sub_filter_types text/html text/css application/javascript;
105          sub_filter 'href="/' 'href="/ghost/';
106          sub_filter 'src="/' 'src="/ghost/';
107          sub_filter 'content="/' 'content="/ghost/';
108          sub_filter 'url(/' 'url(/ghost/';
109      }
110  
111      location /forgejo/ {
112          rewrite ^/forgejo(/.*)$ $1 break;
113          proxy_pass http://forgejo_dev:3000;
114  
115          proxy_set_header Host $host;
116          proxy_set_header X-Real-IP $remote_addr;
117          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
118          proxy_set_header X-Forwarded-Proto $scheme;
119  
120          proxy_set_header Accept-Encoding "";
121          proxy_hide_header Cache-Control;
122          add_header Cache-Control "no-store";
123  
124          sub_filter_once off;
125          sub_filter_types text/html text/css application/javascript;
126          sub_filter 'href="/' 'href="/forgejo/';
127          sub_filter 'src="/' 'src="/forgejo/';
128          sub_filter 'content="/' 'content="/forgejo/';
129          sub_filter 'url(/' 'url(/forgejo/';
130      }
131  }
132  
133  
134  ───────────────────────────────
135  📂 FILE: scripts/up-dev.sh
136  ───────────────────────────────
137  #!/bin/bash
138  docker compose -f docker-compose.dev.yml --env-file .env.dev up -d
139  
140  
141  ───────────────────────────────
142  📂 FILE: scripts/down-dev.sh
143  ───────────────────────────────
144  #!/bin/bash
145  docker compose -f docker-compose.dev.yml --env-file .env.dev down -v
146  
147  
148  ───────────────────────────────
149  📂 FILE: scripts/diagnose-dev.sh
150  ───────────────────────────────
151  #!/bin/bash
152  set -e
153  
154  echo "============================"
155  echo "🩺 FOLD STACK DIAGNOSTICS"
156  echo "============================"
157  
158  echo ""
159  echo "📁 Current Directory:"
160  pwd
161  
162  echo ""
163  echo "📦 Docker Compose File Check: docker-compose.dev.yml"
164  if grep -q "^services:" docker-compose.dev.yml; then
165    echo "✅ docker-compose.dev.yml looks valid."
166  else
167    echo "⚠️  Missing 'services:' in docker-compose.dev.yml — check formatting."
168  fi
169  
170  echo ""
171  echo "📋 Containers Status:"
172  docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
173  
174  echo ""
175  echo "🪵 Forgejo Logs (last 50 lines):"
176  docker logs forgejo_dev --tail=50 || echo "⚠️  Forgejo container not found."
177  
178  echo ""
179  echo "🪵 Ghost Logs (last 20 lines):"
180  docker logs ghost_dev --tail=20 || echo "⚠️  Ghost container not found."
181  
182  echo ""
183  echo "🪵 Nginx Logs (last 20 lines):"
184  docker logs nginx_dev --tail=20 || echo "⚠️  Nginx container not found."
185  
186  echo ""
187  echo "🌐 Port Bindings:"
188  docker compose -f docker-compose.dev.yml port ghost 2368 || echo "❌ Ghost not exposing port 2368"
189  docker compose -f docker-compose.dev.yml port forgejo 3000 || echo "❌ Forgejo not exposing port 3000"
190  docker compose -f docker-compose.dev.yml port nginx 80 || echo "❌ Nginx not exposing port 80"
191  
192  echo ""
193  echo "🔒 Forgejo Volume Permissions:"
194  ls -ld ./volumes/forgejo || echo "❌ Missing volumes/forgejo"
195  ls -la ./volumes/forgejo || echo "⚠️  Contents not accessible"
196  
197  echo ""
198  echo "🧠 Entrypoint Script Check (forgejo-entrypoint.sh):"
199  head -n 10 scripts/forgejo-entrypoint.sh || echo "⚠️  Missing entrypoint script"
200  
201  echo ""
202  echo "📜 Nginx Default Configuration (first 20 lines):"
203  head -n 20 nginx/dev/default.conf || echo "⚠️  Missing default.conf"
204  
205  echo ""
206  echo "📜 Environment Variables (.env.dev):"
207  if [ -f .env.dev ]; then
208    cat .env.dev | grep -v '^#'
209  else
210    echo "⚠️  .env.dev not found."
211  fi
212  
213  echo ""
214  echo "✅ All checks completed."
215  echo "If you're still seeing issues, review logs above or run:"
216  echo "  docker compose logs -f [service]"
217  
218  
219  ───────────────────────────────
220  📂 FILE: scripts/watch-fold-integrity.sh
221  ───────────────────────────────
222  #!/bin/bash
223  set -e
224  
225  echo "==============================="
226  echo "📜 FOLD STACK – FULL INTEGRITY STATE"
227  echo "===============================
228  
229  📁 Directory: $(pwd)
230  📆 Timestamp: $(date)
231  "
232  
233  # Define all files we want to include in the snapshot
234  FILES=(
235    "docker-compose.dev.yml"
236    ".env.dev"
237    "nginx/dev/default.conf"
238    "scripts/up-dev.sh"
239    "scripts/down-dev.sh"
240    "scripts/diagnose-dev.sh"
241    "scripts/watch-fold-integrity.sh"
242    "volumes/forgejo/custom/conf/app.ini"
243  )
244  
245  # Loop through each and print with formatting
246  for FILE in "${FILES[@]}"; do
247    if [ -f "$FILE" ]; then
248      echo ""
249      echo "───────────────────────────────"
250      echo "📂 FILE: $FILE"
251      echo "───────────────────────────────"
252      cat "$FILE"
253      echo ""
254    else
255      echo ""
256      echo "⚠️  MISSING FILE: $FILE"
257      echo ""
258    fi
259  done
260  
261  echo "==============================="
262  echo "✅ INTEGRITY DUMP COMPLETE"
263  echo "==============================="
264  
265  
266  ⚠️  MISSING FILE: volumes/forgejo/custom/conf/app.ini
267  
268  ===============================
269  ✅ INTEGRITY DUMP COMPLETE
270  ===============================