Default installer to full Docker setup

This commit is contained in:
2026-10-09 21:50:22 +01:00
parent f700d1beb2
commit a3e4d7817a
5 changed files with 33 additions and 23 deletions
+4 -5
View File
@@ -5,16 +5,15 @@ server reuse your OpenCode login; Docker ntfy handles phone notifications.
## Install ## Install
Interactive installation offers a full **Docker server + ntfy** setup (default) `./install.sh` defaults to full **Docker server + ntfy** setup; use `--native` for
or **native binaries only**. Docker mode needs Docker Compose and Python 3; native native binaries only. Docker mode needs Docker Compose and Python 3; native
mode needs Go 1.27+ and uses your existing OpenCode for model stages. mode needs Go 1.27+ and uses your existing OpenCode for model stages.
```sh ```sh
git clone https://git.a-wan.net/alan/pipelines.git git clone https://git.a-wan.net/alan/pipelines.git
cd pipelines cd pipelines
./install.sh --native # host CLI/TUI/server + shared OpenCode skill ./install.sh # configure/start Docker services and connect a provider
pipelines help # Optional host CLI/TUI binaries: ./install.sh --native
# Or: ./install.sh --docker # configure/start both services and connect a provider
``` ```
Go uses `GOBIN` or its normal `GOPATH/bin` default; put that directory on PATH. Go uses `GOBIN` or its normal `GOPATH/bin` default; put that directory on PATH.
+1 -1
View File
@@ -2,7 +2,7 @@
## Complete installer (recommended for both services in Docker) ## Complete installer (recommended for both services in Docker)
Run `./install.sh --docker` from an interactive terminal. It handles Compose Run `./install.sh` from an interactive terminal (Docker is the default). It handles Compose
configuration, ntfy users/permissions/token, image build, container skill install, configuration, ntfy users/permissions/token, image build, container skill install,
first-time container OpenCode provider login, startup, and an authenticated test first-time container OpenCode provider login, startup, and an authenticated test
notification. Choose your own provider in OpenCode; signup/login credentials stay notification. Choose your own provider in OpenCode; signup/login credentials stay
+7 -6
View File
@@ -1,7 +1,7 @@
# Installation # Installation
The interactive installer offers **Docker server + ntfy** (default) or **native `./install.sh` sets up **Docker server + ntfy** by default. Use `--native` for
binaries only**. Native installation requires Go; Docker setup requires Docker native binaries only. Native installation requires Go; Docker setup requires Docker
Compose and Python 3, and includes OpenCode in the persistent server container. Compose and Python 3, and includes OpenCode in the persistent server container.
```sh ```sh
@@ -26,18 +26,19 @@ the publishing/phone accounts and publishing token, builds the server, installs
the skill inside the container, and opens **container OpenCode provider login** the skill inside the container, and opens **container OpenCode provider login**
on first setup. Choose any supported provider; signup is handled by that provider. on first setup. Choose any supported provider; signup is handled by that provider.
Provider credentials remain in the `opencode-home` volume. Reinstalls skip login Provider credentials remain in the `opencode-home` volume. Reinstalls skip login
after completed setup; `./install.sh --docker --relogin` opens it again without after completed setup; `./install.sh --relogin` opens it again without
deleting accounts. The installer then starts/recreates the Compose services, deleting accounts. The installer then starts/recreates the Compose services,
checks ntfy health through Pipelines, and sends an authenticated test notification. checks ntfy health through Pipelines, and sends an authenticated test notification.
It does not register an OS service, delete volumes, or seed pipeline definitions. It does not register an OS service, delete volumes, or seed pipeline definitions.
Phone reception/model inference are not verified by installation. Phone reception/model inference are not verified by installation.
For fresh configuration you can supply `--ntfy-url https://ntfy.example.com For fresh configuration you can supply `--ntfy-url https://ntfy.example.com
--bind-address 127.0.0.1 --timezone Europe/London --port 8081` after `--docker`. --bind-address 127.0.0.1 --timezone Europe/London --port 8081` directly to `./install.sh`.
Use a LAN/VPN interface IP instead of loopback for direct phone access; only use Use a LAN/VPN interface IP instead of loopback for direct phone access; only use
plain HTTP on a trusted network. Existing `.env` settings are never silently plain HTTP on a trusted network. Existing `.env` settings are never silently
replaced. Without a terminal, no-argument installation remains binary-only and replaced. Docker is also the default without a terminal; setup fails rather than
prints that limitation; use an interactive terminal for first Docker/provider setup. silently falling back to native binaries if required setup input is unavailable.
Use an interactive terminal for first Docker/provider setup.
Install native mode as well if you want host CLI/TUI binaries; Docker mode installs Install native mode as well if you want host CLI/TUI binaries; Docker mode installs
the server and CLI in its image. See [Docker setup](docker.md). the server and CLI in its image. See [Docker setup](docker.md).
+2 -8
View File
@@ -1,12 +1,7 @@
#!/bin/sh #!/bin/sh
set -eu set -eu
cd "$(dirname "$0")" cd "$(dirname "$0")"
mode=${1:-} mode=${1:---docker}
if [ -z "$mode" ] && [ -t 0 ]; then
printf 'Install Docker server + ntfy, or native binaries only? [docker/native] (docker): '
read -r mode
mode=${mode:-docker}
fi
case "$mode" in case "$mode" in
--docker|docker) --docker|docker)
if [ "$#" -gt 0 ]; then shift; fi if [ "$#" -gt 0 ]; then shift; fi
@@ -15,8 +10,7 @@ case "$mode" in
--native|native) --native|native)
if [ "$#" -gt 0 ]; then shift; fi if [ "$#" -gt 0 ]; then shift; fi
;; ;;
'') echo 'Non-interactive binary-only install. Use ./install.sh --docker for the configured server + ntfy.' >&2 ;; *) exec python3 scripts/setup-docker.py "$@" ;;
*) echo 'Usage: ./install.sh [--native | --docker [setup options]] (native honors GOBIN and GOPATH)' >&2; exit 2 ;;
esac esac
if [ "$#" -ne 0 ]; then if [ "$#" -ne 0 ]; then
echo 'Usage: ./install.sh --native (honors GOBIN and GOPATH)' >&2 echo 'Usage: ./install.sh --native (honors GOBIN and GOPATH)' >&2
+19 -3
View File
@@ -13,7 +13,23 @@ class InstallationTests(unittest.TestCase):
self.assertIn("--ntfy-url",result.stdout) self.assertIn("--ntfy-url",result.stdout)
self.assertIn("--relogin",result.stdout) self.assertIn("--relogin",result.stdout)
def test_standard_installer_needs_only_go_and_honors_gobin(self): def test_default_installer_delegates_to_docker_without_terminal(self):
with tempfile.TemporaryDirectory() as directory:
root=Path(directory)
capture=root/"args"
executable=root/"python3"
executable.write_text('#!/bin/sh\nprintf "%s\\n" "$@" > "'+str(capture)+'"\n')
executable.chmod(0o700)
env=dict(os.environ,PATH=str(root)+os.pathsep+os.environ["PATH"])
subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh")],env=env,stdin=subprocess.DEVNULL,check=True)
self.assertEqual(capture.read_text().splitlines(),["scripts/setup-docker.py"])
def test_default_installer_forwards_docker_options(self):
result=subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh"),"--help"],capture_output=True,text=True)
self.assertEqual(result.returncode,0)
self.assertIn("--ntfy-url",result.stdout)
def test_native_installer_needs_only_go_and_honors_gobin(self):
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory:
root=Path(directory) root=Path(directory)
capture=root/"args" capture=root/"args"
@@ -21,14 +37,14 @@ class InstallationTests(unittest.TestCase):
executable.write_text('#!/bin/sh\nprintf "%s\\n" "$GOBIN" "$@" >> "'+str(capture)+'"\n') executable.write_text('#!/bin/sh\nprintf "%s\\n" "$GOBIN" "$@" >> "'+str(capture)+'"\n')
executable.chmod(0o700) executable.chmod(0o700)
env=dict(os.environ,PATH=str(root)+os.pathsep+os.environ["PATH"],GOBIN=str(root/"bin")) env=dict(os.environ,PATH=str(root)+os.pathsep+os.environ["PATH"],GOBIN=str(root/"bin"))
subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh")],env=env,check=True) subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh"),"--native"],env=env,check=True)
self.assertEqual(capture.read_text().splitlines(),[str(root/"bin"),"install","-trimpath","./cmd/...",str(root/"bin"),"run","./cmd/pipelines","skill","install"]) self.assertEqual(capture.read_text().splitlines(),[str(root/"bin"),"install","-trimpath","./cmd/...",str(root/"bin"),"run","./cmd/pipelines","skill","install"])
self.assertFalse((root/"bin").exists()) self.assertFalse((root/"bin").exists())
def test_standard_installer_rejects_legacy_provisioning_flags(self): def test_standard_installer_rejects_legacy_provisioning_flags(self):
result=subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh"),"--system-command"],capture_output=True,text=True) result=subprocess.run([str(Path(__file__).resolve().parents[1]/"install.sh"),"--system-command"],capture_output=True,text=True)
self.assertEqual(result.returncode,2) self.assertEqual(result.returncode,2)
self.assertIn("GOBIN",result.stderr) self.assertIn("unrecognized arguments",result.stderr)
def test_legacy_management_requires_owned_marker(self): def test_legacy_management_requires_owned_marker(self):
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory: