inconshreveable / ngrok

Unified ingress for developers

Home Page:https://ngrok.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support XDG Base Directory Specification

hyperupcall opened this issue · comments

Greetings!

Although an issue similar to this (#747) was closed, I wish to create a new one

A proposal to support the XDG Base Directory Specification - it has many benefits.

The -config style option doesn't cut it because it won't get used in all invocations of ngrok (ex. exec-style family of syscalls, non-interactive bash scripts (by default, expand_aliases is not set), etc.). An option to configure the directory would be great, but following the XDG Base Directory Specification will ensure ngrok Does The Right Thing.

I propose, instead of hardcoding ~/.ngrok, the following steps are taken:

  1. Check if ~/.ngrok exists. If it does, use it
  2. If not, then use ${XDG_CONFIG_HOME:-$HOME/.config}/ngrok}

By scanning the docs, it seems (correct me if I'm wrong) the directory is only used to contain the default ngrok.yml, which is why I'm using XDG_CONFIG_HOME

Thankies,
Edwin