27 lines
717 B
Bash
Executable File
27 lines
717 B
Bash
Executable File
#!/usr/bin/bash
|
|
source /etc/os-release
|
|
|
|
# Clear configuration (will be filled with mkosi.extra/)
|
|
rm -r /etc/nginx/*
|
|
rm -r /etc/ssh/*
|
|
rm /etc/tor/torrc
|
|
if [[ $ID = "debian" ]]; then
|
|
rm -r /etc/php/7.4/fpm/pool.d
|
|
rm /usr/lib/tmpfiles.d/php7.4-fpm.conf
|
|
fi
|
|
if [[ $ID = "arch" ]]; then
|
|
rm /etc/php/php-fpm.d/*
|
|
fi
|
|
|
|
# Create dedicated Tor instance
|
|
if [[ $ID = "debian" ]]; then
|
|
tor-instance-create niver
|
|
fi
|
|
|
|
# Generate default self-signed TLS key pair
|
|
openssl req -subj '/' -new -newkey RSA:3072 -days 3650 -nodes -x509 -keyout /etc/ssl/private/niver.key -out /etc/ssl/certs/niver.crt
|
|
|
|
# Generate SSH server key pair
|
|
ssh-keygen -f /etc/ssh/ed25519 -t ed25519 -N ""
|
|
ssh-keygen -lvf /etc/ssh/ed25519 > /etc/ssh/ed25519.fp
|