hacker-challenge-sgx-general/rewrite/README.md
2024-10-06 15:34:02 +03:00

1.2 KiB

Welcome to the HACKER CHALLENGE

Building and packaging the challenge

The host can be without SGX support. To build and package the challenge you will need the docker environment. Do the following steps to build the challenge:

# Notice that there is no SGX device mounted
docker run --rm --name packager -it -v /path/to/rewrite:/root/rewrite occlum/occlum:latest-ubuntu20.04
# Inside the docker container do env preparation to build the image
rustup install stable-x86_64-unknown-linux-gnu
rustup default stable
rustup target add x86_64-unknown-linux-musl

mkdir -p /root/.ssh

# Outside the container copy the ssh keys to the container to download occlum-ratls dependency
docker cp ~/.ssh/config packager:/root/.ssh/config
docker cp ~/.ssh/gitea_ed25519 packager:/root/.ssh/gitea_ed25519

apt update && apt install openssh-client
ssh-keyscan -H gitea.detee.cloud >> ~/.ssh/known_hosts
chown -R root:root /root/.ssh
chmod 600 /root/.ssh/gitea_ed25519

cd /root/rewrite && ./scripts/package.sh
# Feel free to exit the container once the challenge was packaged
exit

Testing the challenge

To test the challenge you will need the SGX support.

Contributing to the challenge

Don't forget to run cargo clippy and cargo fmt before submitting a PR.