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:
vadym 2022-10-27 22:03:37 +03:00
parent cfa293d189
commit d8a4000141
198 changed files with 8589 additions and 697 deletions

View file

@ -0,0 +1,14 @@
location = /mesh {
return 301 /mesh/;
}
location ~ ^/mesh/ {
rewrite ^/mesh/(.*) /$1 break;
proxy_pass http://127.0.0.1:19019;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For-Addr $server_addr;
proxy_set_header X-Forwarded-For-Port $server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Original-URI $request_uri;
}

View file

@ -0,0 +1,5 @@
[mesh]
title="HTTP"
desc="RiV Mesh Web interface"
port_forward="no"
dst.ports="19019/tcp"

View file

@ -0,0 +1,11 @@
{
".url": {
"org.mesh": {
"type": "url",
"title": "RiV Mesh",
"desc": "ipv6 mesh network",
"icon": "mesh-{0}.png",
"url": "/webman/3rdparty/mesh/login.html"
}
}
}

View file

@ -0,0 +1,18 @@
<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="/webman/dsmtoken.cgi"></script>
</head>
<body>
<script>
Ext.onReady(function () {
if (Ext.isEmpty(SYNO.SDS.Session)) {
window.location.assign("/webman");
} else {
window.location.assign(Ext.urlAppend(window.location.origin + "/mesh/"));
}
});
</script>
</body>
</html>

View file

@ -0,0 +1,7 @@
#!/bin/sh
echo vendor=Synology
echo vendorOperatingSystemName=DSM
. /etc.defaults/VERSION
echo firmwareVersion="${productversion}-${buildnumber}"
echo $(cat /etc/avahi/services/dsminfo.service | grep model | sed -e 's/<[^>]*>//g;s/^ *//')
echo $(cat /etc/avahi/services/dsminfo.service | grep serial | sed -e 's/<[^>]*>//g;s/^ *//')

View file

@ -0,0 +1,22 @@
#!/bin/sh
export CONTENT_LENGTH=$HTTP_CONTENT_LENGTH
export CONTENT_TYPE=$HTTP_CONTENT_TYPE
IFS=';'
for x in $HTTP_COOKIE
do
case $x in
*EdSynoToken*)
eval $x
;;
esac
done
[ -z $QUERY_STRING ] && export QUERY_STRING=SynoToken=$EdSynoToken || export QUERY_STRING="$QUERY_STRING&SynoToken=$EdSynoToken"
[ ! -z $HTTP_X_REAL_IP ] && export REMOTE_ADDR=$HTTP_X_REAL_IP
[ ! -z $HTTP_X_FORWARDED_FOR_ADDR ] && export SERVER_ADDR=$HTTP_X_FORWARDED_FOR_ADDR
[ ! -z $HTTP_X_FORWARDED_FOR_PORT ] && export SERVER_PORT=$HTTP_X_FORWARDED_FOR_PORT
#exit with zero status on auth success and 1 on error
[ ! -z $(/usr/syno/synoman/webman/modules/authenticate.cgi) ]
exit $?

View file

@ -0,0 +1,10 @@
#!/bin/sh
log_exit(){
echo $2
exit $1
}
rm "$ED_APP_ROOT/bin/mesh
rm -rf "$ED_APP_ROOT/www"
rm -rf "$ED_APP_ROOT/ui"

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -0,0 +1,81 @@
var ed = {
partnerId: 1126,
brand: 'RiV Mesh',
applicationName: 'RiV Mesh Synology DSM App',
nasOSName: 'Synology DSM',
nasVisitEDWebsiteLogin: "https://github.com/RiV-chain/RiV-mesh",
nasVisitEDWebsiteSignup: "https://github.com/RiV-chain/RiV-mesh",
nasVisitEDWebsiteLoggedin: "https://github.com/RiV-chain/RiV-mesh",
getCookie: function (name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
},
setCookie: function (key, value, expires) {
if(expires) {
var d = new Date();
d.setTime(d.getTime() + (30 * 60 * 1000));
expires = "; expires=" + d.toUTCString();
} else {
expires = "";
}
document.cookie = key + "=" + value + expires + "; path=/";
},
getNasAuthUrl: function () {
ed.setCookie('EdSynoToken', "");
var url = ed.getCookie('origin');
if (url === undefined) {
url = window.location.protocol + "//" + window.location.hostname + ":" + 5000;
}
return url;
}
};
$(function () {
function params(obj) {
if (typeof obj === 'string') {
if (obj[0] === '?') {
obj = obj.substring(1);
}
var result = {};
obj = obj.split("&");
obj.forEach(function (pair) {
pair = pair.split("=");
var key = decodeURIComponent(pair[0]);
var value = decodeURIComponent(pair[1]);
// If first entry with this name
if (typeof result[key] === "undefined") {
result[key] = value;
// If second entry with this name
} else if (typeof result[key] === "string") {
result[key] = [result[key], value];
// If third or later entry with this name
} else {
result[key].push(value);
}
});
return result;
} else {
return Object.keys(obj).map(function (key) {
return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
}).join('&');
}
};
//Hide URL parameters
var query = params(window.location.search.substring(1));
var refresh = false;
for (var k in query) {
if (k === 'SynoToken') {
ed.setCookie('EdSynoToken', query[k]);
refresh = true;
delete query[k];
} else if (k === 'origin') {
ed.setCookie('origin', query[k]);
refresh = true;
delete query[k];
}
}
query = $.param(query);
if (refresh)
window.location.replace(window.location.origin + window.location.pathname + window.location.hash + ((query === "") ? "" : ("?" + query)));
});