Rebase to noble

This commit is contained in:
thespad
2024-08-19 18:51:04 +01:00
parent deb7a4925c
commit 3b59cd4197
13 changed files with 32 additions and 34 deletions

View File

@@ -1,14 +1,15 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
mkdir -p /config/{extensions,data,workspace,.ssh}
if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
if [[ -n "${SUDO_PASSWORD}" ]] || [[ -n "${SUDO_PASSWORD_HASH}" ]]; then
echo "setting up sudo access"
if ! grep -q 'abc' /etc/sudoers; then
echo "adding abc to sudoers"
echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers
fi
if [ -n "${SUDO_PASSWORD_HASH}" ]; then
if [[ -n "${SUDO_PASSWORD_HASH}" ]]; then
echo "setting sudo password using sudo password hash"
sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow
else
@@ -17,15 +18,18 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
fi
fi
[[ ! -f /config/.bashrc ]] && \
if [[ ! -f /config/.bashrc ]]; then
cp /root/.bashrc /config/.bashrc
[[ ! -f /config/.profile ]] && \
fi
if [[ ! -f /config/.profile ]]; then
cp /root/.profile /config/.profile
fi
# fix permissions (ignore contents of /config/workspace)
find /config -path /config/workspace -prune -o -exec chown abc:abc {} +
chown abc:abc /config/workspace
chmod 700 /config/.ssh
if [ -n "$(ls -A /config/.ssh)" ]; then
if [[ -n "$(ls -A /config/.ssh)" ]]; then
chmod 600 /config/.ssh/*
fi

View File

@@ -1 +1 @@
oneshot
oneshot

View File

@@ -1 +1 @@
/etc/s6-overlay/s6-rc.d/init-code-server/run
/etc/s6-overlay/s6-rc.d/init-code-server/run

View File

@@ -1,13 +1,14 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then
if [[ -n "${PASSWORD}" ]] || [[ -n "${HASHED_PASSWORD}" ]]; then
AUTH="password"
else
AUTH="none"
echo "starting with no password"
fi
if [ -z ${PROXY_DOMAIN+x} ]; then
if [[ -z ${PROXY_DOMAIN+x} ]]; then
PROXY_DOMAIN_ARG=""
else
PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}"

View File

@@ -1 +1 @@
longrun
longrun