From 2089b4e99a9b384a5188c3e8dcd91aba4859347b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 10 Sep 2022 01:29:51 +0000 Subject: [PATCH] --- devdocs/todo.txt | 2 +- dist/ayinit.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 1715dd6f..fb56b665 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -90,7 +90,7 @@ THINGS HOLDING UP RELEASE - +todo: what are "reserved ip's" referenced on create droplet page? Sounds like a possible solution to the endless new certs issue maybe? TODO: DOCUMENT A NEW droplet has about 21gb of free space. We could say 20 and 1 bonus but meh, 21 sounds better. So this needs to be turned into a volume dedicated to data usage and maybe leave the 1gb on the /dev/vda1 and put the 20gb on the new volume purely for data storage diff --git a/dist/ayinit.sh b/dist/ayinit.sh index 30427c14..960f5b7a 100644 --- a/dist/ayinit.sh +++ b/dist/ayinit.sh @@ -2,14 +2,17 @@ # create new droplet, immediately set subdomain name in networking # copy this script to new server set these values and run only once the domain has propagated +# paste into nano new ayinit.sh don't forget to chmod a+x ayinit.sh TIMEZONE='America/Vancouver' DOMAINNAME='subdomain.onayanova.com' ############################# +echo STARTING... timedatectl set-timezone $TIMEZONE apt-get update apt-get dist-upgrade -y +echo SET SWAP FILE fallocate -l 1G /swapfile chmod 600 /swapfile mkswap /swapfile @@ -17,17 +20,21 @@ swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf +echo INSTALL .NET CORE apt-get install -y aspnetcore-runtime-6.0 +echo INSTALL POSTGRESQL sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update sudo apt-get -y install postgresql sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'YOUR_PASSWORD_HERE';" +echo INSTALL REPORTING LIBS sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libgbm1 \ ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget +echo INSTALL AYANOVA apt install zip unzip -y mkdir /var/ayanova mkdir /var/ayanova/data @@ -55,11 +62,13 @@ echo '' >> /etc/systemd/system/ayanova.service echo '[Install]' >> /etc/systemd/system/ayanova.service echo 'WantedBy=multi-user.target' >> /etc/systemd/system/ayanova.service systemctl enable ayanova.service +echo START AYANOVA SERVICE systemctl start ayanova.service +echo INSTALL NGINX apt install nginx -y echo 'server {' > /etc/nginx/sites-available/default echo ' listen 80;' >> /etc/nginx/sites-available/default -echo ' server_name $DOMAINNAME;' >> /etc/nginx/sites-available/default +echo " server_name $DOMAINNAME;" >> /etc/nginx/sites-available/default echo ' location / {' >> /etc/nginx/sites-available/default echo ' add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;' >> /etc/nginx/sites-available/default echo ' add_header X-XSS-Protection "1; mode=block" always;' >> /etc/nginx/sites-available/default @@ -89,5 +98,8 @@ echo ' client_max_body_size 25M;' >> /etc/nginx/sites-available/default echo ' }' >> /etc/nginx/sites-available/default echo '}' >> /etc/nginx/sites-available/default systemctl restart nginx +echo INSTALL CERTBOT apt install certbot python3-certbot-nginx -y -certbot --nginx --noninteractive --agree-tos --email ops@onayanova.com --no-eff-email -d $DOMAINNAME \ No newline at end of file +echo GET CERTIFICATE +certbot --nginx --noninteractive --agree-tos --email ops@onayanova.com --no-eff-email -d $DOMAINNAME +echo ...COMPLETED