-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap_root.sh
executable file
·60 lines (49 loc) · 2.27 KB
/
bootstrap_root.sh
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
#!/bin/bash
echo "BOOSTRAP SCRIPT Debian/Ubuntu"
echo "The script you are running has basename `basename "$0"`, dirname `dirname "$0"`"
echo "The present working directory is `pwd`"
if [[ $USER != "root" ]]; then
echo "you must run this as root"
exit 1
fi
# web server and certbot
apt-get install -y nginx-full
apt-get install -y python3-certbot-nginx
apt-get install -y build-essential git curl autoconf bison
# build Nokogiri
apt-get install -y patch zlib1g-dev liblzma-dev
# build rmagick
apt-get install -y libmagickwand-dev
# use yet another PNG reading software since imagemagick sometimes can't convert
apt-get install -y pngquant
# cron, but for one-time jobs
apt-get install -y at
string=$(uname -a)
# you can force debian or ubuntu package names if you want.
# this is useful with WSL (at least WSL1) since uname doesn't return the distro name.
if [[ $string == *"Debian"* ]] | [[ $1 == "--debian" ]]; then
curl -sL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
# dependencies for rbenv to build ruby on Debian https://linuxize.com/post/how-to-install-ruby-on-debian-10/
apt-get install -y libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
fi
# Using Ubuntu
if [[ $string == *"Ubuntu"* ]] | [[ $1 == "--ubuntu" ]]; then
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# dependencies for rbenv to build ruby on Ubuntu according to https://linuxize.com/post/how-to-install-ruby-on-ubuntu-20-04/
apt-get install -y libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev libdb-dev
fi
# echo "remember to put /scripts/usr_share_dbus1_system.conf >> into >> /usr/share/dbus-1/system.conf"
cp -a server_config/usr/* /usr/
cp ./scripts/calvinball_daemon.service /etc/systemd/system/calvinball_daemon.service
systemctl daemon-reload
echo "remember to activate later: systemctl start calvinball_daemon"
# activate it later
# systemctl start calvinball_daemon
cp -a server_config/etc/* /etc/
mkdir audio images resources
mkdir -p /var/www/html/calvinballconsortium
ln -s audio /var/www/html/calvinballconsortium/audio
ln -s images /var/www/html/calvinballconsortium/images
ln -s resources /var/www/html/calvinballconsortium/resources