mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15: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
				
			
		| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
RedirectMatch 301 ^/mesh$ /mesh/
 | 
			
		||||
LoadModule proxy_http_module modules/mod_proxy_http.so
 | 
			
		||||
 | 
			
		||||
<Location /mesh/>
 | 
			
		||||
	ProxyPreserveHost On
 | 
			
		||||
	ProxyPass "http://127.0.0.1:19019/"
 | 
			
		||||
	ProxyPassReverse "http://127.0.0.1:19019/"
 | 
			
		||||
</Location>
 | 
			
		||||
							
								
								
									
										11
									
								
								contrib/ui/nas-westerndigital/package/mesh/clean.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								contrib/ui/nas-westerndigital/package/mesh/clean.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "clean.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
rm -f /usr/bin/mesh
 | 
			
		||||
rm -f /usr/bin/meshctl
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
rm -rf /var/www/mesh
 | 
			
		||||
rm -f /usr/local/apache2/conf/extra/apache-mesh.conf
 | 
			
		||||
							
								
								
									
										34
									
								
								contrib/ui/nas-westerndigital/package/mesh/init.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										34
									
								
								contrib/ui/nas-westerndigital/package/mesh/init.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,34 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
install_path="$1"
 | 
			
		||||
config_file=$install_path/mesh.conf
 | 
			
		||||
backup_config_file=/var/backups/mesh.conf
 | 
			
		||||
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "init.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
exec 2>>/var/log/mesh.log
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
mkdir -p /var/www/mesh
 | 
			
		||||
 | 
			
		||||
# Binaries
 | 
			
		||||
ln -s "$install_path/bin/mesh" /usr/bin
 | 
			
		||||
ln -s "$install_path/bin/meshctl" /usr/bin
 | 
			
		||||
 | 
			
		||||
# Web, probably, the app wil serve it by embedded server
 | 
			
		||||
ln -s "$install_path/www/mesh.png" /var/www/mesh
 | 
			
		||||
ln -s "$install_path/www/index.html" /var/www/mesh
 | 
			
		||||
 | 
			
		||||
if [ -f $backup_config_file ]; then
 | 
			
		||||
  echo "Backing up configuration file to /var/backups/mesh.conf"
 | 
			
		||||
  echo "Normalising and updating /etc/mesh.conf"
 | 
			
		||||
  mesh -useconf -normaliseconf < $backup_config_file > $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 && mesh -genconf > '$config_file'"
 | 
			
		||||
  mkdir -p /var/backups
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cp $config_file $backup_config_file
 | 
			
		||||
							
								
								
									
										20
									
								
								contrib/ui/nas-westerndigital/package/mesh/install.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										20
									
								
								contrib/ui/nas-westerndigital/package/mesh/install.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
INST_PATH=/mnt/HD/HD_a2/Nas_Prog/mesh
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "install.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
path_src="$1"
 | 
			
		||||
path_dst="$2"
 | 
			
		||||
 | 
			
		||||
rm -rf "$INST_PATH"
 | 
			
		||||
mv "$path_src" "$path_dst"
 | 
			
		||||
#LOG_SYMLINK
 | 
			
		||||
ln -s "$INST_PATH"/var/log/mesh.log "$INST_PATH"/www/log
 | 
			
		||||
#already installed in start
 | 
			
		||||
#ln -s "$INST_PATH"/apache-mesh.conf /usr/local/apache2/conf/extra
 | 
			
		||||
 | 
			
		||||
echo "install.sh: setting permissions to '$path_dst/mesh'" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
chown -R nobody:share "$path_dst/mesh"
 | 
			
		||||
 | 
			
		||||
#( sleep 2 ; /usr/sbin/apache restart web ) &
 | 
			
		||||
							
								
								
									
										11
									
								
								contrib/ui/nas-westerndigital/package/mesh/preinst.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								contrib/ui/nas-westerndigital/package/mesh/preinst.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# Write to a different log, because main log will be overwritten by install.sh
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh-preinst.log
 | 
			
		||||
echo "preinst.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
path_dst="$1"
 | 
			
		||||
echo "path_dst=$path_dst" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
chown -R nobody:share "$path_dst"
 | 
			
		||||
							
								
								
									
										10
									
								
								contrib/ui/nas-westerndigital/package/mesh/remove.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								contrib/ui/nas-westerndigital/package/mesh/remove.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "remove.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
inst_path="$1"
 | 
			
		||||
 | 
			
		||||
rm -f /usr/bin/mesh
 | 
			
		||||
rm -f /usr/bin/meshctl
 | 
			
		||||
rm -fr /var/www/mesh
 | 
			
		||||
rm -fr "$inst_path"
 | 
			
		||||
							
								
								
									
										24
									
								
								contrib/ui/nas-westerndigital/package/mesh/start.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										24
									
								
								contrib/ui/nas-westerndigital/package/mesh/start.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "start.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
pid=`pidof -s mesh`
 | 
			
		||||
if [ -n "$pid" ]; then
 | 
			
		||||
  echo "start.sh: mesh already running" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
  exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
EXE_PATH=`readlink -f /usr/bin/mesh`
 | 
			
		||||
BIN_PATH=`dirname $EXE_PATH`
 | 
			
		||||
INSTALL_PATH=`dirname $BIN_PATH`
 | 
			
		||||
