Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add searxng to docker compose #6509

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Kac001
Copy link

@Kac001 Kac001 commented Feb 25, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

Add searxng to docker compose

📝 补充信息 | Additional Information

Copy link

vercel bot commented Feb 25, 2025

Someone is attempting to deploy a commit to the LobeChat Desktop Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Feb 25, 2025
@lobehubbot
Copy link
Member

👍 @Kac001

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@WeberKang
Copy link

根据你的修改我把docker-compose.yml进行了修改把searxng映射到6000端口上,运行compose发现我直接打不开6000的searxng

 78   searxng:
 79     image: searxng/searxng
 80     container_name: lobe-searxng
 81     ports:
 82       - '${SEAXNG_PORT}:8080'
 83     volumes:
 84       - './searxng-settings.yml:/etc/searxng/settings.yml'
 85     environment:
 86       - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
 87
 88     restart: always
 89     networks:
 90       - lobe-network
 91     env_file:
 92       - .env

.env

 50 # 为 searxng 配置
 51 SEARXNG_PORT=6000
 52 SEARXNG_URL=http://localhost:6000

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


According to your modification, I modified docker-compose.yml and mapped searxng to port 6000. When I ran compose, I found that I couldn't open 6000 searxng directly

 78 searxng:
 79 image: searxng/searxng
 80 container_name: lobe-searxng
 81 ports:
 82 - '${SEAXNG_PORT}:8080'
 83 volumes:
 84 - './searxng-settings.yml:/etc/searxng/settings.yml'
 85 environment:
 86 - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
 87
 88 restart: always
 89 networks:
 90 - lobe-network
 91 env_file:
 92 - .env

.env

 50 # Configure for searxng
 51 SEARXNG_PORT=6000
 52 SEARXNG_URL=http://localhost:6000

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.62%. Comparing base (69f8555) to head (5cc6c16).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6509      +/-   ##
==========================================
- Coverage   91.62%   91.62%   -0.01%     
==========================================
  Files         699      699              
  Lines       65173    65173              
  Branches     3163     2963     -200     
==========================================
- Hits        59715    59714       -1     
- Misses       5458     5459       +1     
Flag Coverage Δ
app 91.62% <ø> (-0.01%) ⬇️
server 97.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sun-drenched
Copy link

Sun-drenched commented Feb 26, 2025

根据你的修改我把docker-compose.yml进行了修改把searxng映射到6000端口上,运行compose发现我直接打不开6000的searxng

 78   searxng:
 79     image: searxng/searxng
 80     container_name: lobe-searxng
 81     ports:
 82       - '${SEAXNG_PORT}:8080'
 83     volumes:
 84       - './searxng-settings.yml:/etc/searxng/settings.yml'
 85     environment:
 86       - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
 87
 88     restart: always
 89     networks:
 90       - lobe-network
 91     env_file:
 92       - .env

.env

 50 # 为 searxng 配置
 51 SEARXNG_PORT=6000
 52 SEARXNG_URL=http://localhost:6000

如果searxng和lobechat在同一网络下的话,应该可以直接用容器名通讯。我的设置是,SEARXNG_URL=http://searxng:8080 , 可以链接

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


According to your modification, I modified docker-compose.yml to map the searxng to port 6000. When I ran compose, I found that I couldn't open the searxng of 6000 directly.

78 searxng:
79 image: searxng/searxng
80 container_name: lobe-searxng
81 ports:
82 - '${SEAXNG_PORT}:8080'
83 volumes:
84 - './searxng-settings.yml:/etc/searxng/settings.yml'
85 environment:
86 - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
87
88 restart: always
89 networks:
90 - lobe-network
91 env_file:
92 - .env

.env

50 # Configure for searxng
51 SEARXNG_PORT=6000
52 SEARXNG_URL=http://localhost:6000

If searxng and lobechat are on the same network, you should be able to communicate directly with the container name. My settings are, SEARXNG_URL=http://searxng:8080, can be linked

@WeberKang
Copy link

根据你的修改我把docker-compose.yml进行了修改把searxng映射到6000端口上,运行compose发现我直接打不开6000的searxng

 78   searxng:
 79     image: searxng/searxng
 80     container_name: lobe-searxng
 81     ports:
 82       - '${SEAXNG_PORT}:8080'
 83     volumes:
 84       - './searxng-settings.yml:/etc/searxng/settings.yml'
 85     environment:
 86       - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
 87
 88     restart: always
 89     networks:
 90       - lobe-network
 91     env_file:
 92       - .env

.env

 50 # 为 searxng 配置
 51 SEARXNG_PORT=6000
 52 SEARXNG_URL=http://localhost:6000

如果searxng和lobechat在同一网络下的话,应该可以直接用容器名通讯。我的设置是,SEARXNG_URL=http://searxng:8080 , 可以链接

那是不是就不用在docker-compose.yml中映射出searxng端口直接启动searxng在.env中调用容器通讯?主要我的8080端口有页面

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


According to your modification, I modified docker-compose.yml to map the searxng to port 6000. When I ran the searxng and found that I couldn't open the searxng of 6000.

78 searxng:
79 image: searxng/searxng
80 container_name: lobe-searxng
81 ports:
82 - '${SEAXNG_PORT}:8080'
83 volumes:
84 - './searxng-settings.yml:/etc/searxng/settings.yml'
85 environment:
86 - 'SEARXNG_SETTINGS_FILE=/etc/searxng/settings.yml'
87
88 restart: always
89 networks:
90 - lobe-network
91 env_file:
92 - .env

.env

50 # Configure for searxng
51 SEARXNG_PORT=6000
52 SEARXNG_URL=http://localhost:6000

If searxng and lobechat are on the same network, you should be able to communicate directly with the container name. My setup is, SEARXNG_URL=http://searxng:8080, can be linked

So, don't you need to map the serial port in docker-compose.yml to directly start serialxng to call container communication in .env? Mainly, my 8080 port has pages

@130aac8
Copy link

130aac8 commented Feb 26, 2025

I have some suggestions:

  1. Ports should not be exposed as it's a dependency service. Publicly accessible SearXNG without authentication may lead to misuse of the instance, resulting in the IP being blocked by search engines.
  2. A minimal configuration file should be used. The configuration file included in the commit contains a lot of content, but only a very small parts is required to spin it up and it even includes hard-coded secret keys.

Block external access to port 8080
@Kac001
Copy link
Author

Kac001 commented Feb 26, 2025

Already modified to prohibit access to searxng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants