From cb6c1fccdcab889a43f12589a2c2d7bacbe34781 Mon Sep 17 00:00:00 2001 From: casjay Date: Tue, 13 Aug 2024 16:10:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile rootfs/usr/local/etc/docker/init.d/08-gitea.sh rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh --- Dockerfile | 2 +- rootfs/usr/local/etc/docker/init.d/08-gitea.sh | 15 ++++++--------- .../usr/local/etc/docker/init.d/zz-act_runner.sh | 15 ++++++++------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e1d3ea..8cbd71b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ ARG PHP_VERSION ARG PHP_SERVER ARG SHELL_OPTS -ARG PACK_LIST="btrfs-progs e2fsprogs e2fsprogs-extra git ip6tables iptables openssl pigz shadow-uidmap xfsprogs xz zfs docker docker-registry nginx openssh " +ARG PACK_LIST="fuse-overlayfs btrfs-progs e2fsprogs e2fsprogs-extra git ip6tables iptables openssl pigz shadow-uidmap xfsprogs xz zfs docker docker-registry nginx openssh " ENV ENV=~/.profile ENV SHELL="/bin/sh" diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index 9499033..ce8e277 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -247,20 +247,17 @@ __update_conf_files() { [ -d " /config/ssh" ] || mkdir -p "/config/ssh" [ -d "$DATA_DIR/ssh" ] || mkdir -p "$DATA_DIR/ssh" [ "$COPY_SSHD_CONF" = "yes" ] && copy "/etc/ssh/sshd_config" "/config/ssh/" - if [ ! -f /config/ssh/ssh_host_ed25519_key ]; then + if [ ! -f "/config/ssh/ssh_host_ed25519_key" ]; then echo "Generating /config/ssh/ssh_host_ed25519_key..." - ssh-keygen -t ed25519 -f /config/ssh/ssh_host_ed25519_key -N "" >/dev/null && - __symlink "/config/ssh/ssh_host_ed25519_key" "$DATA_DIR/ssh" + ssh-keygen -t ed25519 -f /config/ssh/ssh_host_ed25519_key -N "" >/dev/null && __symlink "/config/ssh/ssh_host_ed25519_key" "$DATA_DIR/ssh/ssh_host_ed25519_key" fi - if [ ! -f /config/ssh/ssh_host_rsa_key ]; then + if [ ! -f "/config/ssh/ssh_host_rsa_key" ]; then echo "Generating /config/ssh/ssh_host_rsa_key..." - ssh-keygen -t rsa -b 3072 -f /config/ssh/ssh_host_rsa_key -N "" >/dev/null && - __symlink "/config/ssh/ssh_host_rsa_key" "$DATA_DIR/ssh" + ssh-keygen -t rsa -b 3072 -f /config/ssh/ssh_host_rsa_key -N "" >/dev/null && __symlink "/config/ssh/ssh_host_rsa_key" "$DATA_DIR/ssh/ssh_host_rsa_key" fi - if [ ! -f /config/ssh/ssh_host_ecdsa_key ]; then + if [ ! -f "/config/ssh/ssh_host_ecdsa_key" ]; then echo "Generating /config/ssh/ssh_host_ecdsa_key..." - ssh-keygen -t ecdsa -b 256 -f /config/ssh/ssh_host_ecdsa_key -N "" >/dev/null && - __symlink "/config/ssh/ssh_host_ecdsa_key" "$DATA_DIR/ssh" + ssh-keygen -t ecdsa -b 256 -f /config/ssh/ssh_host_ecdsa_key -N "" >/dev/null && __symlink "/config/ssh/ssh_host_ecdsa_key" "$DATA_DIR/ssh/ssh_host_ecdsa_key" fi chmod 0700 "$DATA_DIR/ssh" /config/ssh chmod 0600 "$DATA_DIR/ssh"/* /config/ssh/* diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index 4472876..ef40fcf 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -164,7 +164,7 @@ RUNNER_LABELS+="debian:docker://casjaysdev/debian:latest," RUNNER_LABELS+="ubuntu:docker://casjaysdev/ubuntu:latest," RUNNER_LABELS+="almalinux:docker://casjaysdev/almalinux:latest," RUNNER_LABELS+="act_runner:docker://catthehacker/ubuntu:full-latest" -SYS_AUTH_TOKEN="$(gosu gitea gitea --config "$ETC_DIR/gitea/app.ini" actions generate-runner-token 2>/dev/null | grep -v '\.\.\.')" +SYS_AUTH_TOKEN="$(sudo -u gitea gitea --config "$ETC_DIR/gitea/app.ini" actions generate-runner-token 2>/dev/null | grep -v '\.\.\.')" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Specifiy custom directories to be created ADD_APPLICATION_FILES="" @@ -252,13 +252,14 @@ EOF fi for runner in "$CONF_DIR/reg"/*.reg; do [ -f "$runner" ] && . "$runner" - RUNNER_NAME="${RUNNER_NAME:-$(basename "${runner//.reg/}")}" - RUNNER_HOME="${RUNNER_HOME:-$CONF_DIR/multi/$RUNNER_NAME}" - RUNNER_HOSTNAME="https://${RUNNER_HOSTNAME:-$HOSTNAME}" - RUNNER_REGISTER_URL="${RUNNER_REGISTER_URL:-127.0.0.1:8000}" - RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" - RUNNER_LABELS="${RUNNER_LABELS:-act_runner}" while :; do + RUNNER_NAME="${RUNNER_NAME:-$(basename "${runner//.reg/}")}" + RUNNER_HOME="${RUNNER_HOME:-$CONF_DIR/multi/$RUNNER_NAME}" + RUNNER_HOSTNAME="https://${RUNNER_HOSTNAME:-$HOSTNAME}" + RUNNER_REGISTER_URL="${RUNNER_REGISTER_URL:-127.0.0.1:8000}" + RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" + RUNNER_LABELS="${RUNNER_LABELS:-act_runner}" + SYS_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$(sudo -u gitea gitea --config "$ETC_DIR/gitea/app.ini" actions generate-runner-token 2>/dev/null | grep -v '\.\.\.')}" if [ ! -f "$RUNNER_HOME/runners" ]; then [ -n "$RUNNER_NAME" ] && [ -n "$RUNNER_HOME" ] || break [ -f "$CONF_DIR/tokens/$RUNNER_NAME" ] && RUNNER_AUTH_TOKEN="$(<"$CONF_DIR/tokens/$RUNNER_NAME")" || { [ -n "$SYS_AUTH_TOKEN" ] && echo "$SYS_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME"; }