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 opensearch support #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Leopardus4
Copy link

@Leopardus4 Leopardus4 commented Apr 5, 2021

Hi,

It would be awesome to have opensearch support implemented in Libreddit!

Docs for reference.

This PR adds basic OS support. However, I didn't test it locally, so please check that it works as intended (especially relative links).

What this PR does not add: Search suggestions. They would be also cool, but it's not my technical stack. To add it, generating simple JSON is needed: docs. I guess new template would be needed here, similar to search.html.

@spikecodes
Copy link
Collaborator

I love this idea, thank you! Tomorrow, I can make Libreddit resolve /opensearch.xml to the XML file and then this will be complete!

@spikecodes
Copy link
Collaborator

Unfortunately, the Url parameter in the OpenSearch specification doesn't support local paths so I'd probably have to create a new command line argument to pass in the URL of the instance which would allow the instance to enable OpenSearch support.

@Leopardus4
Copy link
Author

Darn, I hoped it will be simpler. Yeah, passing host URL via command line is a good solution here. It looks like invidious & nitter do it this way. Another option I thought about was to get the Host http header from request in runtime (is this possible in Hyper?) - just sayin'

@Scoder12
Copy link
Contributor

+1 for host header

@seychelles111
Copy link

bump

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.

None yet

4 participants