summaryrefslogtreecommitdiff
path: root/configure-server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'configure-server.sh')
-rw-r--r--configure-server.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/configure-server.sh b/configure-server.sh
new file mode 100644
index 0000000..31bea65
--- /dev/null
+++ b/configure-server.sh
@@ -0,0 +1,26 @@
+# This is a rudimentary script to configure an image node
+
+# Start by updating cache and installing needed packages
+sudo apt update && sudo apt install imagemagick nginx vim git sudo python3-certbot-nginx -y
+
+# Created needed configuration files
+# First the NGINX config file
+# Second the file to process images
+touch /etc/nginx/conf.d/pbs-bsimg-net.conf
+touch /usr/local/bin/bsimg-process.sh
+
+# Make the image processor file executable
+chmod +x /usr/local/bin/bsimg-process.sh
+
+# Add my username to the www-data and ensure the group owns the directory
+# so I can upload files
+usermod -aG www-data ben
+usermod -aG sudo ben
+chown -R www-data:www-data /var/www/html/
+
+# Attempt to get TLS certs
+# Replace {region} with state/country code of region the vm is located
+certbot -d bsimg.net -d pbs.atl.bsimg.net -d pbs.bsimg.net -d pbs.{region}.bsimg.net
+
+# Restart NGINX
+systemctl restart nginx.service \ No newline at end of file