We should automate the setup of these configurations, and also track all the necessary changes in order to implement a tear-down automation too. The idea is to use simoc-sam.py to automatically create/update all the necessary config files to set up any of these 3 setups, and also have commands to undo these changes.
This will allow to have a single base image and a single copy of the repo, and a simoc-sam.py command that we can use to switch configurations. In order to do this, it's probably easier to install all the dependencies in the base image, so that the configuration can be changed even without internet access.
In addition, we have another configuration that is not strictly network-related, and that theoretically can be used with all the 3 modes, i.e. setting up Nginx to serve the SIMOC web frontend.
SIMOC web server
deps: nginx
changes:
remove /etc/nginx/sites-enabled/default
create /etc/nginx/sites-available/simoc_live (see wiki)
A couple of setup/teardown commands for simoc-sam.py should be added to enable/disable this configuration. For this we could also install nginx, clone the simoc-web repo, and configure the simoc_live site and then just use the simoc-sam.py commands to start/stop the nginx service, since this configuration shouldn't interfere with anything else (unlike the different networking configurations that conflict with each other). If in the future we add some other configuration that uses nginx, we can just update the simoc-sam.py commands to create and destroy the simoc_live symlink in sites-enabled while keeping all the different configurations in sites-available.
We currently want to support different possible network configurations:
batctl
start-batman-adv.sh
(see wiki)/etc/network/interfaces.d/bat0
/etc/network/interfaces.d/wlan0
(?)/etc/hosts
/etc/modules
batman-adv
/etc/dhcpcd.conf
denyinterfaces wlan0
/etc/rc.local
python3 /home/pi/simoc-sam/simoc-sam.py fix-ip
/home/pi/start-batman-adv.sh &
101
105
We should automate the setup of these configurations, and also track all the necessary changes in order to implement a tear-down automation too. The idea is to use
simoc-sam.py
to automatically create/update all the necessary config files to set up any of these 3 setups, and also have commands to undo these changes.This will allow to have a single base image and a single copy of the repo, and a
simoc-sam.py
command that we can use to switch configurations. In order to do this, it's probably easier to install all the dependencies in the base image, so that the configuration can be changed even without internet access.In addition, we have another configuration that is not strictly network-related, and that theoretically can be used with all the 3 modes, i.e. setting up Nginx to serve the SIMOC web frontend.
nginx
/etc/nginx/sites-enabled/default
/etc/nginx/sites-available/simoc_live
(see wiki)/etc/nginx/sites-enabled/simoc_live
(symlink)A couple of setup/teardown commands for
simoc-sam.py
should be added to enable/disable this configuration. For this we could also install nginx, clone the simoc-web repo, and configure thesimoc_live
site and then just use thesimoc-sam.py
commands to start/stop the nginx service, since this configuration shouldn't interfere with anything else (unlike the different networking configurations that conflict with each other). If in the future we add some other configuration that uses nginx, we can just update thesimoc-sam.py
commands to create and destroy thesimoc_live
symlink insites-enabled
while keeping all the different configurations insites-available
.