Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ workflow refuses a tag whose version has no entry here.

## [Unreleased]

### Changed

- **`urbex-op`'s default workspace is `~/urbex-work`**, as in the docs
and the Claude Code plugin (it was `~/urbex-workspace`). A workspace
in `~/urbex-workspace` is still found when `~/urbex-work` doesn't
exist; `-w` and `URBEX_WORKSPACE` choose any other.

## [0.1.0] - 2026-11-17

The first preview release: urbex as binaries for Linux and macOS (amd64,
Expand Down
2 changes: 1 addition & 1 deletion tools/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ See *Find every endpoint* in the cookbook

| Variable | Default | Meaning |
|---|---|---|
| `URBEX_WORKSPACE` | `~/urbex-workspace` | The workspace, if `-w` isn't given. |
| `URBEX_WORKSPACE` | `~/urbex-work` (`~/urbex-workspace`, urbex 0.1's default, if only that exists) | The workspace, if `-w` isn't given. |
| `URBEX_OPERATOR_IMAGE` | a release's `urbex-op`: `ghcr.io/urbforge/urbex-op:<its version>`; from a checkout: `urbex-operator` | The image runs use (and `build` creates). |
| `URBEX_PROXMOX_TOKEN`, `URBEX_CLOUDFLARE_TOKEN`, `URBEX_AGE_KEY` | - | Passed to the container when set; otherwise the credentials file is used. |

Expand Down
21 changes: 21 additions & 0 deletions tools/operator/test-urbex-op.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,25 @@ check "docker: a bare name, missing, is never pulled" docker urbex-operator none
check "docker: a bare name, present, is run" docker urbex-operator urbex-operator local
check "docker: a published image, missing, is pulled" docker $published none pull

# The default workspace: ~/urbex-work, or ~/urbex-workspace (urbex 0.1's
# default) when only that one exists (urbforge/urbex#57).
default_ws() { # default_ws NAME WANT [DIR...]: the workspace urbex-op picks with these dirs in HOME
local name=$1 want=$2 home=$tmp/home-$RANDOM bin
shift 2
mkdir -p "$home"
for d in "$@"; do mkdir -p "$home/$d/home"; done
bin=$(fake podman localhost/urbex-operator)
: >"$tmp/calls"
PATH=$bin:$tools HOME=$home URBEX_OPERATOR_IMAGE=localhost/urbex-operator "$here/urbex-op" true >"$tmp/out" 2>&1
if grep -q -- "-v $home/$want:/work" "$tmp/calls" || grep -q "no workspace at $home/$want" "$tmp/out"; then
echo "ok $name"
else
echo "FAIL $name: want ~/$want"; sed 's/^/ /' "$tmp/out" "$tmp/calls"; fails=$((fails + 1))
fi
}
default_ws "default workspace: ~/urbex-work" urbex-work urbex-work
default_ws "default workspace: ~/urbex-workspace when only it exists" urbex-workspace urbex-workspace
default_ws "default workspace: ~/urbex-work when both exist" urbex-work urbex-work urbex-workspace
default_ws "default workspace: ~/urbex-work when none exists" urbex-work

[ $fails -eq 0 ] || { echo "$fails failed"; exit 1; }
11 changes: 9 additions & 2 deletions tools/operator/urbex-op
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# urbex-op [-w DIR] shell a shell in the container, ready to run urbex
# urbex-op [-w DIR] 'COMMANDS' run COMMANDS (bash) in the container
#
# DIR defaults to $URBEX_WORKSPACE, then ~/urbex-workspace. Tokens come from
# DIR defaults to $URBEX_WORKSPACE, then ~/urbex-work (~/urbex-workspace,
# urbex 0.1's default, if only that one exists). Tokens come from
# the environment if set (URBEX_PROXMOX_TOKEN, URBEX_CLOUDFLARE_TOKEN), else
# from the workspace's credentials file - 'set proxmoxToken' puts them there.
#
Expand All @@ -21,7 +22,13 @@ set -euo pipefail
# The release workflow sets this in the copy attached to a release.
URBEX_OP_VERSION=dev

WS=${URBEX_WORKSPACE:-$HOME/urbex-workspace}
if [ -n "${URBEX_WORKSPACE:-}" ]; then
WS=$URBEX_WORKSPACE
elif [ ! -d "$HOME/urbex-work" ] && [ -d "$HOME/urbex-workspace/home" ]; then
WS=$HOME/urbex-workspace
else
WS=$HOME/urbex-work
fi
if [ "${1:-}" = "-w" ]; then WS=$2; shift 2; fi
if [ "$URBEX_OP_VERSION" = dev ]; then
IMAGE=${URBEX_OPERATOR_IMAGE:-urbex-operator}
Expand Down
Loading