Files
onyx/install.sh

48 lines
1.2 KiB
Bash
Raw Normal View History

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