🗃️ Committing everything that changed 🗃️

Dockerfile
rootfs/root/docker/setup/03-files.sh
rootfs/root/docker/setup/04-users.sh
This commit is contained in:
casjay 2024-09-04 12:51:12 -04:00
parent 234306134c
commit 494008532d
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
3 changed files with 21 additions and 17 deletions

View File

@ -153,17 +153,6 @@ RUN echo "Custom Settings"; \
RUN echo "Setting up users and scripts "; \ RUN echo "Setting up users and scripts "; \
$SHELL_OPTS; \ $SHELL_OPTS; \
if ! grep -s -q "${AUR_HOME}" /etc/passwd;then useradd -m -r -s /bin/bash -d "${AUR_HOME}" "${AUR_USER}";fi; \
passwd -d "${AUR_USER}"; \
[ -d "/etc/sudoers.d" ] || mkdir -p "/etc/sudoers.d"; \
echo ''${AUR_USER}' ALL=(ALL) ALL' >"/etc/sudoers.d/${AUR_USER}" && \
echo 'standard-resolver' >"${AUR_HOME}/.gnupg/dirmngr.conf" && \
chown -Rf "${AUR_USER}":"${AUR_USER}" "${AUR_HOME}"; \
if [ -z "$(command -v yay 2>/dev/null)" ];then cd "${AUR_HOME}/build" && \
git clone --depth 1 "https://aur.archlinux.org/yay.git" && cd yay && \
sudo -u "${AUR_USER}" makepkg --noconfirm -si; \
fi; \
sudo -u "${AUR_USER}" yay --afterclean --removemake --save && pacman -Qtdq | xargs -r pacman --noconfirm -Rcns; \
if [ -f "/root/docker/setup/04-users.sh" ];then echo "Running the users script";/root/docker/setup/04-users.sh||{ echo "Failed to execute /root/docker/setup/04-users.sh" >&2 && exit 10; };echo "Done running the users script";fi; \ if [ -f "/root/docker/setup/04-users.sh" ];then echo "Running the users script";/root/docker/setup/04-users.sh||{ echo "Failed to execute /root/docker/setup/04-users.sh" >&2 && exit 10; };echo "Done running the users script";fi; \
echo "" echo ""

View File

@ -24,12 +24,9 @@ set -o pipefail
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set env variables # Set env variables
exitCode=0 exitCode=0
AUR_USER="${AUR_USER:-aur}"
AUR_HOME="${AUR_HOME:-/var/lib/aur}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main script # Main script
mkdir -p "${AUR_HOME}/build"
mkdir -p "${AUR_HOME}/.gnupg"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set the exit code # Set the exit code
exitCode=$? exitCode=$?

View File

@ -24,10 +24,28 @@ set -o pipefail
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set env variables # Set env variables
exitCode=0 exitCode=0
AUR_USER="${AUR_USER:-aur}"
AUR_HOME="${AUR_HOME:-/var/lib/aur}"
AUR_BUILD_DIR="${AUR_BUILD_DIR:-${AUR_HOME}/build}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main script # Main script
chmod 777 -f "${AUR_HOME}/build"
if ! grep -s -q "${AUR_HOME}" /etc/passwd; then useradd -m -r -s /bin/bash -d "${AUR_HOME}" "${AUR_USER}" && passwd -d "${AUR_USER}" || exit 1; fi
mkdir -p "${AUR_BUILD_DIR}"
mkdir -p "${AUR_HOME}/.gnupg"
[ -d "/etc/sudoers.d" ] || mkdir -p "/etc/sudoers.d"
echo ''${AUR_USER}' ALL=(ALL) ALL' >"/etc/sudoers.d/${AUR_USER}" &&
echo 'standard-resolver' >"${AUR_HOME}/.gnupg/dirmngr.conf" &&
chown -Rf "${AUR_USER}":"${AUR_USER}" "${AUR_HOME}"
if [ -z "$(command -v yay 2>/dev/null)" ]; then
if cd "$AUR_BUILD_DIR"; then
[ -n "$(type -P git)" ] && git config --global init.defaultBranch main
git clone --depth 1 "https://aur.archlinux.org/yay" "$AUR_BUILD_DIR/yay" && cd "$AUR_BUILD_DIR/yay" && sudo -u "${AUR_USER}" makepkg --noconfirm -si
else
exit 1
fi
fi
sudo -u "${AUR_USER}" yay --afterclean --removemake --save && pacman -Qtdq | xargs -r pacman --noconfirm -Rcns
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set the exit code # Set the exit code
exitCode=$? exitCode=$?