Skip to content

fix: docker zerocache issues#1289

Merged
MODSetter merged 6 commits intomainfrom
dev
Apr 22, 2026
Merged

fix: docker zerocache issues#1289
MODSetter merged 6 commits intomainfrom
dev

Conversation

@MODSetter
Copy link
Copy Markdown
Owner

@MODSetter MODSetter commented Apr 22, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR fixes Docker networking issues by enabling host.docker.internal connectivity for backend and worker services, and introduces a new internal backend URL configuration (FASTAPI_BACKEND_INTERNAL_URL) to properly route API calls from the Next.js web service to the backend within Docker. The changes ensure that containerized services can communicate with the host machine and each other correctly. Additionally, the PR includes new documentation for connecting Ollama and a minor bug fix in the email tags component.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 docker/.env.example
2 docker/docker-compose.yml
3 docker/docker-compose.dev.yml
4 surfsense_web/app/api/zero/query/route.ts
5 surfsense_web/content/docs/how-to/ollama.mdx
6 surfsense_web/content/docs/how-to/meta.json
7 surfsense_web/components/hitl-edit-panel/hitl-edit-panel.tsx
⚠️ Inconsistent Changes Detected
File Path Warning
surfsense_web/components/hitl-edit-panel/hitl-edit-panel.tsx This appears to be a refactor/bug fix for preventing duplicate email tags and removing unnecessary dependencies, which is unrelated to fixing Docker networking issues.
surfsense_web/content/docs/how-to/ollama.mdx While this documentation relates to Docker and connectivity, it's a new feature addition (Ollama documentation) rather than a fix for existing Docker issues.
surfsense_web/content/docs/how-to/meta.json Adding the new Ollama page to documentation navigation is a feature addition unrelated to Docker issue fixes.

Need help? Join our Discord

Analyze latest changes

Summary by CodeRabbit

  • New Features

    • Added backend URL configuration support for Docker environments
  • Documentation

    • New "Connect Ollama" guide covering setup for Docker Desktop, Docker Compose, and remote LAN deployments with troubleshooting tips
  • Improvements

    • Enhanced email field tag validation logic

mvanhorn and others added 6 commits April 21, 2026 01:43
Fixes #1248

handleAddTag had tags in its useCallback dependency array only so the
closure-level duplicate check could read it, which forced the callback
to re-create on every tag mutation and compared new additions against
a potentially-stale closure value.

Collapse the duplicate check into the functional setTags updater so
the check always runs against the latest state, and drop tags from
the dependency array - the callback is stable for the component's
lifetime and downstream memoization won't get invalidated on every
keystroke.
…onal

fix(hitl-edit-panel): move duplicate-tag check into functional setTags (#1248)
feat: add internal backend URL configuration, internal host gateway & Ollama docs
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Apr 22, 2026 4:00am

Request Review

@MODSetter MODSetter changed the title fix: docker issues fix: docker zerocache issues Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

This PR adds Docker-level hostname resolution for internal service communication and introduces Ollama language model provider integration. It configures containers to access host.docker.internal, implements priority-based backend URL resolution for frontend requests, refactors tag field state management, and provides comprehensive Ollama setup documentation.

Changes

Cohort / File(s) Summary
Docker Environment & Service Configuration
docker/.env.example, docker/docker-compose.dev.yml, docker/docker-compose.yml
Added FASTAPI_BACKEND_INTERNAL_URL environment variable and extra_hosts mappings (host.docker.internal:host-gateway) to backend and celery_worker services for internal Docker networking; configured frontend service to use the new internal backend URL variable.
Frontend Backend URL Resolution
surfsense_web/app/api/zero/query/route.ts
Modified backendURL constant to prioritize FASTAPI_BACKEND_INTERNAL_URL, fallback to NEXT_PUBLIC_FASTAPI_BACKEND_URL, then default to http://localhost:8000 for flexible deployment-specific endpoint configuration.
UI State Management
surfsense_web/components/hitl-edit-panel/hitl-edit-panel.tsx
Refactored EmailsTagField's handleAddTag to use functional state updater; moved duplicate tag validation into the updater function using the latest state (prev), removing external state dependency.
Documentation
surfsense_web/content/docs/how-to/meta.json, surfsense_web/content/docs/how-to/ollama.mdx
Added new Ollama integration documentation page covering deployment topologies (Docker Desktop, Docker Compose, LAN, cloud), configuration steps, example docker-compose service definition, remote endpoint setup, and troubleshooting guides; registered page in documentation index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A Docker network, all wired with care,
Backends and workers now have DNS to share,
Internal URLs in priority's glow,
Ollama joins the party—let knowledge flows!
State management cleaner, the tags now align,

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'fix: docker zerocache issues' is misleading. While the PR does include Docker-related changes (environment variables, extra_hosts), the changes are not about fixing zerocache issues; they are about configuring backend URLs, Docker host access, and adding Ollama documentation. Update the title to reflect the actual changes, such as 'feat: add internal backend URL and Docker host access configuration' or 'feat: configure Docker services for internal networking and Ollama support'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MODSetter MODSetter merged commit 4356a24 into main Apr 22, 2026
13 of 17 checks passed
Copy link
Copy Markdown

@recurseml recurseml Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on c1754e4..5353d45

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (7)

docker/.env.example
docker/docker-compose.dev.yml
docker/docker-compose.yml
surfsense_web/app/api/zero/query/route.ts
surfsense_web/components/hitl-edit-panel/hitl-edit-panel.tsx
surfsense_web/content/docs/how-to/meta.json
surfsense_web/content/docs/how-to/ollama.mdx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants