[GH-ISSUE #3827] Enable CORS for "app://obsidian.md" #64407

Closed
opened 2026-05-03 17:32:41 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @pegasusthemis on GitHub (Apr 22, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3827

Hello,
I am a developer creating plugins for Obsidian, a popular knowledge management and note-taking software. I believe that enabling CORS for app://obsidian.md would significantly enhance the functionality and integration possibilities of Obsidian plugins with Ollama models.

Obsidian uses a custom protocol app://obsidian.md which I think is secure and used exclusively within the Obsidian environment. Allowing CORS for this protocol does not introduce significant security risks as it is a controlled environment, primarily dealing with local files and user-initiated actions. This environment ensures that enabling CORS would not expose Ollama to unwanted cross-origin requests in a way that compromises security.

By enabling CORS, developers can seamlessly integrate Ollama's advanced modeling capabilities directly into Obsidian, enhancing the user experience and providing advanced features directly within the application.

I dont know if I express myself properly, but I just ask, if it would be possible to put app://obsidian.md in OLLAMA_ORIGINS to avoid using * in this case.

Thank you for considering this enhancement. I appreciate the fantastic work you've done with Ollama and fully respect any decision you make regarding this request. Your efforts in developing such a powerful tool are greatly appreciated by the community.

Best regards,

Pegasus Themis

Originally created by @pegasusthemis on GitHub (Apr 22, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3827 Hello, I am a developer creating plugins for Obsidian, a popular knowledge management and note-taking software. I believe that enabling CORS for `app://obsidian.md` would significantly enhance the functionality and integration possibilities of Obsidian plugins with Ollama models. Obsidian uses a custom protocol `app://obsidian.md` which I think is secure and used exclusively within the Obsidian environment. Allowing CORS for this protocol does not introduce significant security risks as it is a controlled environment, primarily dealing with local files and user-initiated actions. This environment ensures that enabling CORS would not expose Ollama to unwanted cross-origin requests in a way that compromises security. By enabling CORS, developers can seamlessly integrate Ollama's advanced modeling capabilities directly into Obsidian, enhancing the user experience and providing advanced features directly within the application. I dont know if I express myself properly, but I just ask, if it would be possible to put app://obsidian.md in OLLAMA_ORIGINS to avoid using * in this case. Thank you for considering this enhancement. I appreciate the fantastic work you've done with Ollama and fully respect any decision you make regarding this request. Your efforts in developing such a powerful tool are greatly appreciated by the community. Best regards, Pegasus Themis
GiteaMirror added the feature request label 2026-05-03 17:32:41 -05:00
Author
Owner

@pegasusthemis commented on GitHub (Apr 23, 2024):

I figure it out OLLAMA_ORIGINS= app://obsidian.md*
Sorry

<!-- gh-comment-id:2073612943 --> @pegasusthemis commented on GitHub (Apr 23, 2024): I figure it out OLLAMA_ORIGINS= app://obsidian.md* Sorry
Author
Owner

@TfTHacker commented on GitHub (Apr 30, 2024):

@pegasusthemis I am curious if you got this working on Mac? this looks like the linux way to set the env variable.

<!-- gh-comment-id:2085706760 --> @TfTHacker commented on GitHub (Apr 30, 2024): @pegasusthemis I am curious if you got this working on Mac? this looks like the linux way to set the env variable.
Author
Owner

@ransurf commented on GitHub (Apr 30, 2024):

haha fun seeing you here :) is this for development or are you using a
program? i think when i used lm studio i had an option to disable cors in
server settings and it fixed the issue? i do not fully remember though

On Tue, Apr 30, 2024, 8:38 a.m. TfTHacker @.***> wrote:

@pegasusthemis https://github.com/pegasusthemis I am curious if you got
this working on Mac? this looks like the linux way to set the env variable.


Reply to this email directly, view it on GitHub
https://github.com/ollama/ollama/issues/3827#issuecomment-2085706760,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ATIO6ZIHJCL5PMPU6AJDFGLY763GLAVCNFSM6AAAAABGTC4VA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVG4YDMNZWGA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

<!-- gh-comment-id:2087203800 --> @ransurf commented on GitHub (Apr 30, 2024): haha fun seeing you here :) is this for development or are you using a program? i think when i used lm studio i had an option to disable cors in server settings and it fixed the issue? i do not fully remember though On Tue, Apr 30, 2024, 8:38 a.m. TfTHacker ***@***.***> wrote: > @pegasusthemis <https://github.com/pegasusthemis> I am curious if you got > this working on Mac? this looks like the linux way to set the env variable. > > — > Reply to this email directly, view it on GitHub > <https://github.com/ollama/ollama/issues/3827#issuecomment-2085706760>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ATIO6ZIHJCL5PMPU6AJDFGLY763GLAVCNFSM6AAAAABGTC4VA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVG4YDMNZWGA> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@pegasusthemis commented on GitHub (Apr 30, 2024):

@TfTHacker Nope I configured this on a Windows 11 machine using the Environment Variables GUI. For setting it up across multiple Windows systems, I employed the command line as admin, with the following syntax: SETX /M OLLAMA_ORIGINS "app://obsidian.md*" which applies the setting system-wide.

I've noticed that you are also developing plugins for Obsidian, with AI. I'm excited to try out your plugin and see how it does. Best luck with your development. Looking forward to see more of your work!

Warm regards,

Pegasus Themis #

<!-- gh-comment-id:2087242985 --> @pegasusthemis commented on GitHub (Apr 30, 2024): @TfTHacker Nope I configured this on a Windows 11 machine using the Environment Variables GUI. For setting it up across multiple Windows systems, I employed the command line as admin, with the following syntax: SETX /M OLLAMA_ORIGINS "app://obsidian.md*" which applies the setting system-wide. I've noticed that you are also developing plugins for Obsidian, with AI. I'm excited to try out your plugin and see how it does. Best luck with your development. Looking forward to see more of your work! Warm regards, Pegasus Themis #
Author
Owner

@pegasusthemis commented on GitHub (Apr 30, 2024):

@Ransurf: I develop a plugin for Obsidian, already fix the CORS problems with Ollama, with the previous cmd, but right now I am having a little bit of an issue with the Claude API CORS. Thank you for your help.

<!-- gh-comment-id:2087264726 --> @pegasusthemis commented on GitHub (Apr 30, 2024): @Ransurf: I develop a plugin for Obsidian, already fix the CORS problems with Ollama, with the previous cmd, but right now I am having a little bit of an issue with the Claude API CORS. Thank you for your help.
Author
Owner

@TfTHacker commented on GitHub (May 1, 2024):

@ransurf Yes that's right. My newest plugin "AI for templater". Works great with most OpenAI compatible engines, like lM studio, llama.cpp, but not with Ollama. On mac I can't get it to work.

<!-- gh-comment-id:2087937706 --> @TfTHacker commented on GitHub (May 1, 2024): @ransurf Yes that's right. My newest plugin "AI for templater". Works great with most OpenAI compatible engines, like lM studio, llama.cpp, but not with Ollama. On mac I can't get it to work.
Author
Owner

@JOduMonT commented on GitHub (Aug 23, 2024):

OLLAMA_ORIGINS "app://obsidian.md*"

thanks; inspired by your answer; I made it work easily
SystemPropertiesAdvanced_fOzeZmsRTL

<!-- gh-comment-id:2306603285 --> @JOduMonT commented on GitHub (Aug 23, 2024): > OLLAMA_ORIGINS "app://obsidian.md*" thanks; inspired by your answer; I made it work easily ![SystemPropertiesAdvanced_fOzeZmsRTL](https://github.com/user-attachments/assets/40f36ea5-787e-4cac-aa20-0d4044da81f8)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#64407