installer key

This commit is contained in:
2024-08-25 09:14:37 +02:00
parent 2157d8c405
commit 66fe634955
2 changed files with 20 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ FROM alpine:latest
COPY --from=redis-source /usr/src/redis/src/redis-cli /usr/bin/redis-cli COPY --from=redis-source /usr/src/redis/src/redis-cli /usr/bin/redis-cli
RUN chmod +x /usr/bin/redis-cli RUN chmod +x /usr/bin/redis-cli
RUN apk add --update --no-cache docker-cli wget curl dos2unix jq openssl git RUN apk add --update --no-cache docker-cli wget curl dos2unix jq openssl git openssh-client
COPY scripts/scheduler/*.sh /scripts/ COPY scripts/scheduler/*.sh /scripts/
RUN find ./scripts -name "*.sh" | xargs dos2unix RUN find ./scripts -name "*.sh" | xargs dos2unix

View File

@@ -35,6 +35,22 @@ CURL_RETRIES=${CURL_RETRIES:-360}
SCHEDULER_SERVICEFILE_GENERATE_TEST=${SCHEDULER_SERVICEFILE_GENERATE_TEST:-false} SCHEDULER_SERVICEFILE_GENERATE_TEST=${SCHEDULER_SERVICEFILE_GENERATE_TEST:-false}
check_installer_key() {
mkdir -p /root/.ssh
if [ -f /etc/user/data/installer ]; then
ln -s /etc/user/data/installer /root/.ssh/id_rsa
echo '
Host git.format.hu
User git
Port 20202
HostName git.format.hu
PreferredAuthentications publickey
IdentityFile /root/.ssh/id_rsa
IdentitiesOnly yes
StrictHostKeyChecking no
' > /root/.ssh/config
fi
}
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]]; then if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]]; then
SETUP="/setup" SETUP="/setup"
@@ -144,6 +160,9 @@ get_repositories(){
REPOS=$(jq -r .repositories[] /etc/user/config/repositories.json); # list of repos, delimiter by space REPOS=$(jq -r .repositories[] /etc/user/config/repositories.json); # list of repos, delimiter by space
for REPO in $REPOS; do for REPO in $REPOS; do
check_installer_key
BASE=$(basename $REPO | cut -d '.' -f1) BASE=$(basename $REPO | cut -d '.' -f1)
if [ ! -f "/tmp/$BASE" ]; then if [ ! -f "/tmp/$BASE" ]; then
git clone $REPO /tmp/$BASE; git clone $REPO /tmp/$BASE;