mirror of
https://github.com/ivabus/binhost
synced 2024-11-21 23:45:06 +03:00
0.3.4: bump release version
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
parent
d501843f06
commit
33a0228c9c
5 changed files with 20 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "binhost"
|
name = "binhost"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/ivabus/binhost"
|
repository = "https://github.com/ivabus/binhost"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "runner"
|
name = "runner"
|
||||||
version = "0.1.0"
|
version = "0.3.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -12,7 +12,7 @@ numtoa = "0.2.4"
|
||||||
[profile.release]
|
[profile.release]
|
||||||
strip = true
|
strip = true
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
lto = true
|
lto = "fat"
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
// "Runner" is written in no_std Rust for the smaller executable size: ~49KiB (Darwin arm64) vs ~300KiB
|
// "Runner" is written in no_std Rust for the smaller executable size: ~49KiB (Darwin arm64)
|
||||||
|
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
@ -19,7 +19,6 @@ pub unsafe extern "C" fn main(_argc: i32, _argv: *const *const c_char) -> i32 {
|
||||||
printf("Starting runner\n\0".as_bytes().as_ptr() as *const c_char);
|
printf("Starting runner\n\0".as_bytes().as_ptr() as *const c_char);
|
||||||
|
|
||||||
let mut buff_public_key = [0_u8; PUBKEY_LEN];
|
let mut buff_public_key = [0_u8; PUBKEY_LEN];
|
||||||
let a = 0;
|
|
||||||
read(
|
read(
|
||||||
open("public_key\0".as_bytes().as_ptr() as *const c_char, O_RDONLY),
|
open("public_key\0".as_bytes().as_ptr() as *const c_char, O_RDONLY),
|
||||||
buff_public_key.as_mut_ptr() as *mut c_void,
|
buff_public_key.as_mut_ptr() as *mut c_void,
|
||||||
|
|
|
@ -221,6 +221,7 @@ async fn rocket() -> _ {
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = &*BINS.read().await;
|
let _ = &*BINS.read().await;
|
||||||
|
let _ = &*MANIFEST;
|
||||||
|
|
||||||
let figment = Figment::from(rocket::Config::default())
|
let figment = Figment::from(rocket::Config::default())
|
||||||
.merge(("ident", "Binhost"))
|
.merge(("ident", "Binhost"))
|
||||||
|
|
21
web.sh
21
web.sh
|
@ -23,19 +23,30 @@ requireCommands uname cut dd chmod rm realpath expr
|
||||||
|
|
||||||
# Finding alternative, but supported sha256sums
|
# Finding alternative, but supported sha256sums
|
||||||
SHA256SUM=""
|
SHA256SUM=""
|
||||||
|
SHASUMFLAGS=""
|
||||||
|
PLATFORM="$(uname)"
|
||||||
|
ARCH="$(uname -m)"
|
||||||
if command -v sha256sum > /dev/null 2>&1; then
|
if command -v sha256sum > /dev/null 2>&1; then
|
||||||
SHA256SUM="sha256sum"
|
SHA256SUM="sha256sum"
|
||||||
|
SHASUMFLAGS="-c hashes --ignore-missing"
|
||||||
else
|
else
|
||||||
|
if command -v sha256 > /dev/null 2>&1; then
|
||||||
|
SHA256SUM="sha256"
|
||||||
|
SHASUMFLAGS="-C hashes runner-$PLATFORM-$ARCH"
|
||||||
|
fi
|
||||||
if command -v shasum > /dev/null 2>&1; then
|
if command -v shasum > /dev/null 2>&1; then
|
||||||
SHASUMVER=$(shasum -v | cut -c 1)
|
SHASUMVER=$(shasum -v | cut -c 1)
|
||||||
if [ "$SHASUMVER" -ge 6 ]; then
|
if [ "$SHASUMVER" -ge 6 ]; then
|
||||||
SHA256SUM="shasum -a 256"
|
SHA256SUM="shasum -a 256"
|
||||||
|
SHASUMFLAGS="-c hashes --ignore-missing"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
fail "Could not find suitable sha256sum executable"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ SHA256SUM = "" ]; then
|
||||||
|
fail "Could not find suitable sha256sum executable"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(realpath "$SHA256SUM" 2> /dev/null)" = "/bin/busybox" ]; then
|
if [ "$(realpath "$SHA256SUM" 2> /dev/null)" = "/bin/busybox" ]; then
|
||||||
fail "Busybox sha256sum detected, will not work. Refusing to continue"
|
fail "Busybox sha256sum detected, will not work. Refusing to continue"
|
||||||
fi
|
fi
|
||||||
|
@ -47,8 +58,6 @@ DOWNLOAD_COMMAND="curl"
|
||||||
OUTPUT_ARG="-o"
|
OUTPUT_ARG="-o"
|
||||||
DIR="/tmp/binhost-$NAME-$(date +%s)"
|
DIR="/tmp/binhost-$NAME-$(date +%s)"
|
||||||
FILE="$DIR/$NAME"
|
FILE="$DIR/$NAME"
|
||||||
PLATFORM="$(uname)"
|
|
||||||
ARCH="$(uname -m)"
|
|
||||||
|
|
||||||
if ! command -v curl > /dev/null 2>&1; then
|
if ! command -v curl > /dev/null 2>&1; then
|
||||||
if ! command -v wget > /dev/null 2>&1; then
|
if ! command -v wget > /dev/null 2>&1; then
|
||||||
|
@ -75,7 +84,7 @@ cd "$DIR"
|
||||||
print ":: Downloading manifest"
|
print ":: Downloading manifest"
|
||||||
$DOWNLOAD_COMMAND $EXTERNAL_ADDRESS/runner/manifest $OUTPUT_ARG manifest
|
$DOWNLOAD_COMMAND $EXTERNAL_ADDRESS/runner/manifest $OUTPUT_ARG manifest
|
||||||
|
|
||||||
MANIFEST_HASHSUM=$($SHA256SUM manifest)
|
MANIFEST_HASHSUM=$(cat manifest | $SHA256SUM)
|
||||||
|
|
||||||
if [ -n "$KEY" ]; then
|
if [ -n "$KEY" ]; then
|
||||||
if [ ! "$KEY" = "$(echo "$MANIFEST_HASHSUM" | cut -c 1-${#KEY})" ]; then
|
if [ ! "$KEY" = "$(echo "$MANIFEST_HASHSUM" | cut -c 1-${#KEY})" ]; then
|
||||||
|
@ -95,7 +104,7 @@ print ":: Downloading runner"
|
||||||
|
|
||||||
$DOWNLOAD_COMMAND "$EXTERNAL_ADDRESS/runner/runner-$PLATFORM-$ARCH" $OUTPUT_ARG "runner-$PLATFORM-$ARCH"
|
$DOWNLOAD_COMMAND "$EXTERNAL_ADDRESS/runner/runner-$PLATFORM-$ARCH" $OUTPUT_ARG "runner-$PLATFORM-$ARCH"
|
||||||
|
|
||||||
if ! $SHA256SUM -c hashes --ignore-missing >&2 ; then
|
if ! $SHA256SUM $SHASUMFLAGS >&2 ; then
|
||||||
fail "Incorrect hashsum of runner"
|
fail "Incorrect hashsum of runner"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue