From eb38128f34b8202718beaca106847b619fb58b24 Mon Sep 17 00:00:00 2001 From: HerrHase Date: Sun, 22 Oct 2023 18:49:32 +0200 Subject: [PATCH] adding --- install.sh | 2 ++ lets-encrypt.js | 5 +++++ mariadb-create.js | 3 ++- nginx-enable.js | 4 ++++ node.js | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 lets-encrypt.js create mode 100644 nginx-enable.js diff --git a/install.sh b/install.sh index 0aec7fe..469a98f 100644 --- a/install.sh +++ b/install.sh @@ -11,6 +11,8 @@ set -o nounset # installing dependencies apt update && apt upgrade -y && apt autoremove -y +apt remove ubuntu-advantage-tools -y + curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh apt install -y nodejs git unzip curl ufw fail2ban cockpit software-properties-common diff --git a/lets-encrypt.js b/lets-encrypt.js new file mode 100644 index 0000000..d778fd1 --- /dev/null +++ b/lets-encrypt.js @@ -0,0 +1,5 @@ +sudo apt install letsencrypt +sudo systemctl status certbot.timer +sudo certbot certonly --standalone --agree-tos --preferred-challenges http -d domain-name.com + +sudo certbot certonly --standalone --agree-tos --preferred-challenges http -d system-test.die-logistik24.de \ No newline at end of file diff --git a/mariadb-create.js b/mariadb-create.js index 5510929..5f5ec86 100755 --- a/mariadb-create.js +++ b/mariadb-create.js @@ -38,7 +38,8 @@ user.password = await password({ const connection = await mysql.createConnection({ host: 'localhost', user: user.name, - password: user.password + password: user.password, + port: 3306 }) const database = { diff --git a/nginx-enable.js b/nginx-enable.js new file mode 100644 index 0000000..18c04e2 --- /dev/null +++ b/nginx-enable.js @@ -0,0 +1,4 @@ + + +symlink('/etc/nginx/sites-available/'.$vhost['file'], '/etc/nginx/sites-enabled/'.$vhost['file']); +exec('nginx -c /etc/nginx/nginx.conf -t 2>&1', $output); diff --git a/node.js b/node.js index d44cc70..c45904b 100644 --- a/node.js +++ b/node.js @@ -1 +1,4 @@ spawn('curl -sL https://deb.nodesource.com/setup_' + $version + '.x | sudo -E bash -') + + +cat ~/id_rsa.pub >> ~/.ssh/authorized_keys \ No newline at end of file