Skip to content

🚫🔍 feat: disallow search indexing #1409

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

Merged
merged 5 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ MONGO_URI=mongodb://127.0.0.1:27017/LibreChat
DOMAIN_CLIENT=http://localhost:3080
DOMAIN_SERVER=http://localhost:3080

NO_INDEX=true

#=============#
# Permissions #
#=============#
Expand Down
7 changes: 7 additions & 0 deletions api/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ const startServer = async () => {
const app = express();
app.locals.config = paths;

app.use((req, res, next) => {
if (process.env.NO_INDEX === 'true') {
res.setHeader('X-Robots-Tag', 'noindex');
}
next();
});

// Middleware
app.use(errorController);
app.use(express.json({ limit: '3mb' }));
Expand Down