Files
ansiblerazvert/next/razvertnext2.sh
2026-04-17 22:32:38 +05:00

49 lines
1.3 KiB
Bash

#!/bin/bash
cd /var/www/
wget https://download.nextcloud.com/server/releases/nextcloud-33.0.0.zip
unzip -o nextcloud-33.0.0.zip
rm nextcloud-33.0.0.zip
chown -R www-data:www-data /var/www/nextcloud
chmod -R 755 /var/www/nextcloud
mkdir -p /etc/ssl/nextcloud
cd /etc/ssl/nextcloud
openssl genrsa -out ca.key 4096
openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.crt -subj "/C=RU/ST=Local/L=Local/O=AU Team/CN=AU Team Root CA"
openssl genrsa -out ncloud.au.team.key 2048
openssl req -new -key ncloud.au.team.key -out ncloud.au.team.csr -subj "/C=RU/ST=Local/L=Local/O=AU Team/CN=ncloud.au.team"
cat <<EOF | sudo tee ncloud.au.team.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = ncloud.au.team
EOF
openssl x509 -req -in ncloud.au.team.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out ncloud.
au.team.crt -days 365 -sha256 -extfile ncloud.au.team.ext
mkdir -p /etc/ssl/nextcloud
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/nextcloud/ncloud.au.team.key -out /etc/ssl/nextcloud/ncloud.au.team.crt
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
apt-get install -y python3-certbot-dns-rfc2136
# tsig-keygen -a HMAC-SHA512 certbot-key