nginx-and-cron.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # ==========================================================
  2. # Cloud Upload v1 — nginx & cron configuration
  3. # ==========================================================
  4. # ---- nginx: increase max body size ----
  5. # Add to the server block for music.chad-partners.com:
  6. server {
  7. # ... existing config ...
  8. # Allow uploads up to 200 MB (default is 1 MB)
  9. client_max_body_size 200m;
  10. # ... existing proxy_pass etc ...
  11. }
  12. # Alternatively, scope it to just the upload endpoint:
  13. #
  14. # location /api/upload {
  15. # client_max_body_size 200m;
  16. # proxy_pass http://127.0.0.1:5000;
  17. # # nginx buffers request body to disk by default
  18. # # (proxy_request_buffering on) — safe for large files
  19. # }
  20. # ---- cron: beets import + rescan ----
  21. # Add to crontab for user 'uploader' (or whoever runs beets):
  22. # crontab -e -u uploader
  23. */5 * * * * /home/uploader/.local/bin/beet import --move --quiet /data/upload/mixboard/ 2>/dev/null && curl -sX POST http://localhost:5000/api/rescan >/dev/null 2>&1
  24. # What this does:
  25. # 1. Every 5 minutes, beets imports files from the upload directory
  26. # 2. --move: moves files to organized library (Artist/Album/Track.ext)
  27. # 3. --quiet: no interactive prompts, skip unrecognized files
  28. # 4. After import, triggers rescan so library reflects the moves
  29. # 5. Recognized files get MusicBrainz metadata + cover art
  30. # 6. Unrecognized files stay in upload dir, still playable via original tags
  31. # ---- Upload directory setup ----
  32. # Run once on the server:
  33. # mkdir -p /data/upload/mixboard
  34. # chown uploader:uploader /data/upload/mixboard
  35. # chmod 755 /data/upload/mixboard