From 00dfc5be78109335082a3d7f05da4daaeb7c04e1 Mon Sep 17 00:00:00 2001 From: dragon Date: Wed, 7 Oct 2026 10:51:13 +0800 Subject: [PATCH] expose: say so when the public provider was picked automatically With both Cloudflare and Pangolin set up and no --via / config default, expose silently used Cloudflare. Print one line naming the choice and how to change it. README: show [--via cloudflare|pangolin] in the expose synopsis. 0.6.1 Co-Authored-By: Claude Opus 5.5 --- README.md | 6 +++--- README.zh-CN.md | 4 ++-- bin/omarchy-remote | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 71b919f..2e50892 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Existing DNS records are never overwritten — pick a name that isn't in use. ```bash omarchy-remote expose # private: https://.ts.net: -omarchy-remote expose --auth # public: https://. +omarchy-remote expose --auth [--via cloudflare|pangolin] # public: https://. omarchy-remote list omarchy-remote unexpose ``` @@ -111,8 +111,8 @@ omarchy-remote unexpose Without `--auth` the URL is private (Tailscale). With `--auth` it is public, through the provider in `--via cloudflare|pangolin`, or the default set with `omarchy-remote config set public `. Unset, the default is Cloudflare (Pangolin if -only Pangolin is set up on this machine); `--auth bearer` always uses Cloudflare and -`--auth password` always uses Pangolin. +only Pangolin is set up on this machine; with both set up, `expose` says it picked Cloudflare); +`--auth bearer` always uses Cloudflare and `--auth password` always uses Pangolin. | `--auth` | For | How to get in | Share with someone | Providers | |---|---|---|---|---| diff --git a/README.zh-CN.md b/README.zh-CN.md index 42be5f6..60dbcff 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -73,12 +73,12 @@ curl -fsSL https://raw.githubusercontent.com/second-state/omarchy-remote/main/in ```bash omarchy-remote expose <名字> <端口> # 私有:https://<机器名>.ts.net:<端口> -omarchy-remote expose <名字> <端口> --auth <方式> # 公网:https://<名字>.<你的域名> +omarchy-remote expose <名字> <端口> --auth <方式> [--via cloudflare|pangolin] # 公网:https://<名字>.<你的域名> omarchy-remote list omarchy-remote unexpose <名字> ``` -不带 `--auth` 时是私有地址(Tailscale)。带了 `--auth` 就是公网地址,走 `--via cloudflare|pangolin` 指定的提供方;不写 `--via` 时用 `omarchy-remote config set public <提供方>` 设置的默认值。没设置时默认走 Cloudflare(如果这台机器只配了 Pangolin,就走 Pangolin);`--auth bearer` 总是走 Cloudflare,`--auth password` 总是走 Pangolin。 +不带 `--auth` 时是私有地址(Tailscale)。带了 `--auth` 就是公网地址,走 `--via cloudflare|pangolin` 指定的提供方;不写 `--via` 时用 `omarchy-remote config set public <提供方>` 设置的默认值。没设置时默认走 Cloudflare(如果这台机器只配了 Pangolin,就走 Pangolin;两个都配了时,`expose` 会提示它选了 Cloudflare);`--auth bearer` 总是走 Cloudflare,`--auth password` 总是走 Pangolin。 | `--auth` | 给谁用 | 怎么进入 | 分享给别人 | 提供方 | |---|---|---|---|---| diff --git a/bin/omarchy-remote b/bin/omarchy-remote index 2317617..f1e786e 100755 --- a/bin/omarchy-remote +++ b/bin/omarchy-remote @@ -9,7 +9,7 @@ set -euo pipefail -VERSION="0.6.0" +VERSION="0.6.1" # ---- settings (override in ~/.config/omarchy-remote/config) ----------------- CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/omarchy-remote/config" @@ -341,7 +341,10 @@ cmd_expose() { elif [[ -n "$PUBLIC_VIA" ]]; then via="$PUBLIC_VIA" # Not configured: Cloudflare, unless only Pangolin is set up on this machine. elif [[ -r "$PG_ENV_FILE" && ! -r "$CF_ENV_FILE" ]]; then via=pangolin - else via=cloudflare; fi + else + via=cloudflare + [[ -r "$PG_ENV_FILE" ]] && info "Using Cloudflare (both providers are set up; pick one with --via pangolin|cloudflare or: omarchy-remote config set public )" + fi fi case "$via" in tailscale)