diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 3932c989..14bd41c1 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/setup-node@v4 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v4 - run: | npx -y prettier --check ./ # npx -y shellcheck ./.github/scripts/*.sh ./src/scripts/*.sh @@ -52,7 +52,7 @@ jobs: - image: valheim push: ${{ contains(github.event.pull_request.labels.*.name, 'canary') }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v4 # v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -91,20 +91,18 @@ jobs: "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" "ODIN_IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}" - - name: Finalization + - name: Publish Image Summary + if: matrix.push run: | - echo "Finalized" - if [ "${{ matrix.push }}" = "true" ]; then - { - echo "\`\`\`" - if [ "${{ matrix.image }}" = "odin" ]; then - echo "docker run ${{ steps.meta.outputs.tags }}" - else - echo "docker run --rm -it \\" - echo " -e PASSWORD=\"123abc\"" - echo " -e PUBLIC=\"1\" \\" - echo " ${{ steps.meta.outputs.tags }}" - fi - echo "\`\`\`" - } >> $GITHUB_STEP_SUMMARY - fi + { + echo "\`\`\`"; + if [ "${{ matrix.image }}" = "odin" ]; then + echo "docker run ${{ steps.meta.outputs.tags }}"; + else + echo "docker run --rm -it \\"; + echo " -e PASSWORD=\"123abc\" \\"; + echo " -e PUBLIC=\"1\" \\"; + echo " ${{ steps.meta.outputs.tags }}"; + fi; + echo "\`\`\`"; + } >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 12bad6e0..72a01a16 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -18,7 +18,7 @@ jobs: image: [odin, valheim] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v4 # v4 - name: Docker meta id: meta diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f94e570c..12b2a49b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,20 +15,17 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v4 # v4 with: fetch-depth: 0 token: ${{ secrets.GH_TOKEN }} - name: Setup | Rust | Nightly - uses: ATiltedTree/setup-rust@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rust-version: nightly + toolchain: nightly components: clippy rustfmt - - uses: davidB/rust-cargo-make@v1 - name: Install Cargo Make - - uses: actions/cache@v4 name: Cache Cargo Files with: @@ -38,7 +35,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - name: Build Release - run: cargo make -p production release + run: make release PROFILE=production - uses: vimtor/action-zip@v1 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 45706704..6ecd234b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,16 +19,13 @@ jobs: name: Build & Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@v4 # v4 - name: Setup | Rust | Nightly - uses: ATiltedTree/setup-rust@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rust-version: nightly + toolchain: nightly components: clippy rustfmt - - uses: davidB/rust-cargo-make@v1 - name: Install Cargo Make - - uses: actions/cache@v4 name: Cache Cargo Files with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e133978..1cae9bc8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,20 +1,41 @@ # Contributing -## Cargo Make +## Using Make -This package includes a make file for easy development. -You can get use the make file by installing cargo make via `cargo install cargo-make` +This package includes a `Makefile` for easy development setup and operations. Ensure you have `make` installed on your system, which is generally available by default on Unix-like operating systems (Linux, macOS). For Windows, you might need to install a tool like `GNU Make`. ### Commands -| Command | What it does | -| ------------------- | ------------------------------------------------------------------------------ | -| makers format | Formats the `http-server` and `odin` | -| makers clippy | Builds and runs clippy on `http-server` and `odin` | -| makers build | Builds the two projects | -| makers start:dev | Formats, Clippy, docker-compose build, and docker-compose up | -| makers docker:build | Runs docker-compose build for the file `docker-compose.dev.yml` | -| makers docker:up | Runs docker-compose up for `docker-compose.dev.yml` | -| makers access | Runs `docker-compose -f docker-compose.dev.yml exec --user steam valheim bash` | -| makers access:admin | Runs `docker-compose -f docker-compose.dev.yml exec valheim bash` | -| makers release | Builds a release binary for `odin` and `http-server` | +Below is a list of available `make` commands and their descriptions: + +| Command | What it does | +| -------------------- | ---------------------------------------------------------------------------------------------------------- | +| `make setup` | Prepares the development environment by creating `docker-compose.dev.yml` if it doesn't exist. | +| `make member_format` | Formats the code using `cargo fmt`. | +| `make member_clippy` | Runs clippy to check the Rust code. | +| `make docker-build` | Builds the Docker images using the development compose file. | +| `make docker-up` | Starts the Docker containers as defined in `docker-compose.dev.yml`. | +| `make docker-down` | Stops the Docker containers and removes them. | +| `make docker-push` | Pushes the Docker images to a Docker registry. | +| `make start` | Starts the development environment, including formatting, clippy checks, and Docker containers. | +| `make start-dev` | Stops any running containers, rebuilds them, and starts them up for development. | +| `make build-dev` | Formats code, runs clippy, and builds Docker images. | +| `make access` | Provides shell access to the `valheim` container as the `steam` user. | +| `make access-admin` | Provides shell access to the `valheim` container as the `root` user. | +| `make release` | Builds release binaries for the projects, intended for production environments (set `PROFILE=production`). | + +### Development Workflow + +To start working on the project, you can run the following command to set up your environment and bring up the development services: + +```bash +make start-dev +``` + +This command will ensure all code is formatted, clippy checks are passed, Docker images are built, and containers are running. If you want to build the project for production, remember to set the `PROFILE` environment variable: + +```bash +make release PROFILE=production +``` + +This ensures that the release binaries are built according to the production profile settings. diff --git a/Cargo.lock b/Cargo.lock index 5860f63f..1b3affc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -80,9 +80,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -114,15 +114,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -153,9 +153,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -174,9 +174,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -186,9 +186,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bzip2" @@ -219,12 +219,13 @@ checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -235,9 +236,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -245,7 +246,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -260,9 +261,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -270,21 +271,21 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", "proc-macro2", @@ -346,9 +347,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -380,9 +381,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -390,9 +391,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", @@ -404,9 +405,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", @@ -461,15 +462,15 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -622,9 +623,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -645,17 +646,17 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 2.1.0", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -664,9 +665,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "5.1.1" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73166c591e67fb4bf9bc04011b4e35f12e89fe8d676193aa263df065955a379" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -697,7 +698,7 @@ dependencies = [ "base64", "bytes", "headers-core", - "http", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -709,20 +710,20 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.12", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -750,9 +751,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -766,7 +778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite", ] @@ -804,7 +816,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -824,7 +836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", + "http 0.2.12", "hyper", "rustls", "tokio", @@ -833,9 +845,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -883,9 +895,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -915,24 +927,24 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -945,9 +957,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" @@ -967,9 +979,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "md5" @@ -979,9 +991,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1001,18 +1013,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1028,7 +1040,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 0.2.12", "httparse", "log", "memchr", @@ -1046,11 +1058,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -1165,9 +1183,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.6" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -1176,9 +1194,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.6" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -1186,9 +1204,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.6" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", @@ -1199,9 +1217,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.6" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -1210,18 +1228,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", @@ -1230,9 +1248,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1242,9 +1260,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "powerfmt" @@ -1260,18 +1278,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1317,9 +1335,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1329,9 +1347,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1340,15 +1358,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -1356,7 +1374,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -1372,6 +1390,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -1386,16 +1405,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1406,11 +1426,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1419,9 +1439,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", @@ -1450,9 +1470,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scoped-tls" @@ -1478,18 +1498,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", @@ -1498,9 +1518,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.112" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -1521,16 +1541,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.5.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -1538,9 +1559,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.5.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" dependencies = [ "darling", "proc-macro2", @@ -1615,18 +1636,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1643,9 +1664,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -1655,20 +1676,26 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.48" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sysinfo" -version = "0.30.5" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" +checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" dependencies = [ "cfg-if", "core-foundation-sys", @@ -1712,18 +1739,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -1732,12 +1759,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -1752,10 +1780,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -1776,9 +1805,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -1814,22 +1843,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" dependencies = [ "futures-util", "log", @@ -1885,14 +1903,14 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand", @@ -1937,9 +1955,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -1990,15 +2008,15 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" dependencies = [ "bytes", "futures-channel", "futures-util", "headers", - "http", + "http 0.2.12", "hyper", "log", "mime", @@ -2006,13 +2024,11 @@ dependencies = [ "multer", "percent-encoding", "pin-project", - "rustls-pemfile", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-stream", "tokio-tungstenite", "tokio-util", "tower-service", @@ -2027,9 +2043,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2037,9 +2053,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -2052,9 +2068,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2064,9 +2080,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2074,9 +2090,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -2087,15 +2103,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2103,21 +2119,20 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "which" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa5e0c10bf77f44aac573e498d1a82d5fbd5e91f6fc0a99e7be4b38e85e101c" +checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" dependencies = [ "either", "home", - "once_cell", "rustix", - "windows-sys 0.52.0", + "winsafe", ] [[package]] @@ -2149,7 +2164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2158,7 +2173,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2176,7 +2191,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2196,17 +2211,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2217,9 +2233,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2229,9 +2245,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2241,9 +2257,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2253,9 +2275,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2265,9 +2287,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2277,9 +2299,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2289,9 +2311,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -2303,6 +2325,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "xattr" version = "1.3.1" @@ -2355,9 +2383,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/Dockerfile.odin b/Dockerfile.odin index b0edd1c0..a52692ee 100644 --- a/Dockerfile.odin +++ b/Dockerfile.odin @@ -1,5 +1,5 @@ ARG DEBIAN_VERSION=12 -ARG RUST_VERSION=1.76 +ARG RUST_VERSION=1.77 # ------------------ # # -- Odin Planner -- # @@ -17,20 +17,6 @@ WORKDIR /data/odin COPY --from=planner /data/odin/recipe.json recipe.json RUN cargo chef cook --release --recipe-path recipe.json -# ---------------------------- # -# -- Odin Project Mangement -- # -# ---------------------------- # - -FROM rust:${RUST_VERSION} as cargo-make - -ARG CARGO_MAKE_VERSION=0.37.8 - -ADD https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VERSION}/cargo-make-v${CARGO_MAKE_VERSION}-x86_64-unknown-linux-gnu.zip /tmp/cargo-make.zip -RUN unzip /tmp/cargo-make.zip -d /tmp \ - && mv /tmp/cargo-make-v${CARGO_MAKE_VERSION}-x86_64-unknown-linux-gnu/cargo-make /usr/local/bin/cargo-make \ - && rm -rf /tmp/cargo-make* \ - && chmod +x /usr/local/bin/cargo-make - # ------------------ # # -- Odin Builder -- # @@ -41,8 +27,7 @@ COPY . . # Copy over the cached dependencies COPY --from=cacher /data/odin/target target COPY --from=cacher /usr/local/cargo/registry /usr/local/cargo/ -COPY --from=cargo-make /usr/local/bin/cargo-make /usr/local/cargo/bin -RUN /usr/local/cargo/bin/cargo make -p production release +RUN make release PROFILE=production # ------------------ # # -- Odin Runtime -- # diff --git a/Makefile b/Makefile index 59e61a53..24da1bc7 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,54 @@ -# Following this tutorial: https://markentier.tech/posts/2022/01/speedy-rust-builds-under-wsl2/ -# This makes developing on windows significantly easier for rust projects!! +# Makefile -SOURCE_DIR = $(PWD) -# `notdir` returns the part after the last `/` -# so if the source was "/some/nested/project", only "project" remains -BUILD_DIR = ~/tmp/$(notdir $(SOURCE_DIR)) +.PHONY: setup member_format member_clippy docker-build docker-up docker-down docker-push start start-dev build-dev access access-admin release-odin release-http-server release -wsl.build: wsl.sync - cd $(BUILD_DIR) && cargo build - rsync -av $(BUILD_DIR)/target/debug/ $(SOURCE_DIR)/target/debug/ \ - --exclude .git \ - --exclude target \ - --exclude .fingerprint \ - --exclude build \ - --exclude incremental \ - --exclude deps +setup: + @if [ ! -f "$$PWD/docker-compose.dev.yml" ]; then \ + echo "Creating docker-compose.dev.yml for development"; \ + cp "$$PWD/docker-compose.yml" "$$PWD/docker-compose.dev.yml"; \ + fi -wsl.run: wsl.sync - cd $(BUILD_DIR) && cargo run +lint: member_format + docker run --rm -v "$$PWD:/app" -w /app node:lts sh -c 'npx -y prettier --write .' -wsl.test: wsl.sync - cd $(BUILD_DIR) && cargo test +member_format: + cargo fmt -wsl.sync: - mkdir -p $(BUILD_DIR) - rsync -av $(SOURCE_DIR)/ $(BUILD_DIR)/ --exclude .git --exclude target --exclude tmp +member_clippy: + cargo clippy -wsl.clean: - rm -rf $(BUILD_DIR)/target +docker-build: setup + docker compose -f ./docker-compose.dev.yml build -wsl.clean-all: - rm -rf $(BUILD_DIR) +docker-up: setup + docker compose -f ./docker-compose.dev.yml up -wsl.clippy: wsl.sync - cd $(BUILD_DIR) && cargo clippy +docker-down: setup + docker compose -f ./docker-compose.dev.yml down -docker.build: - docker compose -f docker-compose.dev.yml build +docker-push: setup + docker compose -f ./docker-compose.dev.yml push -docker.up: - docker compose -f docker-compose.dev.yml up +start: member_format member_clippy docker-up -docker.build-up: - docker compose -f docker-compose.dev.yml up --build +start-dev: member_format member_clippy docker-down docker-build docker-up -docker.down: - docker compose -f docker-compose.dev.yml disown +build-dev: member_format member_clippy docker-build -docker.ssh: - docker compose -f docker-compose.dev.yml exec valheim gosu valheim bash \ No newline at end of file +access: + docker-compose -f ./docker-compose.dev.yml exec --user steam valheim bash + +access-admin: + docker-compose -f ./docker-compose.dev.yml exec valheim bash + +release-odin: +ifeq ($(PROFILE),production) + cargo build --release --bin odin +endif + +release-http-server: +ifeq ($(PROFILE),production) + cargo build --release --bin huginn +endif + +release: release-odin release-http-server diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index cae8219c..00000000 --- a/Makefile.toml +++ /dev/null @@ -1,91 +0,0 @@ -[tasks.setup] -workspace = false -script = ''' -if [ ! -f "$PWD/docker-compose.dev.yml" ]; then - echo "Creating docker-compose.dev.yml for development" - cp "$PWD/docker-compose.yml" "$PWD/docker-compose.dev.yml" -fi -''' - -# Format files -[tasks.member_format] -run_task = { name = "format", fork = true } - -# Run clippy -[tasks.member_clippy] -run_task = { name = "clippy", fork = true } - -# Build Docker -[tasks."docker:build"] -workspace = false -command = "docker" -args = ["compose", "-f", "./docker-compose.dev.yml", "build"] -dependencies = ["setup"] - -# Launch Docker -[tasks."docker:up"] -workspace = false -command = "docker" -args = ["compose", "-f", "./docker-compose.dev.yml", "up"] -dependencies = ["setup"] - -# Launch Docker -[tasks."docker:down"] -workspace = false -command = "docker" -args = ["compose", "-f", "./docker-compose.dev.yml", "down"] -dependencies = ["setup"] - -# Launch Docker -[tasks."docker:push"] -workspace = false -command = "docker" -args = ["compose", "-f", "./docker-compose.dev.yml", "push"] -dependencies = ["setup"] - -# Start Development Workflow -[tasks."start"] -workspace = false -dependencies = ["member_format", "member_clippy", "docker:up"] - -# Start Development Workflow -[tasks."start:dev"] -workspace = false -dependencies = ["member_format", "member_clippy", "docker:down", "docker:build", "docker:up"] - - -# Start Development Workflow -[tasks."build:dev"] -workspace = false -dependencies = ["member_format", "member_clippy", "docker:build"] - -# Access docker container as Steam (default) -[tasks.access] -workspace = false -command = "docker-compose" -args = ["-f", "./docker-compose.dev.yml", "exec", "--user", "steam", "valheim", "bash"] - -# Access docker container as root -[tasks."access:admin"] -workspace = false -command = "docker-compose" -args = ["-f", "./docker-compose.dev.yml", "exec", "valheim", "bash"] - -# Run odin release -[tasks.release-odin] -workspace = false -condition = { profiles = ["production"] } -command = "cargo" -args = ["build", "--release", "--bin", "odin"] - -# Run huginn release -[tasks.release-http-server] -workspace = false -condition = { profiles = ["production"] } -command = "cargo" -args = ["build", "--release", "--bin", "huginn"] - -[tasks.release] -workspace = false -condition = { profiles = ["production"] } -dependencies = ["release-odin", "release-http-server"] diff --git a/src/huginn/routes/metrics.rs b/src/huginn/routes/metrics.rs index 1b48e09e..85c9667a 100644 --- a/src/huginn/routes/metrics.rs +++ b/src/huginn/routes/metrics.rs @@ -8,7 +8,7 @@ pub fn invoke() -> String { version = &info.version, map = &info.map ); - let content = vec![ + let content = [ format!( "valheim_online{labels} {online}", labels = &labels, diff --git a/src/odin/files/mod.rs b/src/odin/files/mod.rs index 4cc13c1b..77d63a9b 100644 --- a/src/odin/files/mod.rs +++ b/src/odin/files/mod.rs @@ -1,11 +1,11 @@ pub mod config; pub mod discord; -use crate::executable::create_execution; +// use crate::executable::create_execution; use crate::utils::get_working_dir; use log::{debug, error, info}; use std::fs; -use std::fs::{create_dir_all, remove_file, File}; +use std::fs::{create_dir_all, File}; use std::io::Write; use std::path::Path; use std::process::exit; @@ -26,18 +26,18 @@ pub trait FileManager { fn exists(&self) -> bool { Path::new(self.path().as_str()).exists() } - fn remove(&self) -> bool { - match remove_file(self.path()) { - Ok(_) => { - info!("Successfully deleted {}", self.path()); - true - } - Err(_) => { - error!("Did not find or could not delete {}", self.path()); - false - } - } - } + // fn remove(&self) -> bool { + // match remove_file(self.path()) { + // Ok(_) => { + // info!("Successfully deleted {}", self.path()); + // true + // } + // Err(_) => { + // error!("Did not find or could not delete {}", self.path()); + // false + // } + // } + // } fn read(&self) -> String { if self.exists() { fs::read_to_string(self.path()).unwrap() @@ -60,18 +60,18 @@ pub trait FileManager { } } } - fn set_executable(&self) -> bool { - if let Ok(_output) = create_execution("chmod") - .args(["+x", self.path().as_str()]) - .output() - { - info!("Successfully set {} to executable", self.path()); - true - } else { - error!("Unable to set {} to executable", self.path()); - false - } - } + // fn set_executable(&self) -> bool { + // if let Ok(_output) = create_execution("chmod") + // .args(["+x", self.path().as_str()]) + // .output() + // { + // info!("Successfully set {} to executable", self.path()); + // true + // } else { + // error!("Unable to set {} to executable", self.path()); + // false + // } + // } } pub struct ManagedFile { diff --git a/src/odin/mods/bepinex.rs b/src/odin/mods/bepinex.rs index 41d43e04..594f2753 100644 --- a/src/odin/mods/bepinex.rs +++ b/src/odin/mods/bepinex.rs @@ -132,7 +132,7 @@ impl BepInExEnvironment { } } - pub fn launch(&self, command: &mut Command) -> std::io::Result { + pub fn launch(&self, mut command: Command) -> std::io::Result { info!("BepInEx found! Setting up Environment..."); command // DOORSTOP_ENABLE must not have quotes around it. diff --git a/src/odin/server/startup.rs b/src/odin/server/startup.rs index c196c5a5..f615a8a1 100644 --- a/src/odin/server/startup.rs +++ b/src/odin/server/startup.rs @@ -1,4 +1,5 @@ -use std::process::exit; +use std::fs::File; +use std::process::{exit, Command}; use std::{io, process::Child}; use daemonize::{Daemonize, Error}; @@ -19,10 +20,15 @@ use crate::{ type CommandResult = io::Result; +fn create_log_files() -> Result<(File, File), Error> { + let game_dir = game_directory(); + let stdout = create_file(format!("{}/logs/valheim_server.log", game_dir).as_str()); + let stderr = create_file(format!("{}/logs/valheim_server.err", game_dir).as_str()); + Ok((stdout, stderr)) +} pub fn start_daemonized(config: ValheimArguments) -> Result { debug!("Starting server daemonized..."); - let stdout = create_file(format!("{}/logs/valheim_server.log", game_directory()).as_str()); - let stderr = create_file(format!("{}/logs/valheim_server.err", game_directory()).as_str()); + let (stdout, stderr) = create_log_files().unwrap(); let command = start(config); Daemonize::new() .working_directory(game_directory()) @@ -45,65 +51,47 @@ pub fn start_daemonized(config: ValheimArguments) -> Result CommandResult { - let mut command = create_execution(&config.command); - - debug!("--------------------------------------------------------------------------------------------------------------"); - - let ld_library_path_value = environment::fetch_multiple_var( - constants::LD_LIBRARY_PATH_VAR, - format!("{}/linux64", game_directory()).as_str(), - ); +fn configure_server_options(command: &mut Command, config: &ValheimArguments) { debug!("Setting up base command"); - debug!("Launching With Args: \n{:#?}", &config); - // Sets the base command for the server - let base_command = command - .env( - "SteamAppId", - // See https://www.reddit.com/r/valheim/comments/yvyxo8/trouble_with_the_dedicated_server/ - String::from("892970"), // fetch_var("APPID", "896660") - ) - .current_dir(game_directory()); - // Sets the name of the server, (Can be set with ENV variable NAME) let name = fetch_var("NAME", &config.name); debug!("Setting name to: {}", &name); - base_command.arg("-name"); - base_command.arg(&name); + command.arg("-name"); + command.arg(&name); // Sets the port of the server, (Can be set with ENV variable PORT) let port = fetch_var("PORT", &config.port); debug!("Setting port to: {}", &port); - base_command.args(["-port", &port]); + command.args(["-port", &port]); // Sets the world of the server, (Can be set with ENV variable WORLD) let world = fetch_var("WORLD", &config.world); debug!("Setting world to: {}", &fetch_var("WORLD", &world)); - base_command.arg("-world"); - base_command.arg(&world); + command.arg("-world"); + command.arg(&world); // Determines if the server is public or not let public = fetch_var("PUBLIC", config.public.as_str()); debug!("Setting public to: {}", &public); - base_command.args(["-public", &public]); + command.args(["-public", &public]); // Sets the save interval in seconds if let Some(save_interval) = &config.save_interval { let interval = save_interval.to_string(); debug!("Setting save interval to: {}", &interval); - base_command.args(["-saveinterval", &interval]); + command.args(["-saveinterval", &interval]); }; // Add set_key to the command if let Some(set_key) = &config.set_key { debug!("Setting set_key to: {}", &set_key); - base_command.args(["-setkey", &set_key]); + command.args(["-setkey", &set_key]); }; // Add preset to the command if let Some(preset) = &config.preset { debug!("Setting preset to: {}", &preset); - base_command.args(["-preset", &preset]); + command.args(["-preset", &preset]); }; // Add modifiers to the command @@ -113,18 +101,17 @@ pub fn start(config: ValheimArguments) -> CommandResult { "Setting modifier to: {} {}", &modifier.name, &modifier.value ); - base_command.args(["-modifier", &modifier.name, &modifier.value]); + command.args(["-modifier", &modifier.name, &modifier.value]); }); }; // Extra args for the server - base_command.args({ + command.args({ format!( "-nographics -batchmode {}", fetch_var("SERVER_EXTRA_LAUNCH_ARGS", "") ) .trim() - .to_string() .split(' ') .collect::>() }); @@ -141,32 +128,54 @@ pub fn start(config: ValheimArguments) -> CommandResult { exit(1) } else { info!("Password found, adding password flag."); - base_command.arg("-password"); - base_command.arg(&config.password); + command.arg("-password"); + command.arg(&config.password); } if fetch_var("ENABLE_CROSSPLAY", "0").eq("1") { info!("Launching with Crossplay! <3"); - base_command.arg("-crossplay"); + command.arg("-crossplay"); } else { info!("No Crossplay Enabled!") } // Tack on save dir at the end. - base_command.args(["-savedir", &saves_directory()]); + command.args(["-savedir", &saves_directory()]); +} - debug!("Base Command: {:#?}", base_command); +pub fn start(config: ValheimArguments) -> CommandResult { + let mut command = create_execution(&config.command); + debug!("--------------------------------------------------------------------------------------------------------------"); + let (stdout, stderr) = create_log_files().unwrap(); + debug!("Launching With Args: \n{:#?}", &config); + let base_command = command + .env( + "SteamAppId", + // See https://www.reddit.com/r/valheim/comments/yvyxo8/trouble_with_the_dedicated_server/ + String::from("892970"), // fetch_var("APPID", "896660") + ) + .current_dir(game_directory()); + + base_command.stdout(stdout); + base_command.stderr(stderr); + debug!("Base Command: {:#?}", base_command); + configure_server_options(base_command, &config); debug!("Executable: {}", &config.command); info!("Launching Command..."); + let ld_library_path_value = environment::fetch_multiple_var( + constants::LD_LIBRARY_PATH_VAR, + format!("{}/linux64", game_directory()).as_str(), + ); + let bepinex_env = BepInExEnvironment::new(); if bepinex_env.is_installed() { info!("BepInEx detected! Switching to run with BepInEx..."); info!("BepInEx Environment: \n{:#?}", bepinex_env); - bepinex_env.launch(base_command) + bepinex_env.launch(command) } else { info!("Everything looks good! Running normally!"); - base_command + command .env(constants::LD_LIBRARY_PATH_VAR, ld_library_path_value) .spawn() } diff --git a/src/scripts/entrypoint.sh b/src/scripts/entrypoint.sh index d96def69..681fc897 100644 --- a/src/scripts/entrypoint.sh +++ b/src/scripts/entrypoint.sh @@ -69,7 +69,7 @@ setup_cron_env() { VALHEIM_PLUS_RELEASES_URL=\"${VALHEIM_PLUS_RELEASES_URL:-""}\" VALHEIM_PLUS_DOWNLOAD_URL=\"${VALHEIM_PLUS_DOWNLOAD_URL}\" - BEPINEX_RELEASES_URL=\"${BEPINEX_RELEASES_URL:-"https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/"}\" + BEPINEX_RELEASES_URL=\"${BEPINEX_RELEASES_URL:-"https://thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/"}\" BEPINEX_DOWNLOAD_URL=\"${BEPINEX_DOWNLOAD_URL}\" BEPINEX_FULL_RELEASES_URL=\"${BEPINEX_FULL_RELEASES_URL:-""}\"