This repository has been archived on 2022-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
appliances-old/guacamole/Makefile

57 lines
3.0 KiB
Makefile

preinstall:
# switch to hardened, build hardened toolchain, rebuild everything
mkdir -p $(CHROOT)/etc/portage/profile
echo "-hardened" >> $(CHROOT)/etc/portage/profile/use.mask
$(inroot) $(EMERGE) $(USEPKG) --oneshot gcc
$(inroot) $(EMERGE) $(USEPKG) --oneshot binutils virtual/libc
-$(gcc_config)
$(inroot) $(EMERGE) $(USEPKG) --emptytree @world
$(inroot) bash -c 'yes YES | etc-update --automode -9'
postinstall: base/timesyncd.conf base/firstboot.start
# Konfigurationen anpassen
cp base/timesyncd.conf $(CHROOT)/etc/systemd/timesyncd.conf
mkdir -p $(CHROOT)/etc/local.d
cp base/firstboot.start $(CHROOT)/etc/local.d/firstboot.start
touch $(CHROOT)/firstboot
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' $(CHROOT)/etc/sudoers
sed -i 's#^auth.*$$#auth [success=2 default=ignore] pam_ssh_agent_auth.so file=~/.ssh/authorized_keys\nauth include system-auth#' $(CHROOT)/etc/pam.d/sudo
echo "Defaults env_keep += SSH_AUTH_SOCK" > $(CHROOT)/etc/sudoers.d/ssh_auth_sock
$(inroot) useradd -m -G users,wheel -s /bin/bash --comment="virtual appliance admin" --uid 2000 admin
$(inroot) passwd -d admin; $(inroot) passwd -e admin
$(inroot) systemctl enable tmux@root.service
cp base/tmux.conf $(CHROOT)/root/.tmux.conf
# Beispiel feste IP-Adresse
cp base/00-eth0.network $(CHROOT)/00-eth0.network.example
# MariaDB-Konfiguration ($$, weil make ein $ entfernt)
sed -i "s/^character-set-server.*$$/character-set-server = utf8mb4/" $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "collation-server = utf8mb4_general_ci" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "transaction_isolation = READ-COMMITTED" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "binlog_format = ROW" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "expire_logs_days = 3" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "innodb_file_per_table = 1" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
echo "innodb_large_prefix = on" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
cp mariadb/my.cnf.root $(CHROOT)/root/.my.cnf
chmod 0600 $(CHROOT)/root/.my.cnf
rm -rf $(CHROOT)/var/lib/mysql/*
$(inroot) bash -c 'yes gentoo | emerge --config dev-db/mariadb'
# Nginx
mv $(CHROOT)/etc/nginx/nginx.conf $(CHROOT)/etc/nginx/nginx.conf.orig
cp nginx/nginx.conf $(CHROOT)/etc/nginx/nginx.conf
# Guacamole
$(inroot) /usr/share/tomcat-8.5/gentoo/tomcat-instance-manager.bash --create
echo >> $(CHROOT)/etc/conf.d/tomcat-8.5
echo "# Guacamole" >> $(CHROOT)/etc/conf.d/tomcat-8.5
echo "TOMCAT_EXTRA_CLASSPATH=\"/usr/share/jdbc-mysql/lib/jdbc-mysql.jar\"" >> $(CHROOT)/etc/conf.d/tomcat-8.5
echo "GUACAMOLE_HOME=/etc/guacamole" >> $(CHROOT)/etc/conf.d/tomcat-8.5
cp tomcat/tomcat.start $(CHROOT)/usr/bin/tomcat-8.5
cp tomcat/tomcat.systemd $(CHROOT)/etc/systemd/system/tomcat-8.5.service
ln -sf /usr/share/guacamole-client/guacamole.war $(CHROOT)/var/lib/tomcat-8.5/webapps/
clean: