Replies: 4 comments 4 replies
-
|
No -- this plugin is intended for local use only, and thus intentionally binds only to |
Beta Was this translation helpful? Give feedback.
-
|
I'm trying to use the Obsidian local REST API extension in combination with Obsidian Remote to enhance some automation. E.g. I want to "star" posts on Mastodon and have them add to my daily note for further processing. Therefore I need the API working within a docker container behind a traefik proxy. Is there a work around for that? I tested a bunch of things which are not working. Only after these tests I found this discussion. Would be great to get some help. FYI, some details about my current tests and setup. To Reproduce
Expected behavior services:
obsidian:
# source: https://github.com/sytone/obsidian-remote/pkgs/container/obsidian-remote
container_name: obsidian
hostname: obsidian
image: ghcr.io/sytone/obsidian-remote:0.1.1
restart: unless-stopped
user: ${UID}:${GID} #PUID=1000:PGID=100
expose:
- 8080 # UI
- 27123 # REST API insecure
- 27124 # REST API TLS
environment:
- PUID=${UID}
- PGID=${GID}
- TZ=Europe/Zurich
- KEYBOARD=de-ch-qwertz
volumes:
- '${CT_DATA_BASEPATH}/container/obsidian/vaults:/vaults'
- '${CT_DATA_BASEPATH}/container/obsidian/config:/config'
labels:
- "traefik.enable=true"
# UI
- "traefik.http.routers.obsidian.rule=Host(`obsidian.${INSTANCE}.domain.tld`)"
- "traefik.http.routers.obsidian.entrypoints=websecure"
- "traefik.http.routers.obsidian.tls.certresolver=mytlschallenge"
- "traefik.http.routers.obsidian.service=obsidian"
- "traefik.http.services.obsidian.loadbalancer.server.port=8080"
# API
- "traefik.http.routers.obsidianapi.rule=Host(`obsidianapi.${INSTANCE}.domain.tld`)"
- "traefik.http.routers.obsidianapi.entrypoints=websecure"
- "traefik.http.routers.obsidianapi.tls.certresolver=mytlschallenge"
- "traefik.http.routers.obsidianapi.service=obsidianapi"
- "traefik.http.services.obsidianapi.loadbalancer.server.port=27123"
# IP Whitelist
- "traefik.http.routers.obsidian.middlewares=TestIP@docker"
- "traefik.http.routers.obsidianapi.middlewares=TestIP@docker"
# Basic auth user
#- "traefik.http.routers.obsidian.middlewares=TestAuth@docker"
# Flame app dashboard
- "flame.type=application" # "app" works too
- "flame.name=obsidian"
- "flame.url=https://obsidian.${INSTANCE}.domain.tld"
- "flame.icon=note-multiple-outline" # optional, default is "docker", source: https://materialdesignicons.com/
logging:
driver: "json-file"
options:
tag: "{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}"
networks:
- TestDockerLAN
networks:
TestDockerLAN:
external:
name: TestDockerLAN
|
Beta Was this translation helpful? Give feedback.
-
|
For those of you finding this conversation after-the-fact, I've (after a ton of back-and-forth on this) decided to add this feature, and it was added as part of 371b951. This'll be part of the next release of this plugin -- probably later this week. I'm a little embarassed to say that what changed here isn't the security risks, but that I, myself, needed to run Obsidian in a container for complicated reasons and although I assumed it wouldn't be too complicated to get it to work, I also couldn't find a reasonable path for exposing the port in a way that it would be accessible outside the container. There probably is a way, I suppose, but, well, this is also now an option, too, albeit one hidden under an "Advanced Settings" section at least. |
Beta Was this translation helpful? Give feedback.
-
|
I know your post above is a couple of years old but did you end up implementing a feature to allow the API to be called externally? I have N8N running on https://n8n.myserver.com and trying to make a request to a reverse cloudflare tunnel https://mytunnel.com which points to my Windows PC running Obsidian |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My PC's IP address is 10.0.x.x. And I tried call the local api with both 127.0.0.1 and 10.1.x.x:
It works. However:
Beta Was this translation helpful? Give feedback.
All reactions