config_file=$INSTALL_PATH/mesh.conf
 | 
			
		||||
 | 
			
		||||
ln -fs "$INSTALL_PATH"/apache-mesh.conf /usr/local/apache2/conf/extra
 | 
			
		||||
(/usr/sbin/apache restart web ) &
 | 
			
		||||
 | 
			
		||||
START_COMMAND="/usr/bin/mesh -useconffile '$config_file' -httpaddress 'http://localhost:19019' -wwwroot '${INSTALL_PATH}/www' -logto '${INSTALL_PATH}/var/log/mesh.log'"
 | 
			
		||||
echo "start.sh: starting (START_COMMAND=$START_COMMAND)" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
(/usr/bin/mesh -useconffile "$config_file" -httpaddress "http://localhost:19019" -wwwroot "${INSTALL_PATH}/www" -logto "${INSTALL_PATH}/var/log/mesh.log") &
 | 
			
		||||
							
								
								
									
										47
									
								
								contrib/ui/nas-westerndigital/package/mesh/stop.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								contrib/ui/nas-westerndigital/package/mesh/stop.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
MESH_PACKAGE_LOG=/var/log/mesh.log
 | 
			
		||||
echo "stop.sh called" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
 | 
			
		||||
rm -f /usr/local/apache2/conf/extra/apache-mesh.conf
 | 
			
		||||
(/usr/sbin/apache restart web ) &
 | 
			
		||||
 | 
			
		||||
# ash is VERY limited, so use only basic ops
 | 
			
		||||
pid=`pidof -s mesh`
 | 
			
		||||
if [ -z "$pid" ]; then
 | 
			
		||||
  echo "stop.sh: mesh was not running" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
  exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "stop.sh: stop attempt #1" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
kill "$pid"
 | 
			
		||||
sleep 2
 | 
			
		||||
 | 
			
		||||
pid=`pidof -s mesh`
 | 
			
		||||
if [ -z "$pid" ]; then
 | 
			
		||||
  echo "stop.sh: stopped" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
  exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "stop.sh: stop attempt #2" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
kill "$pid"
 | 
			
		||||
sleep 4
 | 
			
		||||
 | 
			
		||||
pid=`pidof -s mesh`
 | 
			
		||||
if [ -z "$pid" ]; then
 | 
			
		||||
  echo "stop.sh: stopped" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
  exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "stop.sh: stop attempt #3" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
kill "$pid"
 | 
			
		||||
sleep 4
 | 
			
		||||
 | 
			
		||||
pid=`pidof -s mesh`
 | 
			
		||||
if [ -z "$pid" ]; then
 | 
			
		||||
  echo "stop.sh: stopped" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
  exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "stop.sh: hard kill" >> "$MESH_PACKAGE_LOG"
 | 
			
		||||
pkill -9 mesh
 | 
			
		||||
							
								
								
									
										7
									
								
								contrib/ui/nas-westerndigital/package/mesh/ui/desc.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								contrib/ui/nas-westerndigital/package/mesh/ui/desc.xml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?> 
 | 
			
		||||
<config>   
 | 
			
		||||
	<en-US><![CDATA[RiV-mesh is an early-stage implementation of a fully end-to-end encrypted IPv6
 | 
			
		||||
 network. It is lightweight, self-arranging, supported on multiple platforms and
 | 
			
		||||
 allows pretty much any IPv6-capable application to communicate securely with
 | 
			
		||||
 other RiV-mesh nodes. <a href="https://github.com/RiV-chain/RiV-mesh" target="_blank">Learn more here</a>...]]></en-US>
 | 
			
		||||
</config>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
echo vendor=westerndigital
 | 
			
		||||
echo vendorOperatingSystemName=WDMyCloud
 | 
			
		||||
echo firmwareVersion=$(cat /etc/version)
 | 
			
		||||
echo model=$(cat /etc/nas/nasdevice.xml | grep modelName | sed -e 's/<[^>]*>//g;s/^[ \t]*//')
 | 
			
		||||
echo serial=$(cat /etc/nas/nasdevice.xml | grep serialNumber | sed -e 's/<[^>]*>//g;s/^[ \t]*//')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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: 2.7 KiB  | 
							
								
								
									
										9
									
								
								contrib/ui/nas-westerndigital/package/mesh/www/assets/partner.css
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								contrib/ui/nas-westerndigital/package/mesh/www/assets/partner.css
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
.nas-apps-config-form-app-logo {
 | 
			
		||||
	height: 110px;
 | 
			
		||||
	background: url(logo.png) left center no-repeat;
 | 
			
		||||
	background-size: 262px 56px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a {
 | 
			
		||||
    color: #692782!important;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
var ed = {
 | 
			
		||||
  partnerId: 1950,
 | 
			
		||||
  applicationName: 'RiV-Mesh App',
 | 
			
		||||
  nasOSName: 'My Cloud OS',
 | 
			
		||||
  basicEDWebsite: "https://github.com/RiV-chain/RiV-mesh",
 | 
			
		||||
  nasVisitEDWebsiteLogin: "https://github.com/RiV-chain/RiV-mesh",
 | 
			
		||||
  nasVisitEDWebsiteSignup: "https://github.com/RiV-chain/RiV-mesh",
 | 
			
		||||
  nasVisitEDWebsiteLoggedin: "https://github.com/RiV-chain/RiV-mesh"
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue