-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall_web.sh
More file actions
executable file
·68 lines (54 loc) · 2.35 KB
/
install_web.sh
File metadata and controls
executable file
·68 lines (54 loc) · 2.35 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
#!/bin/bash
set -xe
MIRTE_SRC_DIR=${MIRTE_SRC_DIR:-/usr/local/src/mirte}
# Update
sudo apt update || true
# Install nodeenv
sudo apt install -y python3-pip python3-setuptools python3-wheel
sudo -H pip install nodeenv
# Install nodeenv
nodeenv --node=18.0.0 $MIRTE_SRC_DIR/mirte-web-interface/node_env
# Install web interface
. $MIRTE_SRC_DIR/mirte-web-interface/node_env/bin/activate
# Install frontend
cd $MIRTE_SRC_DIR/mirte-web-interface/vue-frontend || exit 1
npm install .
npm rebuild
npm run build
rm -rf node_modules || true
# Install backend
cd $MIRTE_SRC_DIR/mirte-web-interface/nodejs-backend || exit 1
npm install .
deactivate_node
cd $MIRTE_SRC_DIR/mirte-web-interface
git clone https://github.com/dheera/rosboard.git --single-branch
sudo pip3 install tornado
sudo pip3 install simplejpeg # recommended, but ROSboard can fall back to cv2 or PIL instead
# Install wetty
#cd $MIRTE_SRC_DIR/mirte-web-interface
#npm -g install wetty
# Install strace for linetrace functionality
sudo apt install -y strace
sudo apt install xxd
# Install nginx (as reverse proxy to all services)
sudo apt install -y nginx libnginx-mod-http-auth-pam
sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx.conf /etc/nginx/sites-available/mirte.conf
sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/nginx_login.conf /etc/nginx/nginx_login.conf
sudo ln /etc/nginx/sites-available/mirte.conf /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default # otherwise this will catch :80 by default
# give nginx access to the passwords file for login
sudo usermod -aG shadow www-data
sudo cp $MIRTE_SRC_DIR/mirte-install-scripts/sites/401.html /var/www/html/
# Add systemd service
sudo rm /lib/systemd/system/mirte-web-interface.service || true
sudo ln -s $MIRTE_SRC_DIR/mirte-install-scripts/services/mirte-web-interface.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl stop mirte-web-interface || /bin/true
sudo systemctl start mirte-web-interface
sudo systemctl enable mirte-web-interface
# install zerotier for better ros2 networking. User will need to manually join the network
curl -s https://install.zerotier.com | sudo bash
# remove zerotier identity as it otherwise will be the same for all devices using the same image
sudo rm /var/lib/zerotier-one/identity.public || true
sudo rm /var/lib/zerotier-one/identity.secret || true
# new identity should be generated on first boot