Skip to content
Merged
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
36 changes: 35 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
- production
- testing
tags:
- 'v*'
pull_request:
branches:
- master
Expand Down Expand Up @@ -122,7 +124,11 @@ jobs:
else
SIMPLE_NAME="status-linux-x86_64"
fi
echo "name=${SIMPLE_NAME}-${BRANCH}-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "name=${SIMPLE_NAME}-${BRANCH}" >> $GITHUB_OUTPUT
else
echo "name=${SIMPLE_NAME}-${BRANCH}-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
fi
echo "binary=${SIMPLE_NAME}" >> $GITHUB_OUTPUT

- name: Rename binary
Expand All @@ -136,6 +142,34 @@ jobs:
path: ${{ steps.artifact.outputs.binary }}
retention-days: 30

create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build-release-binaries
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download musl binary artifact
uses: actions/download-artifact@v4
with:
pattern: status-linux-x86_64-musl-*
merge-multiple: true

- name: Prepare release assets
run: |
ls -la status-linux-x86_64-musl
chmod +x status-linux-x86_64-musl
sha256sum status-linux-x86_64-musl > status-linux-x86_64-musl.sha256

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
status-linux-x86_64-musl
status-linux-x86_64-musl.sha256

docker-build:
name: Docker Build & Push (branches/tags)
runs-on: ubuntu-latest
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.1.4 — 2026-03-13
### Added — CLI Improvements, Install Script & GitHub Releases

#### CI: GitHub Releases on Tags
- Added `v*` tag trigger to CI workflow
- New `create-release` job: downloads musl binary, generates SHA256 checksum, publishes GitHub Release via `softprops/action-gh-release@v2`
- Tag-triggered artifacts now use clean names without SHA suffix (e.g. `status-linux-x86_64-musl-v0.1.4`)

#### Install Script (`install.sh`)
- POSIX `sh` installer: `curl -sSfL .../install.sh | sh`
- Detects OS/arch (Linux x86_64 only initially)
- Queries GitHub API for latest release (no `jq` dependency)
- Supports `VERSION` env var to pin a specific version
- Supports `INSTALL_DIR` env var (default `/usr/local/bin`)
- Downloads musl binary, verifies SHA256 checksum, installs with `sudo` if needed

#### New CLI Subcommands (`src/main.rs`)
- `start <name>` — Start a stopped container (Docker)
- `health [name]` — Check container health for one or all containers (Docker)
- `logs <name> [-n lines]` — Fetch container logs with configurable line count (Docker)
- `metrics [--json]` — Print system metrics: CPU, memory, disk usage
- `update check` — Check for available updates against remote server
- `update apply [--version V]` — Download and verify an update
- `update rollback` — Rollback to the previous binary version

#### README
- Added "Quick Install" section with examples for latest install, version pinning, custom directory, and verification

## 2026-02-02
### Added - Container Exec & Server Resources Commands

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "status-panel"
version = "0.1.3"
version = "0.1.4"
edition = "2021"

[features]
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ Server stack health application with UI.</div>
<center><img width="1063" alt="Screen Shot 2019-05-21 at 12 45 11 PM" src="https://raw.githubusercontent.com/trydirect/status/testing/assets/screenshot.png"></center>


## Quick Install

Install the latest release (Linux x86_64):

```bash
curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
```

Pin a specific version:

```bash
VERSION=v0.1.4 curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
```

Custom install directory:

```bash
INSTALL_DIR=~/.local/bin curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
```

Verify installation:

```bash
status --version
```

## Build

