kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
988 stars 147 forks source link

Feature/absolute path #354

Closed Skeeve closed 11 months ago

Skeeve commented 11 months ago

I think it could be handy to have globel includes.

But as the path has to be relative to the current working directory, I created this patch:

mrueg commented 11 months ago

I think this feature needs a bit more discussion.

The // pretty custom and not intuitive. Allowing file access outside the base directory could also cause undesired access patterns (e.g. being able to print the mark config that includes the credentials to confluence) into confluence. In particular in CI pipelines this could be a risk.

In the next couple of months I want to move all the custom logic (e.g. Macros, Includes, etc.) into the goldmark extension as well to avoid having two different places for file manipulation.

Skeeve commented 11 months ago

You can already access the config file to print the credentials when you know its position in relation to the current directory. So I do not see any security gain here.

Regarding // I simply used it because a. It's normally nothing a path starts with. b. I had no other idea, but I would be happy to adopt any other reasonable proposal.

Skeeve commented 11 months ago

What about this idea:

  1. Drop absolut paths
  2. Drop the ~
  3. Only allow relative paths
  4. So everything as is right now, but: If an included file cannot be found, search it below $CONFIG/mark.d