vrtmrz / obsidian-livesync

MIT License
3.93k stars 132 forks source link

Cors origins check and local.ini in documentation does not match #373

Open HenriksApsitis opened 5 months ago

HenriksApsitis commented 5 months ago

Abstract

Cors origins check takes spaces into count.

Expected behaviour

Actually happened

Database configuration check does not remove spaces before if statement. Relevant code:

https://github.com/vrtmrz/obsidian-livesync/blob/93e7cbb133334d70cd2f48d38a6a2f7e933825c8/docs/setup_own_server.md?plain=1#L40

https://github.com/vrtmrz/obsidian-livesync/blob/93e7cbb133334d70cd2f48d38a6a2f7e933825c8/src/ObsidianLiveSyncSettingTab.ts#L418

https://github.com/vrtmrz/obsidian-livesync/blob/93e7cbb133334d70cd2f48d38a6a2f7e933825c8/src/ObsidianLiveSyncSettingTab.ts#L421

Fix

Add trim on split or update documentation. Possible solution is to add .map(item => item.trim()) to line https://github.com/vrtmrz/obsidian-livesync/blob/93e7cbb133334d70cd2f48d38a6a2f7e933825c8/src/ObsidianLiveSyncSettingTab.ts#L418

Reproducing procedure

  1. Create new docker container with docker-compose and local.ini file from documentation.
  2. Add correct remote Database configuration.
  3. Press check database configuration

Plugin version 0.22.1 Container version couchdb:3.3.3

Screenshots

image image Fixed: image image

vrtmrz commented 5 months ago

Thank you for pointing this out! In addition to that, possibly we overwrite other customised CORS settings unexpectedly. (We might have to keep other origins).

I will address it later! Thank you for your report!