```bash
Expand Down
143 changes: 143 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/bin/sh
# Status Panel installer
# Usage: curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
#
# Environment variables:
# VERSION - Pin a specific version (e.g. "v0.1.4"). Default: latest release.
# INSTALL_DIR - Installation directory. Default: /usr/local/bin

set -eu

REPO="trydirect/status"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"

main() {
detect_platform
resolve_version
download_binary
verify_checksum
install_binary
echo ""
echo "status ${VERSION} installed to ${INSTALL_DIR}/status"
echo "Run 'status --help' to get started."
}

detect_platform() {
OS="$(uname -s)"
ARCH="$(uname -m)"

case "$OS" in
Linux) ;;
*)
echo "Error: unsupported OS: $OS (only Linux is supported)" >&2
exit 1
;;
esac

case "$ARCH" in
x86_64|amd64) ARCH="x86_64" ;;
*)
echo "Error: unsupported architecture: $ARCH (only x86_64 is supported)" >&2
exit 1
;;
esac

ASSET_NAME="status-linux-${ARCH}-musl"
}

resolve_version() {
if [ -n "${VERSION:-}" ]; then
# Ensure version starts with 'v'
case "$VERSION" in
v*) ;;
*) VERSION="v${VERSION}" ;;
esac
return
fi

echo "Fetching latest release..."
VERSION=$(
curl -sSf "https://api.github.com/repos/${REPO}/releases/latest" \
| grep '"tag_name"' \
| sed -E 's/.*"tag_name"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/'
)

if [ -z "$VERSION" ]; then
echo "Error: could not determine latest version" >&2
exit 1
fi

echo "Latest version: ${VERSION}"
}

download_binary() {
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${ASSET_NAME}"
CHECKSUM_URL="https://github.com/${REPO}/releases/download/${VERSION}/${ASSET_NAME}.sha256"

TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT

echo "Downloading ${ASSET_NAME} ${VERSION}..."
curl -sSfL -o "${TMPDIR}/${ASSET_NAME}" "$DOWNLOAD_URL"

echo "Downloading checksum..."
curl -sSfL -o "${TMPDIR}/${ASSET_NAME}.sha256" "$CHECKSUM_URL" || {
echo "Warning: checksum file not available, skipping verification" >&2
SKIP_CHECKSUM=1
}
}

verify_checksum() {
if [ "${SKIP_CHECKSUM:-0}" = "1" ]; then
return
fi

echo "Verifying SHA256 checksum..."
cd "$TMPDIR"

if command -v sha256sum >/dev/null 2>&1; then
sha256sum -c "${ASSET_NAME}.sha256"
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 -c "${ASSET_NAME}.sha256"
else
echo "Warning: no sha256sum or shasum found, skipping verification" >&2
fi

cd - >/dev/null
}

install_binary() {
chmod +x "${TMPDIR}/${ASSET_NAME}"

# Ensure INSTALL_DIR exists
if [ ! -d "$INSTALL_DIR" ]; then
if mkdir -p "$INSTALL_DIR" 2>/dev/null; then
:
else
if command -v sudo >/dev/null 2>&1; then
echo "Creating installation directory ${INSTALL_DIR} with sudo..."
sudo mkdir -p "$INSTALL_DIR"
else
echo "Error: installation directory ${INSTALL_DIR} does not exist and could not be created without sudo." >&2
echo "Please create it manually or set INSTALL_DIR to a writable directory you own." >&2
exit 1
fi
fi
fi

# Use sudo if we can't write to INSTALL_DIR
if [ -w "$INSTALL_DIR" ]; then
mv "${TMPDIR}/${ASSET_NAME}" "${INSTALL_DIR}/status"
else
if command -v sudo >/dev/null 2>&1; then
echo "Elevated permissions required to install to ${INSTALL_DIR}"
sudo mv "${TMPDIR}/${ASSET_NAME}" "${INSTALL_DIR}/status"
else
echo "Error: cannot write to ${INSTALL_DIR} and sudo is not available." >&2
echo "Please install manually or choose a different INSTALL_DIR." >&2
exit 1
fi
fi
}

main
4 changes: 2 additions & 2 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub mod validator;
pub mod version_check;

pub use deploy::{
backup_current_binary, deploy_temp_binary, record_rollback, restart_service, rollback_latest,
RollbackEntry, RollbackManifest,
backup_current_binary, deploy_temp_binary, load_manifest, record_rollback, restart_service,
rollback_latest, RollbackEntry, RollbackManifest,
};
pub use docker_executor::execute_docker_operation;
pub use docker_ops::DockerOperation;
Expand Down
Loading
Loading