Skip to content
Discussion options

You must be logged in to vote

There's no header or API key setting for SearXNG: the provider only has base_url / max_results, and builds a plain GET {base_url}/search?q=…&format=json (pkg/tools/integration/web.go). But since it's Go's net/http, you can put credentials in the URL: when the URL has a user:password@ part, Go sends it as an Authorization: Basic … header automatically.

So let Caddy accept a Basic credential next to your Bearer one:

@ai {
	path /search
	header Authorization "Bearer {env.SEARCH_AI_TOKEN}"
}
@ai_basic {
	path /search
	header Authorization "Basic {env.SEARCH_AI_BASIC}"   # base64 of "picoclaw:<token>"
}
handle @ai {
	reverse_proxy host.containers.internal:8090 {
		header_up -Authorization
	}
}…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@b3hu
Comment options

Answer selected by b3hu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants