preparation-scripts/installation/ca.sh
2024-11-22 18:11:34 +01:00

15 lines
588 B
Bash
Executable file

#!/bin/bash
sudo openssl genrsa -out /root/ca.key 4096
sudo openssl req -x509 -new -nodes -key /root/ca.key -sha256 -days 1024 -out /root/ca.crt -subj "/C=CH/ST=Zurich/L=Zurich/O=InterstellarNet/CN=INTERSTELLAR"
sudo cp /root/ca.crt /usr/local/share/ca-certificates/
sudo cp /root/ca.crt /etc/ssl/certs/
sudo update-ca-certificates
sudo mkdir -p /var/www/html
sudo cp ../data/index.html /var/www/html/
sudo cp /root/ca.crt /var/www/html/
sudo cp ../data/default.conf /etc/nginx/sites-available/default
cd ..
tar -cvf /var/www/html/script.tar data/script.sh
sudo systemctl restart nginx