mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 22:55:06 +03:00
1. added multipath protocol and schema suport
2. added SCTP protocol and schema support 3. added set of NAS models support (Asustor, ReadyNAS, Drobo, QNAP, WD, Synology, Terramaster) 4. moved to fc00::/7 private segment 5. added Windows, MacOS and Linux UI for peers edit and current status
This commit is contained in:
parent
cfa293d189
commit
d8a4000141
198 changed files with 8589 additions and 697 deletions
5
contrib/ui/nas-synology-dsm6.0/spk/conf/resource
Normal file
5
contrib/ui/nas-synology-dsm6.0/spk/conf/resource
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"port-config": {
|
||||
"protocol-file": "mesh.sc"
|
||||
}
|
||||
}
|
17
contrib/ui/nas-synology-dsm6.0/spk/scripts/postinst
Normal file
17
contrib/ui/nas-synology-dsm6.0/spk/scripts/postinst
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
DEBUG=true
|
||||
SH="$(readlink /proc/$$/exe)"
|
||||
if $DEBUG ; then
|
||||
echo "" > /tmp/mesh.log
|
||||
exec 2>>/tmp/mesh.log
|
||||
SH="$SH -x"
|
||||
set -x
|
||||
fi
|
||||
|
||||
BASE="/var/packages/mesh/target"
|
||||
LOG_FILE="$BASE/var/log/mesh.log"
|
||||
|
||||
ln -sf $LOG_FILE $BASE/www/log
|
||||
ln -sf $BASE/dsm.mesh.conf /etc/nginx/conf.d/dsm.mesh.conf
|
||||
nginx -s reload
|
||||
exit 0
|
8
contrib/ui/nas-synology-dsm6.0/spk/scripts/postuninst
Normal file
8
contrib/ui/nas-synology-dsm6.0/spk/scripts/postuninst
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -f /var/run/mesh.pid
|
||||
LOG_SYMLINK=/var/log/mesh.log
|
||||
[ -L $LOG_SYMLINK ] && rm -f $LOG_SYMLINK
|
||||
rm -f /etc/nginx/conf.d/dsm.mesh.conf
|
||||
|
||||
exit 0
|
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/postupgrade
Normal file
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/postupgrade
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
exit 0
|
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preinst
Normal file
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preinst
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
exit 0
|
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preuninst
Normal file
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preuninst
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
exit 0
|
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preupgrade
Normal file
3
contrib/ui/nas-synology-dsm6.0/spk/scripts/preupgrade
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
exit 0
|
120
contrib/ui/nas-synology-dsm6.0/spk/scripts/start-stop-status
Normal file
120
contrib/ui/nas-synology-dsm6.0/spk/scripts/start-stop-status
Normal file
|
@ -0,0 +1,120 @@
|
|||
#!/bin/sh
|
||||
|
||||
BASE="/var/packages/mesh/target"
|
||||
CONFIG_DIR="/var/packages/mesh/etc"
|
||||
config_file="$CONFIG_DIR/mesh.conf"
|
||||
LOG_FILE="$BASE/var/log/mesh.log"
|
||||
export LD_LIBRARY_PATH="$BASE/lib"
|
||||
cd /
|
||||
|
||||
set_proxy()
|
||||
{
|
||||
if [ -f /etc/proxy.conf ]; then
|
||||
. /etc/proxy.conf
|
||||
if [ "$proxy_enabled" = "yes" ]; then
|
||||
export http_proxy="$https_host":"$https_port"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start_service ()
|
||||
{
|
||||
|
||||
set_proxy
|
||||
|
||||
if [ -f $config_file ]; then
|
||||
mkdir -p /var/backups
|
||||
echo "Backing up configuration file to /var/backups/mesh.conf.`date +%Y%m%d`"
|
||||
cp $config_file /var/backups/mesh.conf.`date +%Y%m%d`
|
||||
echo "Normalising and updating /etc/mesh.conf"
|
||||
${BASE}/bin/mesh -useconf -normaliseconf < /var/backups/mesh.conf.`date +%Y%m%d` > $config_file
|
||||
else
|
||||
echo "Generating initial configuration file $config_file"
|
||||
echo "Please familiarise yourself with this file before starting RiV-mesh"
|
||||
sh -c "umask 0027 && ${BASE}/bin/mesh -genconf > '$config_file'"
|
||||
fi
|
||||
|
||||
# Create the necessary file structure for /dev/net/tun
|
||||
if ( [ ! -c /dev/net/tun ] ); then
|
||||
if ( [ ! -d /dev/net ] ); then
|
||||
mkdir -m 755 /dev/net
|
||||
fi
|
||||
mknod /dev/net/tun c 10 200
|
||||
chmod 0755 /dev/net/tun
|
||||
fi
|
||||
|
||||
# Load the tun module if not already loaded
|
||||
if ( !(lsmod | grep -q "^tun\s") ); then
|
||||
insmod /lib/modules/tun.ko
|
||||
fi
|
||||
|
||||
#workaround for bin error:
|
||||
#Not multicasting on eth0 due to error: listen tcp [xxxx]:0: bind: cannot assign requested address
|
||||
sysctl net.ipv6.ip_nonlocal_bind=1
|
||||
|
||||
# Launch the mesh in the background.
|
||||
${BASE}/bin/mesh -useconffile "$config_file" \
|
||||
-httpaddress "http://localhost:19019" \
|
||||
-wwwroot "$BASE/www" \
|
||||
-logto "$BASE/var/log/mesh.log" &
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
stop_service ()
|
||||
{
|
||||
pid=`pidof -s mesh`
|
||||
if [ -z "$pid" ]; then
|
||||
echo "mesh was not running"
|
||||
exit 0
|
||||
fi
|
||||
kill "$pid"
|
||||
}
|
||||
|
||||
status_service ()
|
||||
{
|
||||
|
||||
pid=`pidof -s mesh`
|
||||
|
||||
if [[ ! -z "${pid}" ]] && [ -d /proc/${pid} ]; then
|
||||
return 0
|
||||
fi
|
||||
if [[ ! -z "${pid}" ]]; then
|
||||
return 1
|
||||
fi
|
||||
return 3
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start_service
|
||||
echo "Running RiV Mesh"
|
||||
exit 0
|
||||
;;
|
||||
stop)
|
||||
stop_service
|
||||
echo "Stopped RiV Mesh"
|
||||
exit 0
|
||||
;;
|
||||
status)
|
||||
status_service
|
||||
sts=$?
|
||||
if [ $sts -eq 0 ]; then
|
||||
echo "RiV Mesh is running"
|
||||
else
|
||||
echo "RiV Mesh is not running"
|
||||
fi
|
||||
exit $sts
|
||||
;;
|
||||
|
||||
log)
|
||||
if [ -f $LOG_FILE ];
|
||||
then
|
||||
echo $LOG_FILE
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue