-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·93 lines (76 loc) · 2.85 KB
/
setup.sh
File metadata and controls
executable file
·93 lines (76 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# install for BoGL stuff
#
# NOTE: The box MUST have >= 4GB of Ram
# otherwise the installation process WILL FAIL
#
echo ""
echo "This Script will install the stack for running a BoGL language server,"
echo "along with the frontend and all supporting components."
echo ""
echo "What you will need during this process:"
echo "- A valid domain name that you can generate a certificate for (like bogl.engr.oregonstate.edu)"
echo ""
echo "[Hit enter to continue if you're ready]"
read qqq
# update the server in advance
sudo apt update
sudo apt upgrade
# clone repos (bogl, editor, docs)
git clone https://github.com/ChildsplayOSU/bogl.git
git clone https://github.com/ChildsplayOSU/bogl-editor.git
git clone https://github.com/ChildsplayOSU/bogl-docs.git
# setup dev deps
sudo apt install haskell-stack cabal-install zlib1g-dev ruby-bundler ruby-dev g++
# get node 12x
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs npm nginx
# Copy over & setup the nginx config
sudo cp nginx_config/bogl_nginx_config_httponly /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/bogl_nginx_config_httponly /etc/nginx/sites-enabled/bogl_nginx_config_httponly
# certbot setup for TLS certs
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
# pre-emptively make this folder so we can use certbot properly
sudo mkdir -p /var/www/html/bogl
sudo mkdir -p /var/www/html/errors
sudo mkdir -p /var/www/html/bogl/docs
sudo mkdir -p /var/www/html/bogl/editor
# boot up nginx
sudo nginx
# install certbot, optional to setup booting with everything in-tact
sudo apt-get install certbot
# generate a cert
echo ""
echo "Alright, when certbot asks you to set things up, make sure you enter a non-AWS domain."
echo "Any subdomain will work (such as bogl.uphouseworks.com), so long as there is an associated CNAME"
echo "record pointing to this server's domain."
echo ""
echo "Hit Enter to continue"
echo ""
read ccc
sudo certbot certonly --webroot --webroot-path /var/www/html/bogl/editor/ --domain bogl.engr.oregonstate.edu
echo ""
echo "Make a note of the Cert & Key file generated, you will need these to setup HTTPS for the site"
echo ""
echo "Hit Enter to continue"
echo ""
read ccc
# remove the old config, using the http one now
sudo rm /etc/nginx/sites-enabled/bogl_nginx_config_httponly
sudo rm /etc/nginx/sites-available/bogl_nginx_config_httponly
sudo cp nginx_config/bogl_nginx_config /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/bogl_nginx_config /etc/nginx/sites-enabled/bogl_nginx_config
sudo service nginx reload
# move contents over for site
sudo cp var/www/html/errors/*.html /var/www/html/errors/
# build everything
./build.sh
# start everything up
mkdir bogl-logs
./boot.sh
# finally, setup the docs
cd bogl-docs
bundle install