mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +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
15
contrib/ui/nas-synology-dsm7.0/package/ui/login.html
Normal file
15
contrib/ui/nas-synology-dsm7.0/package/ui/login.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="/scripts/ext-3/adapter/ext/ext-base.js?v=1401997094"></script>
|
||||
<script type="text/javascript" src="/scripts/ext-3/ext-all.js?v=1401997094"></script>
|
||||
<script type="text/javascript" src="/webapi/entry.cgi?api=SYNO.API.Auth&version=6&method=synotoken"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
Ext.onReady(function () {
|
||||
window.location.assign(Ext.urlAppend("http://" + location.hostname + ":19019?origin=" + encodeURIComponent(window.location.origin)));
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
21
contrib/ui/nas-synology-dsm7.0/spk/conf/privilege
Normal file
21
contrib/ui/nas-synology-dsm7.0/spk/conf/privilege
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"defaults":{
|
||||
"run-as": "package"
|
||||
},
|
||||
"ctrl-script":[{
|
||||
"action": "postinst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "postuninst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "preuninst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "start",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "stop",
|
||||
"run-as": "root"
|
||||
}]
|
||||
}
|
120
contrib/ui/nas-synology-dsm7.0/spk/scripts/start-stop-status
Normal file
120
contrib/ui/nas-synology-dsm7.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 server in the background.
|
||||
${BASE}/bin/mesh -useconffile "$config_file" \
|
||||
-httpaddress "http://[::]: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