#!/bin/sh set -e if [ ! -f /etc/alpine-release ]; then echo "Error: This script only runs on Alpine Linux." exit 1 fi echo "Installing packages..." apk add gnupg gnupg-scdaemon pinentry-tty git echo "Configuring GPG..." mkdir -p ~/.gnupg chmod -R 700 ~/.gnupg echo 'enable-ssh-support' > ~/.gnupg/gpg-agent.conf echo 'pinentry-program /usr/bin/pinentry-tty' >> ~/.gnupg/gpg-agent.conf echo "Setting up environment..." export GPG_TTY="$(tty)" export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" echo "Importing and trusting GPG key..." gpg --recv-keys "56FB101D4E094804B1666859083A2C9A046554D6" echo "56FB101D4E094804B1666859083A2C9A046554D6:6:" | gpg --import-ownertrust echo "Restarting GPG agent..." gpgconf --kill gpg-agent gpg-agent --daemon echo "Testing SSH connection..." ssh -T git@g.eliaskohout.de || true echo "Setting up projects directory..." mkdir -p ~/projects cd ~/projects git clone "git@g.eliaskohout.de:eliaskohout/env.git" echo "Adding community repository..." grep main /etc/apk/repositories | sed 's/main/community/' >> /etc/apk/repositories apk update echo "Running env setup..." cd env ./runs/up.python.sh ./scripts/conf-run up echo "Setup complete!"