20 lines
767 B
Bash
Executable file
20 lines
767 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# This file is part of VM-Experiments.
|
|
# Licensed under the GPL-3.0-or-later. See LICENSE for details.
|
|
|
|
trap '' SIGINT SIGTERM
|
|
rm /etc/nginx/sites-enabled/default
|
|
tar -xzf /root/deployment.tar.gz -C /root
|
|
openssl genrsa -out /root/ca.key 2048
|
|
chmod 400 /root/ca.key
|
|
mkdir -p /etc/ssl/certs/
|
|
mkdir -p /etc/ssl/private/
|
|
openssl req -x509 -new -nodes -key /root/ca.key -sha256 -days 1024 -out /etc/ssl/certs/ca.crt -subj '/C=CH/ST=Zurich/L=Zurich/O=InterstellarNet/OU=NONE/CN=INTERSTELLAR'
|
|
cp /etc/ssl/certs/ca.crt /root
|
|
cp /etc/ssl/certs/ca.crt /usr/local/share/ca-certificates/
|
|
chown -R www-data:www-data /etc/ssl/private/
|
|
chown -R www-data:www-data /etc/ssl/certs/
|
|
chmod 600 -R /etc/ssl/private/
|
|
chmod 644 -R /etc/ssl/certs/ca.crt
|
|
update-ca-certificates
|