From 54985c1d9d17294270ae6dc2dd6330983b19a526 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 9 Jun 2023 14:09:07 -0300 Subject: [PATCH] ci(run.sh): fix cookie generation Sometimes, the generated cookie could be interpret by erlang as a flag (e.g.: `+8w7uIsgUeG80c/ZgUDD9g==`) if not escaped properly, causing the start up to fail. --- scripts/ct/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ct/run.sh b/scripts/ct/run.sh index b24c760f0..135eec919 100755 --- a/scripts/ct/run.sh +++ b/scripts/ct/run.sh @@ -264,7 +264,7 @@ fi # rebar, mix and hex cache directory need to be writable by $DOCKER_USER docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "mkdir -p /.cache /.hex /.mix && chown $DOCKER_USER /.cache /.hex /.mix" # need to initialize .erlang.cookie manually here because / is not writable by $DOCKER_USER -docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "openssl rand -base64 16 > /.erlang.cookie && chown $DOCKER_USER /.erlang.cookie && chmod 0400 /.erlang.cookie" +docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "openssl rand -base64 -hex 16 > /.erlang.cookie && chown $DOCKER_USER /.erlang.cookie && chmod 0400 /.erlang.cookie" # the user must exist inside the container for `whoami` to work docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "useradd --uid $DOCKER_USER -M -d / emqx" || true docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "chown -R $DOCKER_USER /var/lib/secret" || true