mirror of
https://github.com/ivabus/binhost
synced 2024-11-21 15:45:05 +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]
|
||||
name = "binhost"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/ivabus/binhost"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "runner"
|
||||
version = "0.1.0"
|
||||
version = "0.3.4"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
@ -12,7 +12,7 @@ numtoa = "0.2.4"
|
|||
[profile.release]
|
||||
strip = true
|
||||
opt-level = "s"
|
||||
lto = true
|
||||
lto = "fat"
|
||||
panic = "abort"
|
||||
codegen-units = 1
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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_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);
|
||||
|
||||
let mut buff_public_key = [0_u8; PUBKEY_LEN];
|
||||
let a = 0;
|
||||
read(
|
||||
open("public_key\0".as_bytes().as_ptr() as *const c_char, O_RDONLY),
|
||||
buff_public_key.as_mut_ptr() as *mut c_void,
|
||||
|
|
|
@ -221,6 +221,7 @@ async fn rocket() -> _ {
|
|||
}
|
||||
|
||||
let _ = &*BINS.read().await;
|
||||
let _ = &*MANIFEST;
|
||||
|
||||
let figment = Figment::from(rocket::Config::default())
|
||||
.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
|
||||
SHA256SUM=""
|
||||
SHASUMFLAGS=""
|
||||
PLATFORM="$(uname)"
|
||||
ARCH="$(uname -m)"
|
||||
if command -v sha256sum > /dev/null 2>&1; then
|
||||
SHA256SUM="sha256sum"
|
||||
SHASUMFLAGS="-c hashes --ignore-missing"
|
||||
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
|
||||
SHASUMVER=$(shasum -v | cut -c 1)
|
||||
if [ "$SHASUMVER" -ge 6 ]; then
|
||||
SHA256SUM="shasum -a 256"
|
||||
SHASUMFLAGS="-c hashes --ignore-missing"
|
||||
fi
|
||||
else
|
||||
fail "Could not find suitable sha256sum executable"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ SHA256SUM = "" ]; then
|
||||
fail "Could not find suitable sha256sum executable"
|
||||
fi
|
||||
|
||||
if [ "$(realpath "$SHA256SUM" 2> /dev/null)" = "/bin/busybox" ]; then
|
||||
fail "Busybox sha256sum detected, will not work. Refusing to continue"
|
||||
fi
|
||||
|
@ -47,8 +58,6 @@ DOWNLOAD_COMMAND="curl"
|
|||
OUTPUT_ARG="-o"
|
||||
DIR="/tmp/binhost-$NAME-$(date +%s)"
|
||||
FILE="$DIR/$NAME"
|
||||
PLATFORM="$(uname)"
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
if ! command -v curl > /dev/null 2>&1; then
|
||||
if ! command -v wget > /dev/null 2>&1; then
|
||||
|
@ -75,7 +84,7 @@ cd "$DIR"
|
|||
print ":: Downloading manifest"
|
||||
$DOWNLOAD_COMMAND $EXTERNAL_ADDRESS/runner/manifest $OUTPUT_ARG manifest
|
||||
|
||||
MANIFEST_HASHSUM=$($SHA256SUM manifest)
|
||||
MANIFEST_HASHSUM=$(cat manifest | $SHA256SUM)
|
||||
|
||||
if [ -n "$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"
|
||||
|
||||
if ! $SHA256SUM -c hashes --ignore-missing >&2 ; then
|
||||
if ! $SHA256SUM $SHASUMFLAGS >&2 ; then
|
||||
fail "Incorrect hashsum of runner"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue