forked from hello-robot/stretch_web_interface
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from hcrlab/upstream
Upstream
- Loading branch information
Showing
16 changed files
with
536 additions
and
2,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
echo "****************************************" | ||
echo "attempt to bring up server production environment" | ||
|
||
echo "" | ||
echo "first making sure that the system is fully shutdown prior to bringing it up" | ||
echo "./stop_server_production__env.sh" | ||
./stop_server_production__env.sh | ||
|
||
echo "" | ||
echo "set environment variable for development environment" | ||
echo "export HELLO_ROBOT_ENV=\"production\"" | ||
export HELLO_ROBOT_ENV="production" | ||
|
||
echo "" | ||
echo "attempting to start MongoDB..." | ||
echo "sudo systemctl start mongod.service" | ||
sudo systemctl start mongod.service | ||
|
||
echo "" | ||
echo "attempting to start Redis..." | ||
echo "sudo systemctl start redis.service" | ||
sudo systemctl start redis.service | ||
|
||
echo "" | ||
echo "attempting to start the web server..." | ||
echo "cd /home/ubuntu/repos/stretch_web_interface/" | ||
cd /home/ubuntu/repos/stretch_web_interface/ | ||
echo "sudo --preserve-env node ./bin/www &" | ||
sudo --preserve-env node ./bin/www & | ||
|
||
echo "" | ||
echo "finished attempt to bring up server production environment" | ||
echo "****************************************" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
echo "****************************************" | ||
echo "attempt to stop server production environment" | ||
|
||
echo "" | ||
echo "remove environment variable for server production environment" | ||
echo "unset HELLO_ROBOT_ENV" | ||
sudo unset HELLO_ROBOT_ENV | ||
|
||
echo "" | ||
echo "attempting to stop MongoDB..." | ||
echo "sudo systemctl stop mongod.service" | ||
sudo systemctl stop mongod.service | ||
|
||
echo "" | ||
echo "attempting to stop Redis..." | ||
echo "sudo systemctl stop redis.service" | ||
sudo systemctl stop redis.service | ||
|
||
echo "" | ||
echo "attempting to stop the web server..." | ||
echo "pkill -f \"node ./bin/www\"" | ||
sudo pkill -f "node ./bin/www" | ||
|
||
echo "" | ||
echo "finished attempt to stop the server production environment" | ||
echo "****************************************" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
echo "" | ||
echo "Starting web server installation script." | ||
|
||
# APT UPDATE | ||
echo "" | ||
echo "Updating with apt." | ||
sudo apt-get --yes update | ||
echo "Done." | ||
|
||
# NODE 14 | ||
echo "" | ||
echo "Installing Node.js 14" | ||
echo "Downloading from the Internet via curl." | ||
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - | ||
echo "Installing nodejs with apt-get" | ||
sudo apt-get install -y nodejs | ||
echo "Done." | ||
|
||
# PACKAGES VIA NPM | ||
echo "" | ||
echo "Installing web-interface Node packages using npm." | ||
cd ~/repos/stretch_web_interface/ | ||
echo "Update to latest version of npm." | ||
sudo npm install -g npm | ||
echo "Install packages with npm." | ||
sudo npm install | ||
echo "Done." | ||
|
||
# MONGODB | ||
echo "" | ||
echo "Installing MongoDB, which is used to store credentials for robot and operator logins." | ||
sudo apt-get --yes install mongodb | ||
echo "Done." | ||
|
||
# CHECK MONGODB | ||
echo "" | ||
echo "Look at the following output to make sure the mongodb service is working." | ||
systemctl status mongodb | ||
|
||
# REDIS | ||
echo "" | ||
echo "Install redis for the web server." | ||
sudo apt-get --yes install redis | ||
echo "Done." | ||
|
||
# COTURN | ||
echo "" | ||
echo "Install coturn for the web server." | ||
sudo apt-get --yes install coturn | ||
echo "Setup coturn.service." | ||
sudo cp ~/repos/stretch_web_interface/coturn.service /etc/systemd/system/ | ||
echo "Done." | ||
|
||
|
||
echo "" | ||
echo "The web server installation script has finished." | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Coturn STUN and TURN server | ||
After=syslog.target network.target | ||
|
||
[Service] | ||
Type=forking | ||
PIDFile=/var/run/turnserver.pid | ||
ExecStart=/usr/bin/turnserver -c /etc/turnserver.conf -o -v | ||
Restart=on-failure | ||
IgnoreSIGPIPE=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.