diff --git a/.gitmodules b/.gitmodules index a6ea22fc..67f142d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,7 +10,9 @@ [submodule "thirdparty/libbcrypt"] path = thirdparty/libbcrypt url = https://github.com/trusch/libbcrypt.git -# TODO: Merge changes by TheNoim into lcdr's repo and use that [submodule "thirdparty/docker-utils"] path = thirdparty/docker-utils - url = https://github.com/TheNoim/lcdr-utils + url = https://github.com/lcdr/utils.git +[submodule "thirdparty/LUnpack"] + path = thirdparty/LUnpack + url = https://github.com/Xiphoseer/LUnpack.git diff --git a/docker/setup.Dockerfile b/docker/setup.Dockerfile index bedd3db4..2664e2fa 100644 --- a/docker/setup.Dockerfile +++ b/docker/setup.Dockerfile @@ -1,12 +1,21 @@ -FROM python:3.10.0-slim-buster as prep +FROM rust:alpine3.14 as LUnpack -RUN apt update && apt install unzip sqlite3 +WORKDIR /build_LUnpack + +COPY ./thirdparty/LUnpack . + +RUN apk add musl-dev --no-cache && cargo build --release + +FROM python:3.10-alpine3.14 as prep + +RUN apk add sqlite bash --no-cache WORKDIR /setup # copy needed files from repo COPY resources/ resources/ COPY migrations/cdserver/ migrations/cdserver +COPY --from=LUnpack /build_LUnpack/target/release/lunpack /usr/local/bin/lunpack ADD thirdparty/docker-utils/utils/*.py utils/ COPY docker/setup.sh /setup.sh diff --git a/docker/setup.sh b/docker/setup.sh index 85776e6f..1a95f4de 100755 --- a/docker/setup.sh +++ b/docker/setup.sh @@ -1,5 +1,8 @@ #!/bin/bash +# fail on first error +set -e + function update_ini() { FILE="/docker/configs/$1" KEY=$2 @@ -65,7 +68,14 @@ fi if [[ ! -f "/client/extracted" ]]; then echo "Start client resource extraction" - python3 utils/pkextractor.py /client/ /client/ + touch globs.txt + + echo "client/res/macros/**" >> globs.txt + echo "client/res/BrickModels/**" >> globs.txt + echo "client/res/maps/**" >> globs.txt + echo "*.fdb" >> globs.txt + + lunpack -g ./globs.txt /client/ touch /client/extracted else diff --git a/thirdparty/LUnpack b/thirdparty/LUnpack new file mode 160000 index 00000000..f8d7e442 --- /dev/null +++ b/thirdparty/LUnpack @@ -0,0 +1 @@ +Subproject commit f8d7e442a78910b298fe1cd5780f07c9c9285b8c