servnest-mkosi/mkosi.postinst

31 lines
656 B
Bash
Executable File

#!/usr/bin/bash
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi
set -euo pipefail
source /etc/os-release
export OS=$ID
# Generate OpenSSH server key pair
ssh-keygen -f /etc/ssh/ed25519 -t ed25519 -N ""
ssh-keygen -lvf /etc/ssh/ed25519 > /etc/ssh/ed25519.fp
source /install/install.sh
chown $sftpgo: /usr/local/bin/sftpgo
chmod u=rx,g=,o= /usr/local/bin/sftpgo
if [[ $OS = "arch" ]]; then
pacman-key --init
pacman-key --populate
fi
# Enable testing option
sed -i 's/local_only_check = false/local_only_check = true/' /srv/servnest/core/config.ini
chmod u=rwX,g=rX,o=rX / /etc
chmod -R u=rwX,g=rX,o=rX /etc/php