You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5149f7d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(installer): vendor CLI installs with CONFIG_URL (#225)
* fix(installer): put vendor CLIs on the PATH, and propagate command failures
With CONFIG_URL, install_config now runs config:install with --force and,
if the directory of the installed upsun is writable, --bin-dir set to it.
Root installs (e.g. in CI) put the vendor executable in /usr/bin next to
upsun, instead of ~/.platform-alt/bin, which is not on the PATH. An
existing executable with the same name (e.g. from a previous installer)
no longer stops the install; if another one comes first in the PATH, a
warning names it.
The outro names the vendor executable, read from config:install's output,
with its full path if it is not found on the PATH.
call_user returned the status of indent, so a failed command was never
retried with sudo, e.g. moving the binary to /usr/bin as a non-root user.
It now returns the command's status. The raw method installs in
~/.local/bin if the default directory is not writable and sudo is not
available.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(installer): test CONFIG_URL installs in containers
scripts/test/installer-config.sh serves a local build and the test config,
and runs installer.sh with CONFIG_URL in Debian and Alpine containers:
apt, apk and raw installs as root, raw installs as a non-root user with
and without sudo, and an install over an existing executable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(installer): share root installs of vendor CLIs with other users
As root, when the vendor executable goes in a system directory such as
/usr/bin, its configuration was saved in root's home directory, which
other users usually cannot read. The installer now passes
--config-dir /etc/platform-alt in that case, e.g. for a Dockerfile that
installs as root and then switches to another user.
Config auto-updates are skipped when the config's directory is not
writable, so other users do not get an error for a config that only root
can update.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(installer): handle symlinked bin directories and restrictive umasks
config:install rejects a symlink as --bin-dir, so a symlinked INSTALL_DIR
made the install fail. The directory is now resolved first, and paths are
compared by file rather than by name.
With a umask such as 077, a shared root install created files that other
users could not read or run. The umask is set to 022 for that install,
and /etc/platform-alt is made readable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(config): keep a config file's mode when updating it
Config updates wrote a new file with mode 0644 filtered by the umask, and
renamed it over the old one. Under a restrictive umask, a shared config
(e.g. in /etc/platform-alt, updated by root) became unreadable to other
users. Updates now keep the existing file's mode, and alt files are
written with their mode regardless of the umask.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(installer): put shared vendor configs in /etc/upsun/platform-alt
The directory is named after the package that writes it, leaving
/etc/upsun for other system-wide settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: address review of vendor CLI installs
- config:install shortened paths that only share a string prefix with the
home directory, e.g. "~usr/bin" for HOME=/. It now requires a path
separator after the home directory.
- The raw method's fallback to ~/.local/bin no longer applies to a
directory in the home directory that does not exist yet, e.g.
~/.global/bin.
- The README says the executable is not put next to upsun with Homebrew.
- The container tests fail when the installer fails, rather than taking
tee's status, and use the Docker host's architecture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,9 @@ The installer is configurable using the following environment variables:
40
40
*`INSTALL_METHOD` - force a specific installation method, possible values are `brew` and `raw`
41
41
*`INSTALL_DIR` - the installation directory for the `raw` installation method, for example you can use `INSTALL_DIR=$HOME/.local/bin` for a single user installation
42
42
*`VERSION` - the version of the CLI to install, if you need a version other than the latest one
43
-
*`CONFIG_URL` - the URL of an alternative CLI configuration, installed after the CLI with `upsun config:install`
43
+
*`CONFIG_URL` - the URL of an alternative CLI configuration, installed after the CLI with `upsun config:install --force`. Its executable is put next to `upsun` if that directory is writable (except with Homebrew). As root, outside the home directory, the configuration is put in `/etc/upsun/platform-alt` so that other users can run it; only root updates it
44
+
45
+
The `raw` method installs in `/usr/bin` (`/usr/local/bin` on macOS), or in `~/.global/bin` or `~/.local/bin` if either is in the `PATH`. It uses `sudo` if needed, or `~/.local/bin` if `sudo` is not available.
44
46
45
47
Outside CI, the `raw` method also installs shell completion for the current user, without editing shell configuration files: bash completion in `~/.local/share/bash-completion/completions` (loaded by bash-completion 2), and fish completion in `~/.config/fish/completions` when available. For zsh users (by `$SHELL`), it installs `~/.local/share/upsun/completion.zsh` and prints the line to add to `~/.zshrc`.
0 commit comments