Implement CLI configuration and runtime management
This commit is contained in:
1 parent
2ac0afa691
commit
3edea4bdff
14 files changed
+1362
-53
No files matched your search
Regular → Executable
+13
-7
@@ -1,10 +1,16 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
echo "Building WASM..."
|
||||
cd ../wasm
|
||||
wasm-pack build --target web
|
||||
mv pkg ../frontend/pkg
|
||||
cd "$ROOT/wasm"
|
||||
wasm-pack build --target web --release
|
||||
rm -rf "$ROOT/frontend/pkg"
|
||||
mv pkg "$ROOT/frontend/pkg"
|
||||
|
||||
echo "Building server..."
|
||||
cd ../server
|
||||
cargo build --release
|
||||
echo "Done."
|
||||
cd "$ROOT"
|
||||
cargo build -p chronoseal-server --bin chronoseal --release
|
||||
|
||||
echo "Done."
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
CHRONOSEAL_VERSION="${CHRONOSEAL_VERSION:-latest}"
|
||||
CHRONOSEAL_INSTALL_DIR="${CHRONOSEAL_INSTALL_DIR:-/usr/local/bin}"
|
||||
CHRONOSEAL_BASE_URL="${CHRONOSEAL_BASE_URL:-https://get.chronoseal.rs/releases}"
|
||||
|
||||
need() {
|
||||
command -v "$1" >/dev/null 2>&1 || {
|
||||
echo "chronoseal installer: missing required command: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
need uname
|
||||
need mktemp
|
||||
need chmod
|
||||
|
||||
arch="$(uname -m)"
|
||||
case "$arch" in
|
||||
x86_64|amd64) target="x86_64-unknown-linux-musl" ;;
|
||||
aarch64|arm64) target="aarch64-unknown-linux-musl" ;;
|
||||
*) echo "chronoseal installer: unsupported architecture: $arch" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
fetch="curl --proto =https --tlsv1.2 -fsSL"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
fetch="wget -qO-"
|
||||
else
|
||||
echo "chronoseal installer: install curl or wget" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tmp="$(mktemp -d)"
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
|
||||
url="$CHRONOSEAL_BASE_URL/$CHRONOSEAL_VERSION/chronoseal-$target.tar.gz"
|
||||
echo "downloading chronoseal $CHRONOSEAL_VERSION for $target"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
$fetch "$url" | tar -xz -C "$tmp"
|
||||
chmod 0755 "$tmp/chronoseal"
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
install -m 0755 "$tmp/chronoseal" "$CHRONOSEAL_INSTALL_DIR/chronoseal"
|
||||
else
|
||||
sudo install -m 0755 "$tmp/chronoseal" "$CHRONOSEAL_INSTALL_DIR/chronoseal"
|
||||
fi
|
||||
|
||||
echo "installed: $CHRONOSEAL_INSTALL_DIR/chronoseal"
|
||||
echo "try: chronoseal --help"
|
||||
Regular → Executable
+10
-3
@@ -1,5 +1,12 @@
|
||||
#!/bin/bash
|
||||
bash build.sh
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
"$ROOT/scripts/build.sh"
|
||||
|
||||
echo "Release artifacts:"
|
||||
echo " - server/target/release/antibot-server"
|
||||
echo " - frontend/ (including pkg/)"
|
||||
echo " - target/release/chronoseal"
|
||||
echo " - frontend/ (including pkg/)"
|
||||
echo " - chronoseal.service"
|
||||
echo " - scripts/install.sh"
|
||||
Reference in new issue
Block a user