mirror of https://github.com/EdgeVPNio/tools.git
Modified and cleaned up code
1) Removed the symlink and the old setup file. 2) debpak now creates a out folder and creates the debian package in it. 3) Shortened the names of some options.pull/4/head
parent
408431acb3
commit
73e423981a
|
@ -1 +0,0 @@
|
||||||
./scripts/evtool-v20.7.2
|
|
14
evt-tools.py
14
evt-tools.py
|
@ -28,24 +28,24 @@ class EvtTools:
|
||||||
help="Install openfire server.")
|
help="Install openfire server.")
|
||||||
parser.add_argument("--build_docker", action="store_true", default=False, dest="dkrimg",
|
parser.add_argument("--build_docker", action="store_true", default=False, dest="dkrimg",
|
||||||
help="Builds the docker image if you have already built the debian package.")
|
help="Builds the docker image if you have already built the debian package.")
|
||||||
parser.add_argument("--build_webrtc", action="store_true", default=False, dest="webrtc",
|
parser.add_argument("--build_wrtc", action="store_true", default=False, dest="webrtc",
|
||||||
help="Clones and builds the webrtc libraries for ubuntu and returns a debug build.")
|
help="Clones and builds the webrtc libraries for ubuntu and returns a debug build.")
|
||||||
parser.add_argument("--build_webrtc_release", action="store_true", default=False, dest="webrtc_r",
|
parser.add_argument("--build_wrtc_rel", action="store_true", default=False, dest="webrtc_r",
|
||||||
help="Clones and builds the webrtc libraries for ubuntu and returns a release build.")
|
help="Clones and builds the webrtc libraries for ubuntu and returns a release build.")
|
||||||
parser.add_argument("--build_webrtc_raspberry_debug", action="store_true", default=False, dest="webrtc_r_d",
|
parser.add_argument("--build_wrtc_rpi_dbg", action="store_true", default=False, dest="webrtc_r_d",
|
||||||
help="Clones and builds the webrtc libraries for raspberry and returns a debug build.")
|
help="Clones and builds the webrtc libraries for raspberry and returns a debug build.")
|
||||||
parser.add_argument("--build_webrtc_raspberry_release", action="store_true", default=False, dest="webrtc_r_r",
|
parser.add_argument("--build_wrtc_rpi_rel", action="store_true", default=False, dest="webrtc_r_r",
|
||||||
help="Clones and builds the webrtc libraries for raspberry and returns a release build.")
|
help="Clones and builds the webrtc libraries for raspberry and returns a release build.")
|
||||||
parser.add_argument("--build_tincan", action="store_true", default=False, dest="tincan",
|
parser.add_argument("--build_tincan", action="store_true", default=False, dest="tincan",
|
||||||
help="Builds the tincan debug executable for ubuntu. It assumes you have the webrtc "
|
help="Builds the tincan debug executable for ubuntu. It assumes you have the webrtc "
|
||||||
"libraries already cloned or built")
|
"libraries already cloned or built")
|
||||||
parser.add_argument("--build_tincan_release", action="store_true", default=False, dest="tincan_r",
|
parser.add_argument("--build_tincan_rel", action="store_true", default=False, dest="tincan_r",
|
||||||
help="Builds the tincan release executable for ubuntu. It assumes you have the webrtc "
|
help="Builds the tincan release executable for ubuntu. It assumes you have the webrtc "
|
||||||
"libraries already cloned or built")
|
"libraries already cloned or built")
|
||||||
parser.add_argument("--build_tincan_raspberry_debug", action="store_true", default=False, dest="tincan_r_d",
|
parser.add_argument("--build_tincan_rpi_dbg", action="store_true", default=False, dest="tincan_r_d",
|
||||||
help="Builds the tincan debug executable for raspberry. It assumes you have the webrtc "
|
help="Builds the tincan debug executable for raspberry. It assumes you have the webrtc "
|
||||||
"libraries already cloned or built")
|
"libraries already cloned or built")
|
||||||
parser.add_argument("--build_tincan_raspberry_release", action="store_true", default=False, dest="tincan_r_r",
|
parser.add_argument("--build_tincan_rpi_rel", action="store_true", default=False, dest="tincan_r_r",
|
||||||
help="Builds the tincan release executable for raspberry. It assumes you have the webrtc "
|
help="Builds the tincan release executable for raspberry. It assumes you have the webrtc "
|
||||||
"libraries already cloned or built")
|
"libraries already cloned or built")
|
||||||
parser.add_argument("--all", action="store_true", default=False, dest="all",
|
parser.add_argument("--all", action="store_true", default=False, dest="all",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
EVIO=https://github.com/EdgeVPNio/evio.git
|
EVIO=https://github.com/EdgeVPNio/evio.git
|
||||||
#EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git
|
EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git
|
||||||
PY=python3.8
|
PY=python3.8
|
||||||
|
|
||||||
function install_build_tools
|
function install_build_tools
|
||||||
|
@ -35,19 +35,23 @@ function make_tincan
|
||||||
function make_debpak
|
function make_debpak
|
||||||
{
|
{
|
||||||
wd=$(pwd)
|
wd=$(pwd)
|
||||||
cp ../evio/controller/Controller.py debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
cd ../../..
|
||||||
mkdir -p debian-package/edge-vpnio/etc/opt/edge-vpnio/
|
mkdir -p out
|
||||||
cp ../evio/controller/template-config.json debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
cd $wd
|
||||||
cp -r ../evio/controller/modules/ ../evio/controller/framework/ debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
cp ../debian-package ../../../out
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
|
cp ../evio/controller/Controller.py ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
|
mkdir -p ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
|
cp ../evio/controller/template-config.json ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
|
cp -r ../evio/controller/modules/ ../evio/controller/framework/ ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
|
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
|
||||||
chmod 0664 debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
|
||||||
cp ../evio/tincan/trunk/out/release/x86_64/tincan debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/tincan && \
|
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
|
||||||
cd debian-package/ && \
|
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
|
||||||
|
chmod 0664 ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
||||||
|
cp ../evio/tincan/trunk/out/release/x86_64/tincan ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
||||||
|
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/tincan && \
|
||||||
|
cd ../../../out/debian-package/ && \
|
||||||
./deb-gen && \
|
./deb-gen && \
|
||||||
rm -rf edge-vpnio/opt/edge-vpnio/framework \
|
rm -rf edge-vpnio/opt/edge-vpnio/framework \
|
||||||
edge-vpnio/opt/edge-vpnio/modules \
|
edge-vpnio/opt/edge-vpnio/modules \
|
||||||
|
@ -128,8 +132,8 @@ function do_clean
|
||||||
make clean;
|
make clean;
|
||||||
cd $wd
|
cd $wd
|
||||||
#debian pak
|
#debian pak
|
||||||
cd debian-package/ && \
|
cd ../debian-package/ && \
|
||||||
rm -ri ./../edge-vpnio_20.7_amd64.deb \
|
rm -ri ./edge-vpnio_20.7_amd64.deb \
|
||||||
edge-vpnio/opt/edge-vpnio/framework \
|
edge-vpnio/opt/edge-vpnio/framework \
|
||||||
edge-vpnio/opt/edge-vpnio/modules \
|
edge-vpnio/opt/edge-vpnio/modules \
|
||||||
edge-vpnio/opt/edge-vpnio/tincan \
|
edge-vpnio/opt/edge-vpnio/tincan \
|
||||||
|
|
193
setup
193
setup
|
@ -1,193 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
EVIO=https://github.com/EdgeVPNio/evio.git
|
|
||||||
EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git
|
|
||||||
PY=python3.8
|
|
||||||
|
|
||||||
function install_build_tools
|
|
||||||
{
|
|
||||||
sudo bash -c "
|
|
||||||
apt-get update -y && \
|
|
||||||
apt-get install -y git \
|
|
||||||
make clang libc++-dev libssl-dev $PY"
|
|
||||||
}
|
|
||||||
|
|
||||||
function pull_src
|
|
||||||
{
|
|
||||||
wd=$(pwd)
|
|
||||||
cd ..
|
|
||||||
#stat evio dir clone or pull
|
|
||||||
git clone $EVIO
|
|
||||||
cd evio/tincan/external
|
|
||||||
#
|
|
||||||
git clone -b ubuntu-x64 --single-branch https://github.com/ipop-project/3rd-Party-Libs.git
|
|
||||||
cd $wd
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_tincan
|
|
||||||
{
|
|
||||||
wd=$(pwd)
|
|
||||||
cd ../evio/tincan/trunk/build
|
|
||||||
make clean; make
|
|
||||||
cd $wd
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_debpak
|
|
||||||
{
|
|
||||||
wd=$(pwd)
|
|
||||||
cp ../evio/controller/Controller.py debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
|
||||||
mkdir -p debian-package/edge-vpnio/etc/opt/edge-vpnio/
|
|
||||||
cp ../evio/controller/template-config.json debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
|
||||||
cp -r ../evio/controller/modules/ ../evio/controller/framework/ debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
|
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
|
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
|
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
|
|
||||||
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
|
|
||||||
chmod 0664 debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
|
|
||||||
cp ../evio/tincan/trunk/out/release/x86_64/tincan debian-package/edge-vpnio/opt/edge-vpnio/ && \
|
|
||||||
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/tincan && \
|
|
||||||
cd debian-package/ && \
|
|
||||||
./deb-gen && \
|
|
||||||
rm -rf edge-vpnio/opt/edge-vpnio/framework \
|
|
||||||
edge-vpnio/opt/edge-vpnio/modules \
|
|
||||||
edge-vpnio/opt/edge-vpnio/tincan \
|
|
||||||
edge-vpnio/opt/edge-vpnio/template-config.json \
|
|
||||||
edge-vpnio/opt/edge-vpnio/Controller.py \
|
|
||||||
edge-vpnio/etc/opt/edge-vpnio/config.json
|
|
||||||
cd $wd
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_testbed_deps
|
|
||||||
{
|
|
||||||
sudo bash -c "
|
|
||||||
apt-get update -y && \
|
|
||||||
apt-get install -y openvswitch-switch \
|
|
||||||
$PY python3-pip python3-venv python3-dev \
|
|
||||||
apt-transport-https \
|
|
||||||
ca-certificates \
|
|
||||||
curl git \
|
|
||||||
software-properties-common && \
|
|
||||||
|
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
|
||||||
add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable\" && \
|
|
||||||
apt-cache policy docker-ce && \
|
|
||||||
apt-get install -y containerd.io \
|
|
||||||
docker-ce-cli \
|
|
||||||
docker-ce && \
|
|
||||||
groupadd -f docker && \
|
|
||||||
usermod -a -G docker $USER \
|
|
||||||
"
|
|
||||||
echo "You must logout and relogin for docker group membership to take effect."
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_venv
|
|
||||||
{
|
|
||||||
wd=$(pwd)
|
|
||||||
cd testbed && \
|
|
||||||
$PY -m venv venv && \
|
|
||||||
source venv/bin/activate && \
|
|
||||||
pip3 install simplejson
|
|
||||||
cd $wd
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_dkrimg
|
|
||||||
{
|
|
||||||
mv debian-package/edge-vpnio_20.7_amd64.deb docker-image/ && \
|
|
||||||
docker build -f ./docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.0 ./docker-image && \
|
|
||||||
docker build -f ./docker-image/evio-node.Dockerfile -t edgevpnio/evio-node:20.7.3 ./docker-image
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_openfire
|
|
||||||
{
|
|
||||||
docker run --name openfire -d \
|
|
||||||
-p 9090:9090 -p 5222:5222 \
|
|
||||||
-p 5269:5269 -p 5223:5223 \
|
|
||||||
-p 7443:7443 -p 7777:7777 \
|
|
||||||
-p 7070:7070 -p 5229:5229 \
|
|
||||||
-p 5275:5275 \
|
|
||||||
edgevpnio/openfire_edgevpn_demo
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_portal
|
|
||||||
{
|
|
||||||
#Todo: visualizer not yet available
|
|
||||||
git clone https://github.com/edgevpnio/portal.git
|
|
||||||
cd portal/setup
|
|
||||||
./setup.sh
|
|
||||||
chown -R $USER /users/$USER/
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_clean
|
|
||||||
{
|
|
||||||
# tincan
|
|
||||||
wd=$(pwd)
|
|
||||||
cd ../evio/tincan/trunk/build
|
|
||||||
make clean;
|
|
||||||
cd $wd
|
|
||||||
#debian pak
|
|
||||||
cd debian-package/ && \
|
|
||||||
rm -ri ./edge-vpnio_20.7_amd64.deb \
|
|
||||||
edge-vpnio/opt/edge-vpnio/framework \
|
|
||||||
edge-vpnio/opt/edge-vpnio/modules \
|
|
||||||
edge-vpnio/opt/edge-vpnio/tincan \
|
|
||||||
edge-vpnio/opt/edge-vpnio/template-config.json \
|
|
||||||
edge-vpnio/opt/edge-vpnio/Controller.py && \
|
|
||||||
cd $wd
|
|
||||||
# docker-image
|
|
||||||
rm -f docker-image/edge-vpnio_20.7_amd64.deb
|
|
||||||
docker rmi edgevpnio/evio-base:1.0 edgevpnio/evio-node:20.7
|
|
||||||
docker rmi $(docker images -q --filter "dangling=true")
|
|
||||||
# testbed
|
|
||||||
cd testbed
|
|
||||||
rm -rf config log cert venv
|
|
||||||
cd $wd
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_full_setup
|
|
||||||
{
|
|
||||||
install_build_tools
|
|
||||||
pull_src
|
|
||||||
make_tincan
|
|
||||||
make_debpak
|
|
||||||
make_dkrimg
|
|
||||||
make_testbed_prereqs
|
|
||||||
make_venv
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
deps)
|
|
||||||
install_build_tools
|
|
||||||
;;
|
|
||||||
src)
|
|
||||||
pull_src
|
|
||||||
;;
|
|
||||||
tincan)
|
|
||||||
make_tincan
|
|
||||||
;;
|
|
||||||
debpak)
|
|
||||||
make_debpak
|
|
||||||
;;
|
|
||||||
dkrimg)
|
|
||||||
make_dkrimg
|
|
||||||
;;
|
|
||||||
testbed)
|
|
||||||
install_testbed_deps
|
|
||||||
;;
|
|
||||||
venv)
|
|
||||||
make_venv
|
|
||||||
;;
|
|
||||||
xmpp)
|
|
||||||
install_openfire
|
|
||||||
;;
|
|
||||||
clean)
|
|
||||||
do_clean
|
|
||||||
;;
|
|
||||||
all)
|
|
||||||
do_full_setup
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "no match on input -> $1"
|
|
||||||
;;
|
|
||||||
esac
|
|
13
setup-evt.sh
13
setup-evt.sh
|
@ -1,7 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
sudo apt install -y python3.8 python3.8-dev python3.8-venv python3-pip
|
||||||
|
ls /usr/bin/python*
|
||||||
|
update-alternatives --display python
|
||||||
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
|
||||||
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 20
|
||||||
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 30
|
||||||
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 40
|
||||||
|
update-alternatives --display python
|
||||||
|
python -V
|
||||||
deactivate 2>/dev/null
|
deactivate 2>/dev/null
|
||||||
python -m venv myenv && \
|
python -m venv venv && \
|
||||||
source myenv/bin/activate && \
|
source venv/bin/activate && \
|
||||||
export PATH="$PATH:." && \
|
export PATH="$PATH:." && \
|
||||||
chmod 775 ./evt && \
|
chmod 775 ./evt && \
|
||||||
pip3 install gitpython simplejson
|
pip3 install gitpython simplejson
|
||||||
|
|
Loading…
Reference in New Issue