diff --git a/.cirrus.yml b/.cirrus.yml index ae990bd..6d83d84 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,6 +3,10 @@ task: container: image: rust:slim-bookworm + setup_script: + - apt-get update -y + - apt-get install -y --fix-missing build-essential + build_script: - cargo build --release diff --git a/Cargo.lock b/Cargo.lock index a92d319..6d0ee8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,6 +491,16 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "bstr" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "btoi" version = "0.4.3" @@ -751,6 +761,12 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -1171,6 +1187,25 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "lua-src" +version = "546.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da0daa7eee611a4c30c8f5ee31af55266e26e573971ba9336d2993e2da129b2" +dependencies = [ + "cc", +] + +[[package]] +name = "luajit-src" +version = "210.5.4+c525bcb" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a10ab4ed12d22cb50ef43ece4f6c5ca594b2d2480019e87facfd422225a9908" +dependencies = [ + "cc", + "which", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -1182,9 +1217,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1223,6 +1258,32 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mlua" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069264935e816c85884b99e88c8b408d6d92e40ae8760f726c983526a53546b5" +dependencies = [ + "bstr", + "mlua-sys", + "num-traits", + "once_cell", + "rustc-hash", +] + +[[package]] +name = "mlua-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4655631a02e3739d014951291ecfa08db49c4da3f7f8c6f3931ed236af5dd78e" +dependencies = [ + "cc", + "cfg-if", + "lua-src", + "luajit-src", + "pkg-config", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -1500,6 +1561,12 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -1671,6 +1738,7 @@ dependencies = [ "futures-util", "handlebars", "log", + "mlua", "rand", "serde", "serde_json", @@ -2109,6 +2177,19 @@ dependencies = [ "web-sys", ] +[[package]] +name = "which" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 31c8027..1e730eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,3 +27,4 @@ env_logger = "0.10.1" futures-util = "0.3.30" clap = "3.1" webbrowser = "0.8.12" +mlua = { version = "0.9.4", features = ["vendored", "luajit52"] } diff --git a/Dockerfile b/Dockerfile index 6664ca1..42d52dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Use a Rust image to build the application FROM rust:slim-bookworm as builder +RUN apt-get update -y && \ + apt-get install -y --fix-missing \ + build-essential + # Copy your manifests COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.lock ./Cargo.lock @@ -12,6 +16,7 @@ RUN rm src/*.rs # Copy Deps COPY ./src ./src +COPY ./client ./client RUN touch ./src/main.rs RUN touch ./src/lib.rs diff --git a/client/choose_bot.html b/client/choose_bot.html new file mode 100644 index 0000000..44e0a97 --- /dev/null +++ b/client/choose_bot.html @@ -0,0 +1,39 @@ + + + + + +
+